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

Add TextsInAnyOrder #478 #589

Merged
merged 3 commits into from Mar 13, 2018

Conversation

Projects
None yet
6 participants
@hyunil-shin
Contributor

hyunil-shin commented Aug 24, 2017

#478
TextsInAnyOrder compares two lists ignoring order.

Currently, I used assertThat().contains(...) for this.

assertThat(projectSettingPage.productsInUse.texts()).contains("Push", "Image", "Email");

Using texts() failed.

projectSettingPage.productsInUse.shouldBe(texts("Push", "Image", "Email"));
=> TextsMismatch 
Actual: [Image, Push, Email]
Expected: [Push, Image, Email]

Now, I can simply compare two lists ignoring order.

projectSettingPage.productsInUse.shouldBe(textsInAnyOrder("Push", "Image", "Email"));
=> Pass
@BorisOsipov

This comment has been minimized.

Member

BorisOsipov commented Aug 30, 2017

Hi @hyunil-shin
Please, fix checkstyle issues:
https://travis-ci.org/codeborne/selenide/builds/267906168?utm_source=github_status&utm_medium=notification
....
[ant:checkstyle] Running Checkstyle 6.19 on 148 files
[ant:checkstyle] [ERROR] /home/travis/build/codeborne/selenide/src/main/java/com/codeborne/selenide/collections/TextsInAnyOrder.java:26:10: 'for' is not followed by whitespace. [WhitespaceAround]
[ant:checkstyle] [ERROR] /home/travis/build/codeborne/selenide/src/main/java/com/codeborne/selenide/collections/TextsInAnyOrder.java:27: 'if' 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/collections/TextsInAnyOrder.java:27:5: File contains tab characters (this is the first instance). [FileTabCharacter]
[ant:checkstyle] [ERROR] /home/travis/build/codeborne/selenide/src/main/java/com/codeborne/selenide/collections/TextsInAnyOrder.java:28: 'if' child have incorrect indentation level 18, expected level should be 10. [Indentation]
[ant:checkstyle] [ERROR] /home/travis/build/codeborne/selenide/src/main/java/com/codeborne/selenide/collections/TextsInAnyOrder.java:29: 'if rcurly' 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/collections/TextsInAnyOrder.java:31:9: 'if' is not followed by whitespace. [WhitespaceAround]
[ant:checkstyle] [ERROR] /home/travis/build/codeborne/selenide/src/main/java/com/codeborne/selenide/collections/TextsInAnyOrder.java:32: 'if' child have incorrect indentation level 10, expected level should be 8. [Indentation]
[ant:xslt] Processing /home/travis/build/codeborne/selenide/build/reports/checkstyle/main.xml to /home/travis/build/codeborne/selenide/build/reports/checkstyle/main.html

@BorisOsipov

Please, fix checkstyle issues

@BorisOsipov

This comment has been minimized.

Member

BorisOsipov commented Jan 4, 2018

Rerun CI

@BorisOsipov BorisOsipov closed this Jan 4, 2018

@BorisOsipov BorisOsipov reopened this Jan 4, 2018

@coveralls

This comment has been minimized.

coveralls commented Jan 4, 2018

Coverage Status

Coverage increased (+0.03%) to 64.317% when pulling 5adef65 on hyunil-shin:master into 70ba5a8 on codeborne:master.

@codecov-io

This comment has been minimized.

codecov-io commented Jan 4, 2018

Codecov Report

Merging #589 into master will decrease coverage by <.01%.
The diff coverage is 68.42%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #589      +/-   ##
============================================
- Coverage     60.43%   60.43%   -0.01%     
- Complexity      770      776       +6     
============================================
  Files           148      149       +1     
  Lines          2750     2780      +30     
  Branches        270      274       +4     
============================================
+ Hits           1662     1680      +18     
- Misses          982      992      +10     
- Partials        106      108       +2
Impacted Files Coverage Δ Complexity Δ
...va/com/codeborne/selenide/CollectionCondition.java 0% <0%> (ø) 0 <0> (ø) ⬇️
...odeborne/selenide/collections/TextsInAnyOrder.java 76.47% <76.47%> (ø) 7 <7> (?)
...deborne/selenide/impl/SelenideElementIterator.java 85.71% <0%> (-14.29%) 5% <0%> (ø)
...e/selenide/impl/WebDriverThreadLocalContainer.java 78.98% <0%> (-1.45%) 29% <0%> (-1%)
...com/codeborne/selenide/impl/CollectionElement.java 100% <0%> (ø) 7% <0%> (ø) ⬇️
src/main/java/com/codeborne/selenide/Selenide.java 0% <0%> (ø) 0% <0%> (ø) ⬇️
...ava/com/codeborne/selenide/ElementsCollection.java 0% <0%> (ø) 0% <0%> (ø) ⬇️
...rne/selenide/impl/DownloadFileWithHttpRequest.java 79.72% <0%> (+0.27%) 15% <0%> (ø) ⬇️

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 70ba5a8...5adef65. Read the comment docs.

@BorisOsipov BorisOsipov added the ready label Jan 4, 2018

@asolntsev asolntsev added this to the 4.11 milestone Mar 13, 2018

@asolntsev asolntsev self-assigned this Mar 13, 2018

@asolntsev asolntsev merged commit bd4a3c5 into selenide:master Mar 13, 2018

4 checks passed

codecov/patch 68.42% of diff hit (target 60.43%)
Details
codecov/project Absolute coverage decreased by -<.01% but relative coverage increased by +7.98% compared to 70ba5a8
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.03%) to 64.317%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment