@Test public void a_failing_screenshot_records_the_error_message() { Screenshot screenshot = new Screenshot("step_1.png", "Step 1", 800, new AssertionError("Element not found")); assertThat(screenshot.getErrorMessage(), is("Element not found")); }
@Test public void a_screenshot_without_an_error_message__returns_an_empty_string() { Screenshot screenshot = new Screenshot("step_1.png", "Step 1", 800); assertThat(screenshot.getErrorMessage(), is("")); }