New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't show "Screenshots: " in the error log when screenshots are disa… #357

Merged
merged 1 commit into from Jul 6, 2016

Conversation

Projects
None yet
2 participants
@BorisOsipov
Collaborator

BorisOsipov commented Jul 3, 2016

When screenshots are disabled isn't added empty record in error log like this one:

Element not found {By.xpath: //div[@Class='dataTables_scrollBody']}
Expected: exist

Screenshot:
Timeout: 5 s.
Caused by: NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//div[@Class='dataTables_scrollBody']"}

@asolntsev asolntsev merged commit eb51f12 into codeborne:master Jul 6, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@asolntsev

This comment has been minimized.

Show comment
Hide comment
@asolntsev

asolntsev Jul 6, 2016

Member

@BorisOsipov Thank you for the PR!

Member

asolntsev commented Jul 6, 2016

@BorisOsipov Thank you for the PR!

@asolntsev asolntsev added this to the 3.7 milestone Jul 6, 2016

asolntsev added a commit that referenced this pull request Jul 6, 2016

asolntsev added a commit that referenced this pull request Jul 6, 2016

@asolntsev

This comment has been minimized.

Show comment
Hide comment
@asolntsev

asolntsev Jul 6, 2016

Member

@BorisOsipov I also added unit-test demonstrating the behaviour change:

com.codeborne.selenide.ex.ErrorMessagesTest

  @Test
  public void doesNotAddScreenshot_if_screenshotsAreDisabled() {
    Configuration.screenshots = false;

    String screenshot = ErrorMessages.screenshot();
    assertEquals("", screenshot);
    verify(screenshots, never()).takeScreenShot();
  }
Member

asolntsev commented Jul 6, 2016

@BorisOsipov I also added unit-test demonstrating the behaviour change:

com.codeborne.selenide.ex.ErrorMessagesTest

  @Test
  public void doesNotAddScreenshot_if_screenshotsAreDisabled() {
    Configuration.screenshots = false;

    String screenshot = ErrorMessages.screenshot();
    assertEquals("", screenshot);
    verify(screenshots, never()).takeScreenShot();
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment