@Step public void step_with_four_identical_screenshots() { Thucydides.takeScreenshot(); Thucydides.takeScreenshot(); Thucydides.takeScreenshot(); Thucydides.takeScreenshot(); }
@Test public void a_step_listener_should_be_created() { StepListener currentListener = Thucydides.getStepListener(); SampleChildTestClass sampleTestClass = new SampleChildTestClass(); Thucydides.initialize(sampleTestClass); assertThat(Thucydides.getStepListener(), is(not(currentListener))); }
@Test public void no_step_listener_should_be_created() { StepListener currentListener = Thucydides.getStepListener(); SampleChildTestClass sampleTestClass = new SampleChildTestClass(); // Given we don't want to touch the step listened Thucydides.initializeWithNoStepListener(sampleTestClass); // Then the step listener should not be changed assertThat(Thucydides.getStepListener(), is(currentListener)); }
@Test public void a_web_driver_can_be_defined_in_a_parent_class() { SampleChildTestClass sampleTestClass = new SampleChildTestClass(); Thucydides.initialize(sampleTestClass); assertThat(sampleTestClass.driver, is(not(nullValue()))); }
@Test public void any_class_can_host_an_annotated_pages_library() { SampleTestClass sampleTestClass = new SampleTestClass(); Thucydides.initialize(sampleTestClass); assertThat(sampleTestClass.pages, is(not(nullValue()))); }
@Test public void any_class_can_host_an_annotated_webdriver_instance() { SampleTestClass sampleTestClass = new SampleTestClass(); Thucydides.initialize(sampleTestClass); assertThat(sampleTestClass.driver, is(not(nullValue()))); }
@Test public void a_step_library_can_be_defined_as_a_private_field() { SampleTestClassWithPrivateFields sampleTestClass = new SampleTestClassWithPrivateFields(); Thucydides.initialize(sampleTestClass); assertThat(sampleTestClass.steps, is(not(nullValue()))); }
@Test public void a_step_library_can_be_defined_in_a_parent_class() { SampleChildTestClass sampleTestClass = new SampleChildTestClass(); Thucydides.initialize(sampleTestClass); assertThat(sampleTestClass.steps, is(not(nullValue()))); }
public void displayData() { String elementID = getDriver() .findElement( By.xpath(".//*[@id='buyerquestReqreportGrid_table']/tbody/tr[1]/td[4]/div")) .getAttribute("id"); System.out.println(elementID); String script = "document.getElementById('" + elementID + "').style.display = 'block';"; getDriver().manage().timeouts().setScriptTimeout(50000, TimeUnit.SECONDS); ((JavascriptExecutor) getDriver()).executeScript(script); Thucydides.takeScreenshot(); }
public static void main(String[] args) throws Throwable { if (args.length == 1) { testsFolder = args[0]; new RunableIT().run(); } else { testsFolder = "**"; new RunableIT().run(); } File sourceDirectory = new File("target/site/thucydides/"); HtmlAggregateStoryReporter reporter = new HtmlAggregateStoryReporter(Thucydides.getDefaultProjectKey()); reporter.setOutputDirectory(sourceDirectory); reporter.generateReportsForTestResultsFrom(sourceDirectory); System.exit(0); }
@After public void clearMockDriver() { Thucydides.stopUsingMockDriver(); }
@Step public void step_with_two_screenshots() { Thucydides.takeScreenshot(); Thucydides.takeScreenshot(); }
@Step public void programmaticallyPendingStep() { Thucydides.pendingStep("This test should be skipped"); }
@Step public void programmaticallyIgnoredStep() { Thucydides.ignoredStep("This test should be skipped"); }