本文整理匯總了Java中org.testng.AssertJUnit.assertNull方法的典型用法代碼示例。如果您正苦於以下問題:Java AssertJUnit.assertNull方法的具體用法?Java AssertJUnit.assertNull怎麽用?Java AssertJUnit.assertNull使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.testng.AssertJUnit
的用法示例。
在下文中一共展示了AssertJUnit.assertNull方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: executeAsyncScriptWithNullReturn
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void executeAsyncScriptWithNullReturn() throws Throwable {
try {
driver = new JavaDriver();
SwingUtilities.invokeAndWait(new Runnable() {
@Override public void run() {
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
});
WebElement element1 = driver.findElement(By.name("text-field"));
WebElement element2 = (WebElement) ((JavascriptExecutor) driver).executeAsyncScript("$2.call(null);", element1);
AssertJUnit.assertNull(element2);
} finally {
JavaElementFactory.reset();
}
}
示例2: clickHeaderItem
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void clickHeaderItem() throws Throwable {
driver = new JavaDriver();
WebElement header = driver.findElement(By.cssSelector("table::header"));
final WebElement firstItem = header.findElement(By.cssSelector(".::nth-item(1)"));
AssertJUnit.assertNull(firstItem.getAttribute("icon"));
firstItem.click();
new WebDriverWait(driver, 3).until(new Function<WebDriver, Boolean>() {
@Override public Boolean apply(WebDriver input) {
return firstItem.getAttribute("icon") != null;
}
});
AssertJUnit.assertTrue(firstItem.getAttribute("icon").length() > 0);
WebElement secondItem = header.findElement(By.cssSelector(".::nth-item(2)"));
AssertJUnit.assertNull(secondItem.getAttribute("icon"));
secondItem.click();
AssertJUnit.assertTrue(secondItem.getAttribute("icon").length() > 0);
}
示例3: testMax
import org.testng.AssertJUnit; //導入方法依賴的package包/類
@Test
public void testMax(){
AssertJUnit.assertNull(max((Integer)null, null));
AssertJUnit.assertEquals(new Integer(0), max(null, 0));
AssertJUnit.assertEquals(new Integer(0), max(0, null));
AssertJUnit.assertEquals(new Integer(0), max(0, 0));
AssertJUnit.assertEquals(new Integer(3), max(0, 3));
AssertJUnit.assertEquals(new Integer(3), max(3, 0));
AssertJUnit.assertEquals(null, max((Double)null));
AssertJUnit.assertEquals(null, max((Double)null, null));
AssertJUnit.assertEquals(null, max((Double)null, null, null));
AssertJUnit.assertEquals(new Double(3), max(null, null, 3d));
AssertJUnit.assertEquals(new Double(3), max(3d, null));
AssertJUnit.assertEquals(new Double(3), max(3d, 1d));
AssertJUnit.assertEquals(new Double(3), max(1d, 3d));
AssertJUnit.assertEquals(new Double(3), max(1d, 2d, 3d));
AssertJUnit.assertEquals(new Double(3), max(1d, 3d, 2d));
AssertJUnit.assertEquals(new Double(3), max(1d, 3d, null, 2d));
AssertJUnit.assertEquals(new Double(2), max(1d, null, 2d));
}
示例4: getAttributeUnsupportedAttribute
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void getAttributeUnsupportedAttribute() 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.assertNull(element1.getAttribute("enabledX"));
}
示例5: assertMenuItem
import org.testng.AssertJUnit; //導入方法依賴的package包/類
private void assertMenuItem(List<WebElement> menuItems, int i, String text, String iconFileName, String mnemonic) {
WebElement menuItem = menuItems.get(i);
AssertJUnit.assertEquals(text, menuItem.getText());
if ("".equals(iconFileName)) {
AssertJUnit.assertNull(menuItem.getAttribute("icon"));
} else {
AssertJUnit.assertTrue("Icon mismatch", menuItem.getAttribute("icon").endsWith(iconFileName));
}
AssertJUnit.assertEquals("Mnemonic mismatch", mnemonic, menuItem.getAttribute("mnemonic"));
}
示例6: getAttributeNotAvailable
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void getAttributeNotAvailable() throws Throwable {
AssertJUnit.assertNull(ejText.getAttribute("sizeX"));
}
示例7: getCommandLine
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void getCommandLine() {
JavaProfile profile = new JavaProfile();
AssertJUnit.assertNull(profile.getCommandLine());
}
示例8: quit
import org.testng.AssertJUnit; //導入方法依賴的package包/類
public void quit() {
driver = new JavaDriver();
driver.quit();
AssertJUnit.assertNull(((RemoteWebDriver) driver).getSessionId());
}