コード例 #1
0
  @Test
  public void the_first_screenshot_can_be_used_to_represent_the_step() throws IOException {
    TestStep step = new TestStep("a narrative description");

    File screenshot = temporaryFolder.newFile("screenshot.png");
    File source = temporaryFolder.newFile("screenshot.html");
    step.addScreenshot(new ScreenshotAndHtmlSource(screenshot, source));

    File screenshot2 = temporaryFolder.newFile("screenshot2.png");
    File source2 = temporaryFolder.newFile("screenshot2.html");
    step.addScreenshot(new ScreenshotAndHtmlSource(screenshot2, source2));

    assertThat(step.getFirstScreenshot().getScreenshot(), is(screenshot));
    assertThat(step.getFirstScreenshot().getHtmlSource().get(), is(source));
  }
コード例 #2
0
  @Test
  public void the_first_screenshot_is_null_if_there_are_no_screenshots() throws IOException {
    TestStep step = new TestStep("a narrative description");

    assertThat(step.getFirstScreenshot(), is(nullValue()));
  }