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

print html path if savePageSource is true. #590

Merged
merged 4 commits into from Sep 18, 2017
Merged

print html path if savePageSource is true. #590

merged 4 commits into from Sep 18, 2017

Conversation

hyunil-shin
Copy link

#210

# JUnit error message

Element not found {#hello}
Expected: visible
Screenshot: file:/C:/zz.%20My%20Works/10.%20works/UI_TEST/build/reports/tests/com/nhnent/tc/console/ui/BasicCheck/test1/1503627588218.0.png
Html: file:/C:/zz.%20My%20Works/10.%20works/UI_TEST/build/reports/tests/com/nhnent/tc/console/ui/BasicCheck/test1/1503627588218.0.html
Timeout: 10 s.
Caused by: NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"#hello"}

@BorisOsipov
Copy link
Member

Hi @hyunil-shin
Please, fix checkstyle issues:

https://travis-ci.org/codeborne/selenide/builds/268212431?utm_source=github_status&utm_medium=notification
....
[ant:checkstyle] Running Checkstyle 6.19 on 147 files
[ant:checkstyle] [ERROR] /home/travis/build/codeborne/selenide/src/main/java/com/codeborne/selenide/ex/ErrorMessages.java:42:7: 'if' is not followed by whitespace. [WhitespaceAround]
[ant:checkstyle] [ERROR] /home/travis/build/codeborne/selenide/src/main/java/com/codeborne/selenide/ex/ErrorMessages.java:43: 'if' have incorrect indentation level 7, expected level should be 6. [Indentation]
[ant:checkstyle] [ERROR] /home/travis/build/codeborne/selenide/src/main/java/com/codeborne/selenide/ex/ErrorMessages.java:43:10: 'if' is not followed by whitespace. [WhitespaceAround]
[ant:checkstyle] [ERROR] /home/travis/build/codeborne/selenide/src/main/java/com/codeborne/selenide/ex/ErrorMessages.java:44: 'if' child have incorrect indentation level 10, expected level should be 8. [Indentation]
[ant:checkstyle] [ERROR] /home/travis/build/codeborne/selenide/src/main/java/com/codeborne/selenide/ex/ErrorMessages.java:45: 'if rcurly' have incorrect indentation level 7, expected level should be 6. [Indentation]
[ant:checkstyle] [ERROR] /home/travis/build/codeborne/selenide/src/main/java/com/codeborne/selenide/ex/ErrorMessages.java:46: 'if' child have incorrect indentation level 7, expected level should be 6. [Indentation]
[ant:checkstyle] [ERROR] /home/travis/build/codeborne/selenide/src/main/java/com/codeborne/selenide/ex/ErrorMessages.java:48:6: 'else' is not preceded with whitespace. [WhitespaceAround]
[ant:checkstyle] [ERROR] /home/travis/build/codeborne/selenide/src/main/java/com/codeborne/selenide/ex/ErrorMessages.java:48:6: '}' is not followed by whitespace. [WhitespaceAround]
[ant:checkstyle] [ERROR] /home/travis/build/codeborne/selenide/src/main/java/com/codeborne/selenide/ex/ErrorMessages.java:49: 'else' child have incorrect indentation level 7, expected level should be 6. [Indentation]

Copy link
Member

@BorisOsipov BorisOsipov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, fix checkstyle issues

@hyunil-shin
Copy link
Author

@BorisOsipov Thank you for your feedback.

I got many "Missing a Javadoc comment" errors in my environments (gradle check). How can I get the same result as Travis CI?

[ant:checkstyle] [ERROR] E:\selenide\src\main\java\com\codeborne\selenide\impl\Html.java:10:3: Missing a Javadoc comment. [JavadocMethod]
[ant:checkstyle] [ERROR] E:\selenide\src\main\java\com\codeborne\selenide\impl\Html.java:14:3: Missing a Javadoc comment. [JavadocMethod]
[ant:checkstyle] [ERROR] E:\selenide\src\main\java\com\codeborne\selenide\impl\Html.java:18:3: Missing a Javadoc comment. [JavadocMethod]
[ant:checkstyle] [ERROR] E:\selenide\src\main\java\com\codeborne\selenide\impl\Html.java:22:3: Missing a Javadoc comment. [JavadocMethod]
[ant:checkstyle] [ERROR] E:\selenide\src\main\java\com\codeborne\selenide\impl\Html.java:26:3: Missing a Javadoc comment. [JavadocMethod]

@BorisOsipov
Copy link
Member

@hyunil-shin yes it's windows issue :(. On linux gradle check works well.

@@ -39,7 +39,15 @@ public static String screenshot(String screenshotPath) {
if (!Configuration.screenshots) {
return "";
}
return "\nScreenshot: " + screenshotPath;
if (Configuration.savePageSource) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if Configuration.screenshots=false and Configuration.savePageSource=true
we will not have PageSource in error message. I guess it's wrong.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind. I look through code and understand why it is so.

Fix tests and small rewording.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.2%) to 64.415% when pulling a3e84f3 on hyunil-shin:print_html_path into fadbd58 on codeborne:master.

@codecov-io
Copy link

codecov-io commented Sep 18, 2017

Codecov Report

Merging #590 into master will increase coverage by 0.24%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #590      +/-   ##
============================================
+ Coverage     60.17%   60.41%   +0.24%     
- Complexity      723      728       +5     
============================================
  Files           134      134              
  Lines          2644     2650       +6     
  Branches        267      269       +2     
============================================
+ Hits           1591     1601      +10     
+ Misses          947      943       -4     
  Partials        106      106
Impacted Files Coverage Δ Complexity Δ
.../java/com/codeborne/selenide/ex/ErrorMessages.java 86.2% <100%> (+3.59%) 17 <1> (+4) ⬆️
...e/selenide/impl/WebDriverThreadLocalContainer.java 77.93% <0%> (+0.68%) 30% <0%> (ø) ⬇️
...java/com/codeborne/selenide/commands/ScrollTo.java 100% <0%> (+75%) 2% <0%> (+1%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fadbd58...a3e84f3. Read the comment docs.

@BorisOsipov BorisOsipov merged commit f25a2b3 into selenide:master Sep 18, 2017
@BorisOsipov
Copy link
Member

@hyunil-shin Thank you!

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

6 participants