Skip to content
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

BorisOsipov
Copy link
Member

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 selenide:master Jul 6, 2016
@asolntsev
Copy link
Member

@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
Copy link
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();
  }

@asolntsev asolntsev self-assigned this Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants