Exemplo n.º 1
0
 @Step
 public void step_with_four_identical_screenshots() {
   Thucydides.takeScreenshot();
   Thucydides.takeScreenshot();
   Thucydides.takeScreenshot();
   Thucydides.takeScreenshot();
 }
Exemplo n.º 2
0
  @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)));
  }
Exemplo n.º 3
0
  @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));
  }
Exemplo n.º 4
0
  @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())));
  }
Exemplo n.º 5
0
  @Test
  public void any_class_can_host_an_annotated_pages_library() {
    SampleTestClass sampleTestClass = new SampleTestClass();

    Thucydides.initialize(sampleTestClass);

    assertThat(sampleTestClass.pages, is(not(nullValue())));
  }
Exemplo n.º 6
0
  @Test
  public void any_class_can_host_an_annotated_webdriver_instance() {
    SampleTestClass sampleTestClass = new SampleTestClass();

    Thucydides.initialize(sampleTestClass);

    assertThat(sampleTestClass.driver, is(not(nullValue())));
  }
Exemplo n.º 7
0
  @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())));
  }
Exemplo n.º 8
0
  @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);
 }
Exemplo n.º 11
0
 @After
 public void clearMockDriver() {
   Thucydides.stopUsingMockDriver();
 }
Exemplo n.º 12
0
 @Step
 public void step_with_two_screenshots() {
   Thucydides.takeScreenshot();
   Thucydides.takeScreenshot();
 }
Exemplo n.º 13
0
 @Step
 public void programmaticallyPendingStep() {
   Thucydides.pendingStep("This test should be skipped");
 }
Exemplo n.º 14
0
 @Step
 public void programmaticallyIgnoredStep() {
   Thucydides.ignoredStep("This test should be skipped");
 }