@Test public void test35() throws Exception { driver.get(baseUrl + "/accountType/list"); driver.findElement(By.xpath("//strong[text()='Direct Customer']")).click(); driver.findElement(By.cssSelector("a.submit.edit > span")).click(); driver.findElement(By.id("creditLimitAsDecimal")).clear(); driver.findElement(By.id("creditLimitAsDecimal")).sendKeys("300.00"); driver.findElement(By.cssSelector("a.submit.save > span")).click(); driver.findElement(By.xpath("//strong[text()='Direct Customer']")).click(); driver.findElement(By.cssSelector("a.submit.edit > span")).click(); driver.findElement(By.id("creditLimitAsDecimal")).clear(); driver.findElement(By.id("creditLimitAsDecimal")).sendKeys("200.00"); driver.findElement(By.cssSelector("a.submit.save > span")).click(); driver.findElement(By.xpath("//strong[text()='Direct Customer']")).click(); Assert.assertEquals(driver.getPageSource().contains("US$200.00"), true); }
@Test public void exampleAssertThat() { setPersonTwoName("richard"); Assert.assertThat("The two names do not match", getPersonOneName(), is("richard")); }
@Test public void exampleAssertEquals() { setPersonTwoName("richard"); Assert.assertEquals( "Person one and Person two's names are not equal", getPersonOneName(), getPersonTwoName()); }
@Test public void exampleAssertFalse() { Assert.assertFalse( "Person One's age should not be equal to the specified value", getPersonOneAge() == 13); }
@Test public void exampleAssertTrue() { Assert.assertTrue( "The start of person one and person two's names is different", getPersonOneName().startsWith("ric")); }
@Test public void exampleHamcrestExampleMethod() { Assert.assertThat( getPersonOneName(), either(containsString("rich")).or(containsString("anne"))); }
@Test public void exampleHamcrestBothMethod() { Assert.assertThat(getPersonOneName(), both(containsString("ri")).and(containsString("ard"))); }