本文整理匯總了Java中org.testng.AssertJUnit.assertFalse方法的典型用法代碼示例。如果您正苦於以下問題:Java AssertJUnit.assertFalse方法的具體用法?Java AssertJUnit.assertFalse怎麽用?Java AssertJUnit.assertFalse使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.testng.AssertJUnit
的用法示例。
在下文中一共展示了AssertJUnit.assertFalse方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: click
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void click() {
try {
buttonClicked = false;
EventQueueWait.requestFocus(button);
driver.click(button, Buttons.LEFT, 1, 0, 0);
new DeviceTest.WaitWithoutException("Waiting for events to be processed") {
@Override public boolean until() {
return buttonClicked;
}
};
AssertJUnit.assertTrue(buttonClicked);
AssertJUnit.assertEquals(MouseEvent.BUTTON1, clickedButton);
AssertJUnit.assertFalse(altDown);
AssertJUnit.assertFalse(metaDown);
AssertJUnit.assertFalse(controlDown);
AssertJUnit.assertFalse(shiftDown);
AssertJUnit.assertFalse(altGraphDown);
AssertJUnit.assertEquals(1, maxClickCount);
} finally {
Logger.getLogger(DeviceMouseTest.class.getName()).info(mouseText.toString());
moveCursorAway();
}
}
示例2: clickWithAlt
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void clickWithAlt() throws Throwable {
try {
mouseText.setLength(0);
EventQueueWait.requestFocus(button);
driver.pressKey(button, JavaAgentKeys.ALT);
driver.click(button, Buttons.LEFT, 1, 0, 0);
driver.releaseKey(button, JavaAgentKeys.ALT);
new DeviceTest.WaitWithoutException("Waiting for events to be processed") {
@Override public boolean until() {
return buttonClicked;
}
};
AssertJUnit.assertTrue(buttonClicked);
AssertJUnit.assertEquals(MouseEvent.BUTTON1, clickedButton);
AssertJUnit.assertTrue(altDown);
AssertJUnit.assertFalse(metaDown);
AssertJUnit.assertFalse(controlDown);
AssertJUnit.assertFalse(shiftDown);
AssertJUnit.assertFalse(altGraphDown);
AssertJUnit.assertEquals(1, maxClickCount);
} finally {
Logger.getLogger(DeviceMouseTest.class.getName()).info(mouseText.toString());
moveCursorAway();
}
}
示例3: doubleClick
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void doubleClick() {
try {
mouseText.setLength(0);
buttonClicked = false;
EventQueueWait.requestFocus(button);
driver.click(button, Buttons.LEFT, 2, 0, 0);
new DeviceTest.WaitWithoutException("Waiting for events to be processed") {
@Override public boolean until() {
return maxClickCount == 2;
}
};
AssertJUnit.assertTrue(buttonClicked);
AssertJUnit.assertEquals(MouseEvent.BUTTON1, clickedButton);
AssertJUnit.assertFalse(altDown);
AssertJUnit.assertFalse(metaDown);
AssertJUnit.assertFalse(controlDown);
AssertJUnit.assertFalse(shiftDown);
AssertJUnit.assertFalse(altGraphDown);
AssertJUnit.assertEquals(2, maxClickCount);
} finally {
Logger.getLogger(DeviceMouseTest.class.getName()).info(mouseText.toString());
moveCursorAway();
}
}
示例4: mouseDown
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void mouseDown() throws Throwable {
try {
mouseText.setLength(0);
EventQueueWait.requestFocus(button);
driver.buttonDown(button, Buttons.LEFT, 0, 0);
new DeviceTest.WaitWithoutException("Waiting for events to be processed") {
@Override public boolean until() {
return buttonPressed;
}
};
AssertJUnit.assertFalse(buttonClicked);
AssertJUnit.assertTrue(buttonPressed);
AssertJUnit.assertEquals(MouseEvent.BUTTON1, pressedButton);
AssertJUnit.assertFalse(altDown);
AssertJUnit.assertFalse(metaDown);
AssertJUnit.assertFalse(controlDown);
AssertJUnit.assertFalse(shiftDown);
AssertJUnit.assertFalse(altGraphDown);
} finally {
Logger.getLogger(DeviceMouseTest.class.getName()).info(mouseText.toString());
driver.buttonUp(button, Buttons.LEFT, 0, 0);
moveCursorAway();
}
}
示例5: altContextClick
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void altContextClick() {
try {
buttonClicked = false;
EventQueueWait.requestFocus(button);
driver.pressKey(button, JavaAgentKeys.ALT);
driver.click(button, Buttons.RIGHT, 1, 0, 0);
driver.releaseKey(button, JavaAgentKeys.ALT);
new DeviceTest.WaitWithoutException("Waiting for events to be processed") {
@Override public boolean until() {
return buttonClicked;
}
};
AssertJUnit.assertTrue(buttonClicked);
AssertJUnit.assertEquals(MouseEvent.BUTTON3, clickedButton);
AssertJUnit.assertFalse(popupTriggerClicked);
AssertJUnit.assertTrue(altDown);
AssertJUnit.assertFalse(metaDown);
AssertJUnit.assertFalse(controlDown);
AssertJUnit.assertFalse(shiftDown);
AssertJUnit.assertFalse(altGraphDown);
AssertJUnit.assertEquals(1, maxClickCount);
} finally {
Logger.getLogger(DeviceMouseTest.class.getName()).info(mouseText.toString());
moveCursorAway();
}
}
示例6: isDisplayedTabItem
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void isDisplayedTabItem() throws Throwable {
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
frame.setSize(100, frame.getHeight());
}
});
driver = new JavaDriver();
final List<WebElement> tabs = driver.findElements(By.cssSelector("tabbed-pane::nth-tab(4)"));
AssertJUnit.assertEquals(1, tabs.size());
new Wait("Wait for tab4 to non-displayable") {
@Override public boolean until() {
return !tabs.get(0).isDisplayed();
}
};
AssertJUnit.assertFalse(tabs.get(0).isDisplayed());
List<WebElement> tabs2 = driver.findElements(By.cssSelector("tabbed-pane::nth-tab(1)"));
AssertJUnit.assertEquals(1, tabs.size());
AssertJUnit.assertTrue(tabs2.get(0).isDisplayed());
}
示例7: clickTabItem
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void clickTabItem() throws Throwable {
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
frame.setSize(100, frame.getHeight());
}
});
driver = new JavaDriver();
final List<WebElement> tabs = driver.findElements(By.cssSelector("tabbed-pane::nth-tab(4)"));
AssertJUnit.assertEquals(1, tabs.size());
new Wait("Wait for tab4 to non-displayable") {
@Override public boolean until() {
return !tabs.get(0).isDisplayed();
}
};
AssertJUnit.assertFalse(tabs.get(0).isDisplayed());
tabs.get(0).click();
AssertJUnit.assertTrue(tabs.get(0).isDisplayed());
WebElement tabbedPane = driver.findElement(By.cssSelector("tabbed-pane"));
AssertJUnit.assertEquals("" + 3, tabbedPane.getAttribute("selectedIndex"));
}
示例8: isEnabled
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void isEnabled() throws Throwable {
driver = new JavaDriver();
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
});
WebElement element1 = driver.findElement(By.name("click-me"));
AssertJUnit.assertTrue(element1.isEnabled());
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
button.setEnabled(false);
}
});
EventQueueWait.waitTillDisabled(button);
AssertJUnit.assertFalse(element1.isEnabled());
}
示例9: getAttribute
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void getAttribute() throws Throwable {
driver = new JavaDriver();
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
});
WebElement element1 = driver.findElement(By.name("click-me"));
AssertJUnit.assertTrue(Boolean.valueOf(element1.getAttribute("enabled")));
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
button.setEnabled(false);
}
});
EventQueueWait.waitTillDisabled(button);
AssertJUnit.assertFalse(Boolean.valueOf(element1.getAttribute("enabled")));
}
示例10: isDisplayed
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void isDisplayed() throws Throwable {
driver = new JavaDriver();
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
});
WebElement element1 = driver.findElement(By.name("click-me"));
AssertJUnit.assertTrue(element1.isDisplayed());
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
button.setVisible(false);
}
});
EventQueueWait.waitTillInvisibled(button);
AssertJUnit.assertFalse(element1.isDisplayed());
}
示例11: click
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void click() throws Throwable {
AssertJUnit.assertFalse(buttonClicked);
ejButton.click();
new WaitWithoutException("Waiting for the button to be clicked") {
@Override public boolean until() {
return buttonClicked;
}
};
AssertJUnit.assertTrue(buttonClicked);
}
示例12: isEnabled
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void isEnabled() throws Throwable {
AssertJUnit.assertTrue(ejButton.isEnabled());
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
button.setEnabled(false);
}
});
AssertJUnit.assertFalse(ejButton.isEnabled());
}
示例13: isDisplayed
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void isDisplayed() throws Throwable {
AssertJUnit.assertTrue(ejButton.isDisplayed());
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
button.setVisible(false);
}
});
AssertJUnit.assertFalse(ejButton.isDisplayed());
}
示例14: clickWithAltControl
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void clickWithAltControl() throws Throwable {
try {
mouseText.setLength(0);
EventQueueWait.requestFocus(button);
driver.pressKey(button, JavaAgentKeys.ALT);
driver.pressKey(button, JavaAgentKeys.CONTROL);
driver.click(button, Buttons.LEFT, 1, 0, 0);
driver.releaseKey(button, JavaAgentKeys.CONTROL);
driver.releaseKey(button, JavaAgentKeys.ALT);
new DeviceTest.WaitWithoutException("Waiting for events to be processed") {
@Override public boolean until() {
return buttonClicked;
}
};
AssertJUnit.assertTrue(buttonClicked);
AssertJUnit.assertEquals(MouseEvent.BUTTON1, clickedButton);
AssertJUnit.assertTrue(altDown);
AssertJUnit.assertFalse(metaDown);
AssertJUnit.assertTrue(controlDown);
AssertJUnit.assertFalse(shiftDown);
AssertJUnit.assertFalse(altGraphDown);
AssertJUnit.assertEquals(1, maxClickCount);
} finally {
Logger.getLogger(DeviceMouseTest.class.getName()).info(mouseText.toString());
moveCursorAway();
}
}
示例15: testPrefixAndUri1
import org.testng.AssertJUnit; //導入方法依賴的package包/類
@Test
public void testPrefixAndUri1() {
boolean hasdc = false;
boolean hasdc1 = false;
boolean hasdc2 = false;
boolean hasdcnew = false;
NamespaceSupport nssupport = new NamespaceSupport();
nssupport.pushContext();
nssupport.declarePrefix("dc", "http://www.purl.org/dc");
nssupport.pushContext();
nssupport.declarePrefix("dc1", "http://www.purl.org/dc");
nssupport.declarePrefix("dc2", "http://www.purl.org/dc2");
nssupport.declarePrefix("dcnew", "http://www.purl.org/dcnew");
Enumeration enu1 = nssupport.getDeclaredPrefixes();
while (enu1.hasMoreElements()) {
String str = (String) enu1.nextElement();
if (str.equals("dc")) {
hasdc = true;
} else if (str.equals("dc1")) {
hasdc1 = true;
} else if (str.equals("dc2")) {
hasdc2 = true;
} else if (str.equals("dcnew")) {
hasdcnew = true;
}
}
AssertJUnit.assertTrue(hasdcnew && hasdc1 && hasdc2);
AssertJUnit.assertFalse(hasdc);
}