本文整理汇总了Java中org.testng.asserts.SoftAssert类的典型用法代码示例。如果您正苦于以下问题:Java SoftAssert类的具体用法?Java SoftAssert怎么用?Java SoftAssert使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SoftAssert类属于org.testng.asserts包,在下文中一共展示了SoftAssert类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: testSoftAssert
import org.testng.asserts.SoftAssert; //导入依赖的package包/类
@Test
public void testSoftAssert() {
SoftAssert s = new SoftAssert();
s.assertEquals(2 * 2, 3, "Three");
s.assertEquals(2 * 2, 5, "Five");
s.assertAll();
}
开发者ID:barancev,项目名称:testng_samples,代码行数:8,代码来源:AssertionsTest.java
示例2: selectCategoryAndTopic
import org.testng.asserts.SoftAssert; //导入依赖的package包/类
@Test
public void selectCategoryAndTopic() {
WebDriver driver = null;
SoftAssert softAssert = new SoftAssert();
try {
driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
driver.manage().window().maximize();
driver.get("http://automated-testing.info");
SamplePage samplePage = new SamplePage(driver)
.selectCategoryByName("webdriver")
.selectTopicByIndex(1);
softAssert.assertEquals(samplePage.getCurrentCategory(), "webdriver", "Wrong category");
softAssert.assertEquals(samplePage.getTopicCreator(), "val_ch", "Wrong topic starter");
softAssert.assertAll();
} catch (Exception e) {
e.printStackTrace();
} finally {
if (driver != null) {
driver.quit();
}
}
}
开发者ID:atinfo,项目名称:at.info-knowledge-base,代码行数:28,代码来源:DynamicLocatorsTests.java
示例3: finalAssert
import org.testng.asserts.SoftAssert; //导入依赖的package包/类
@AfterClass
public void finalAssert(){
SoftAssert softAssert = new SoftAssert();
softAssert.assertTrue(orderOfExecution.contains("test1 wayToName"), "group 'first' was not grouped");
softAssert.assertTrue(orderOfExecution.contains("originalName thisOne"), "group 'third' was not grouped");
softAssert.assertTrue(orderOfExecution.contains("coveredByTests treatThisRight"), "group 'second' was not grouped");
softAssert.assertAll();
}
开发者ID:yaroslav-orel,项目名称:ExtendNG,代码行数:11,代码来源:OrderByGroupsTest.java
示例4: startTest
import org.testng.asserts.SoftAssert; //导入依赖的package包/类
@BeforeMethod
public void startTest() {
softAssert = new SoftAssert();
}
开发者ID:tacianosilva,项目名称:designmetrics,代码行数:5,代码来源:EfferentCouplingBetweenPackagesTest.java
示例5: start
import org.testng.asserts.SoftAssert; //导入依赖的package包/类
@BeforeMethod
public void start(){
softAssert = new SoftAssert();
generateCssSelector = WebLocatorConfig.isGenerateCssSelector();
WebLocatorConfig.setGenerateCssSelector(true);
}
开发者ID:sdl,项目名称:Testy,代码行数:7,代码来源:WebLocatorCssTest.java
注:本文中的org.testng.asserts.SoftAssert类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论