当前位置: 首页>>代码示例>>Java>>正文


Java JButtonMatcher类代码示例

本文整理汇总了Java中org.fest.swing.core.matcher.JButtonMatcher的典型用法代码示例。如果您正苦于以下问题:Java JButtonMatcher类的具体用法?Java JButtonMatcher怎么用?Java JButtonMatcher使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


JButtonMatcher类属于org.fest.swing.core.matcher包,在下文中一共展示了JButtonMatcher类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldSaveJiraConfig

import org.fest.swing.core.matcher.JButtonMatcher; //导入依赖的package包/类
@Test
public void shouldSaveJiraConfig() throws InterruptedException {
	editorFixture.menuItemWithPath("Tools", "Settings").click();
	editorFixture.dialog().textBox("jiraUrl").setText("xyz");
	editorFixture.dialog().textBox("jiraUsername").setText("abc");

	editorFixture.dialog().button(JButtonMatcher.withText("Save")).click();

	UserProperties props = injector.getInstance(UserProperties.class);
	assertThat(props.getJiraConfig().getInstanceUrl()).isEqualTo("xyz");
	assertThat(props.getJiraConfig().getUsername()).isEqualTo("abc");

	editorFixture.menuItemWithPath("Tools", "Settings").click();
	editorFixture.dialog().textBox("jiraUrl").requireText("xyz");
	editorFixture.dialog().textBox("jiraUsername").requireText("abc");
}
 
开发者ID:mnikliborc,项目名称:clicktrace,代码行数:17,代码来源:SettingsTest.java

示例2: shouldSetAndCancelAndSetCaptureArea

import org.fest.swing.core.matcher.JButtonMatcher; //导入依赖的package包/类
@Test
public void shouldSetAndCancelAndSetCaptureArea() throws InterruptedException {
	editorFixture.menuItemWithPath("Tools", "Settings").click();

	DialogFixture dialog = editorFixture.dialog();

	// deselect 'full screen'
	dialog.checkBox(CaptureAreaComponent.FULL_SCREEN_CHECKBOX_NAME).click();
	assertButtonsTextIsChange(dialog);

	// set-cancel-set start point
	testSettingAndCancellingPoint(dialog, PointWidget.START, new Point(400, 600), new Point(0, 0));
	assertButtonsTextIsChange(dialog);

	// set-cancel-set end point
	testSettingAndCancellingPoint(dialog, PointWidget.END, new Point(200, 300),
			new Point(ScreenUtils.getPrimarySize().width, ScreenUtils.getPrimarySize().height));
	assertButtonsTextIsChange(dialog);

	// save settings
	dialog.button(JButtonMatcher.withText("Save")).click();

	UserProperties props = injector.getInstance(UserProperties.class);
	assertThat(props.getCaptureFullScreen()).isFalse();
	assertThat(props.getCaptureRectangle()).isEqualTo(new Rectangle(200, 300, 200, 300));
}
 
开发者ID:mnikliborc,项目名称:clicktrace,代码行数:27,代码来源:CaptureAreaComponentTest.java

示例3: shouldFindByDescription

import org.fest.swing.core.matcher.JButtonMatcher; //导入依赖的package包/类
@Test
public void shouldFindByDescription() throws InterruptedException {
	editorFixture.menuItemWithPath("Tools", "Find").click();
	editorFixture.dialog().textBox().setText("desc");

	editorFixture.dialog().button(JButtonMatcher.withText("Search")).click();

	editorFixture.dialog().table().requireCellValue(TableCell.row(0).column(3), "some description");

	editorFixture.dialog().table().selectRows(0).doubleClick();

	assertThat(editorFixture.comboBox().contents()).hasSize(4);

	ActiveSession activeSession = injector.getInstance(ActiveSession.class);
	assertThat(activeSession.isSessionLoaded()).isTrue();
	assertThat(activeSession.getSession()).isNotNull();
	assertThat(activeSession.getSession().getName()).isEqualTo("one");
}
 
开发者ID:mnikliborc,项目名称:clicktrace,代码行数:19,代码来源:SearchDialogTest.java

示例4: shouldCreateNewSession

import org.fest.swing.core.matcher.JButtonMatcher; //导入依赖的package包/类
@Test
public void shouldCreateNewSession() throws InterruptedException, ConfigurationException {
	// given
	final String sessionName = "test session";
	final String sessionDescription = null;

	// when
	editorFixture.menuItemWithPath("File", "New session").click();
	DialogFixture dialogPane = editorFixture.dialog();
	dialogPane.textBox("name").setText(sessionName);
	dialogPane.button(JButtonMatcher.withText("Create")).click();

	// then
	try {
		assertThat(editorFixture.optionPane()).isNull();
	} catch (WaitTimedOutError ex) {
	}

	assertThat(activeSession.isSessionLoaded()).isTrue();
	assertThat(activeSession.getSession()).isNotNull();
	assertThat(activeSession.getSession().getName()).isEqualTo(sessionName);

	assertDataPersisted(sessionName, sessionDescription);
	assertControlsState();
}
 
开发者ID:mnikliborc,项目名称:clicktrace,代码行数:26,代码来源:NewSessionTest.java

示例5: shouldCreateNewSessionWithDescription

import org.fest.swing.core.matcher.JButtonMatcher; //导入依赖的package包/类
@Test
public void shouldCreateNewSessionWithDescription() throws InterruptedException, ConfigurationException {
	// given
	final String sessionName = "test session";
	final String sessionDescription = "test session description";

	// when
	editorFixture.menuItemWithPath("File", "New session").click();
	DialogFixture dialogPane = editorFixture.dialog();
	dialogPane.textBox("name").setText(sessionName);
	dialogPane.textBox("description").setText(sessionDescription);
	dialogPane.button(JButtonMatcher.withText("Create")).click();

	// then
	try {
		assertThat(editorFixture.optionPane()).isNull();
	} catch (WaitTimedOutError ex) {
	}

	assertThat(activeSession.isSessionLoaded()).isTrue();
	assertThat(activeSession.getSession()).isNotNull();
	assertThat(activeSession.getSession().getDescription()).isEqualTo(sessionDescription);

	assertDataPersisted(sessionName, sessionDescription);
	assertControlsState();
}
 
开发者ID:mnikliborc,项目名称:clicktrace,代码行数:27,代码来源:NewSessionTest.java

示例6: shouldNotCreateExistingSession

import org.fest.swing.core.matcher.JButtonMatcher; //导入依赖的package包/类
@Test
public void shouldNotCreateExistingSession() throws InterruptedException {
	// given
	final String sessionName = "test session";

	// when
	editorFixture.menuItemWithPath("File", "New session").click();
	DialogFixture dialogPane = editorFixture.dialog();
	dialogPane.textBox("name").setText(sessionName);
	dialogPane.button(JButtonMatcher.withText("Create")).click();

	editorFixture.menuItemWithPath("File", "New session").click();
	dialogPane.textBox("name").setText(sessionName);
	dialogPane.button(JButtonMatcher.withText("Create")).click();

	// then
	JOptionPaneFixture optionPane = editorFixture.optionPane();
	assertThat(optionPane).isNotNull();
	optionPane.button().click();

	boolean sessionDirExists = Files.exists(props.getSessionsDirPath() + sessionName);
	assertThat(sessionDirExists).isTrue();
}
 
开发者ID:mnikliborc,项目名称:clicktrace,代码行数:24,代码来源:NewSessionTest.java

示例7: shouldDeleteActive

import org.fest.swing.core.matcher.JButtonMatcher; //导入依赖的package包/类
@Test
public void shouldDeleteActive() {
	// given
	SystemTestSteps.openSession(editorFixture, "one");

	// when
	editorFixture.comboBox().selectItem(1);
	editorFixture.checkBox().check();
	editorFixture.comboBox().selectItem(2);
	editorFixture.checkBox().requireNotSelected();
	editorFixture.button(JButtonMatcher.withText("delete")).click();
	editorFixture.optionPane().okButton().click();

	// then
	editorFixture.checkBox().requireSelected();
	editorFixture.comboBox().requireSelection(1);
	assertThat(activeSession.getSession().getShots()).hasSize(3);
	assertThat(activeSession.getActiveShot().getFilename()).isEqualTo(editorFixture.comboBox().contents()[1]);
}
 
开发者ID:mnikliborc,项目名称:clicktrace,代码行数:20,代码来源:DeleteScreenShotTest.java

示例8: shouldChangeDescription

import org.fest.swing.core.matcher.JButtonMatcher; //导入依赖的package包/类
@Test
public void shouldChangeDescription() throws InterruptedException {
	SystemTestSteps.openSession(editorFixture, "one");

	editorFixture.button(JButtonMatcher.withText("show description")).click();
	assertThat(editorFixture.dialog().textBox().text()).isEqualTo("some description");
	editorFixture.dialog().button(JButtonMatcher.withText("Cancel")).click();
	editorFixture.comboBox().selectItem(1);

	editorFixture.menuItemWithPath("Screenshot", "Change description").click();
	editorFixture.dialog().textBox().setText("another description");
	editorFixture.dialog().button(JButtonMatcher.withText("Save")).click();

	editorFixture.menuItemWithPath("Session", "Refresh session").click();
	editorFixture.comboBox().selectItem(1);
	editorFixture.button(JButtonMatcher.withText("show description")).click();
	assertThat(editorFixture.dialog().textBox().text()).isEqualTo("another description");
}
 
开发者ID:mnikliborc,项目名称:clicktrace,代码行数:19,代码来源:ChangeScreenShotDescriptionTest.java

示例9: shouldChangeName

import org.fest.swing.core.matcher.JButtonMatcher; //导入依赖的package包/类
@Test
public void shouldChangeName() throws InterruptedException {
	editorFixture.menuItemWithPath("File", "Open session").click();
	editorFixture.dialog().table().cell(TableCell.row(0).column(0)).click();
	editorFixture.dialog().button(JButtonMatcher.withText("Open")).click();
	editorFixture.maximize();

	editorFixture.menuItemWithPath("Session", "Change name").click();
	editorFixture.optionPane().textBox().setText("not one");
	editorFixture.optionPane().okButton().click();

	editorFixture.menuItemWithPath("Session", "Refresh session").click();
	editorFixture.menuItemWithPath("File", "Open session").click();
	editorFixture.dialog().table().cell(TableCell.row(0).column(0)).requireValue("not one");
}
 
开发者ID:mnikliborc,项目名称:clicktrace,代码行数:16,代码来源:ChangeSessionNameTest.java

示例10: reorder

import org.fest.swing.core.matcher.JButtonMatcher; //导入依赖的package包/类
private ScreenShot reorder(String sessionName) {
	// given
	SystemTestSteps.openSession(editorFixture, sessionName);
	ScreenShot firstShot = activeSession.getShot(0);
	
	// when
	editorFixture.menuItemWithPath("Session", "Reorder screenshots").click();
	editorFixture.dialog().button("next").click();
	editorFixture.dialog().button(JButtonMatcher.withText("Save")).click();
	return firstShot;
}
 
开发者ID:mnikliborc,项目名称:clicktrace,代码行数:12,代码来源:ReorderScreenShotsTest.java

示例11: findButtonByText

import org.fest.swing.core.matcher.JButtonMatcher; //导入依赖的package包/类
@NotNull
private JButton findButtonByText(@NotNull String text) {
  return robot().finder().find(target(), JButtonMatcher.withText(text).andShowing());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:AvdManagerDialogFixture.java

示例12: deleteShot

import org.fest.swing.core.matcher.JButtonMatcher; //导入依赖的package包/类
public static void deleteShot(FrameFixture editorFixture, int index) {
	editorFixture.comboBox().selectItem(index);
	editorFixture.button(JButtonMatcher.withText("delete")).click();
	editorFixture.optionPane().okButton().click();
}
 
开发者ID:mnikliborc,项目名称:clicktrace,代码行数:6,代码来源:SystemTestSteps.java


注:本文中的org.fest.swing.core.matcher.JButtonMatcher类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。