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

feat: Tests/enhance e2e test coverage #326

Merged
merged 29 commits into from
Nov 3, 2020

Conversation

cnrun
Copy link
Collaborator

@cnrun cnrun commented Nov 1, 2020

No description provided.

@github-actions
Copy link

github-actions bot commented Nov 1, 2020

Bundle difference

Asset group Old size New size Diff
all 12.14 MB 12.13 MB -14.82 KB (-0.12%)
documents 7.15 KB 7.15 KB 0 B (0.00%)
scripts 2.4 MB 2.4 MB -2.94 KB (-0.12%)
stylesheets 181.71 KB 181.71 KB 0 B (0.00%)
images 802.2 KB 795.6 KB -6.6 KB (-0.82%)
misc 1016.32 KB 1016.32 KB 0 B (0.00%)

@cnrun
Copy link
Collaborator Author

cnrun commented Nov 1, 2020

Notification: @DanielHabenicht, @ChristophWersal
would you like having a look at this PR?
I've added some testcafe scenarios.
I've encountered some difficulties by finding the elements paths. I've used .nth(1) for example to click the closing button of the risk description panel.
Regards, Éric.

@cnrun cnrun changed the title Tests/enhance e2e test coverage feat: Tests/enhance e2e test coverage Nov 1, 2020
@github-actions
Copy link

github-actions bot commented Nov 1, 2020

Bundle difference

Asset group Old size New size Diff
all 12.14 MB 12.13 MB -14.82 KB (-0.12%)
documents 7.15 KB 7.15 KB 0 B (0.00%)
scripts 2.4 MB 2.4 MB -2.94 KB (-0.12%)
stylesheets 181.71 KB 181.71 KB 0 B (0.00%)
images 802.2 KB 795.6 KB -6.6 KB (-0.82%)
misc 1016.32 KB 1016.32 KB 0 B (0.00%)

@github-actions
Copy link

github-actions bot commented Nov 1, 2020

Bundle difference

Asset group Old size New size Diff
all 12.14 MB 12.14 MB 0 B (0.00%)
documents 7.15 KB 7.15 KB 0 B (0.00%)
scripts 2.4 MB 2.4 MB 0 B (0.00%)
stylesheets 181.71 KB 181.71 KB 0 B (0.00%)
images 802.2 KB 802.2 KB 0 B (0.00%)
misc 1016.32 KB 1016.32 KB 0 B (0.00%)

fixture`Search field test`.page`${Config.baseUrl}`
.beforeEach( async t => {
const nextButton = Selector("a").withAttribute("role", "button").child().withText("Weiter");
const websiteText = Selector("html").textContent;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Getting the whole text of the website has shown to be unreliable. In introScreens.spec.ts on master this functionality is slightly refactored. It might be good to use it in here too.

It might even make sense to create a common "page object" to have the logic in one place. Something like "IntroPage.ts" with a function: finishIntroScreensWith(plz?: string).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Getting the whole text is not reliable, hidden text are always appearing in the Selector("html").textContent String.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm leave the assertion as it is, any held appreciate.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I added a PR that changes this branch with some changes to get rid of code duplication and to not use the whole html text content.
#349

// console.log("close button"+(await closeRiskButton.textContent) + " " + closeRiskButton.count);
await t.expect(closeRiskButton.exists).ok();
// need to access the second element for closing.
await t.click(closeRiskButton.nth(1)).expect(websiteText).notContains("Kontaktverhalten der Bevölkerung");;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Locally, I can run this test without nth(1) here. It would be strange if the same button would behave differently depending on its orientation.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

in the html elements tree I can find buttons with the same attributes and only the seconds will close the panel. Of course if you habe a better way to locate it, I will prefer it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I changed the Selectors a little bit (and moved them to a common place). It seems to work also without nth(1).
#349

testcafe/searchField.test.ts Outdated Show resolved Hide resolved
testcafe/searchField.test.ts Outdated Show resolved Hide resolved
testcafe/testcafe.config.ts Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Nov 1, 2020

Bundle difference

Asset group Old size New size Diff
all 12.14 MB 12.14 MB 0 B (0.00%)
documents 7.15 KB 7.15 KB 0 B (0.00%)
scripts 2.4 MB 2.4 MB 0 B (0.00%)
stylesheets 181.71 KB 181.71 KB 0 B (0.00%)
images 802.2 KB 802.2 KB 0 B (0.00%)
misc 1016.32 KB 1016.32 KB 0 B (0.00%)

@github-actions
Copy link

github-actions bot commented Nov 1, 2020

Bundle difference

Asset group Old size New size Diff
all 12.15 MB 12.15 MB 0 B (0.00%)
documents 7.15 KB 7.15 KB 0 B (0.00%)
scripts 2.4 MB 2.4 MB 0 B (0.00%)
stylesheets 181.71 KB 181.71 KB 0 B (0.00%)
images 802.2 KB 802.2 KB 0 B (0.00%)
misc 1016.32 KB 1016.32 KB 0 B (0.00%)

@github-actions
Copy link

github-actions bot commented Nov 1, 2020

Bundle difference

Asset group Old size New size Diff
all 12.15 MB 12.15 MB -671 B (-0.01%)
documents 7.15 KB 7.15 KB 0 B (0.00%)
scripts 2.4 MB 2.4 MB -254 B (-0.01%)
stylesheets 181.71 KB 181.71 KB 0 B (0.00%)
images 802.2 KB 802.2 KB 0 B (0.00%)
misc 1016.32 KB 1016.32 KB 0 B (0.00%)

@github-actions
Copy link

github-actions bot commented Nov 1, 2020

Bundle difference

Asset group Old size New size Diff
all 12.15 MB 12.15 MB -3.98 KB (-0.03%)
documents 9.17 KB 7.15 KB -2.02 KB (-22.00%)
scripts 2.4 MB 2.4 MB -677 B (-0.03%)
stylesheets 181.71 KB 181.71 KB 0 B (0.00%)
images 802.2 KB 802.2 KB 0 B (0.00%)
misc 1016.32 KB 1016.32 KB 0 B (0.00%)

@github-actions
Copy link

github-actions bot commented Nov 1, 2020

Bundle difference

Asset group Old size New size Diff
all 12.15 MB 12.15 MB -3.98 KB (-0.03%)
documents 9.17 KB 7.15 KB -2.02 KB (-22.00%)
scripts 2.4 MB 2.4 MB -677 B (-0.03%)
stylesheets 181.71 KB 181.71 KB 0 B (0.00%)
images 802.2 KB 802.2 KB 0 B (0.00%)
misc 1016.32 KB 1016.32 KB 0 B (0.00%)

1 similar comment
@github-actions
Copy link

github-actions bot commented Nov 1, 2020

Bundle difference

Asset group Old size New size Diff
all 12.15 MB 12.15 MB -3.98 KB (-0.03%)
documents 9.17 KB 7.15 KB -2.02 KB (-22.00%)
scripts 2.4 MB 2.4 MB -677 B (-0.03%)
stylesheets 181.71 KB 181.71 KB 0 B (0.00%)
images 802.2 KB 802.2 KB 0 B (0.00%)
misc 1016.32 KB 1016.32 KB 0 B (0.00%)

@github-actions
Copy link

github-actions bot commented Nov 2, 2020

Bundle difference

Asset group Old size New size Diff
all 12.15 MB 12.15 MB 0 B (0.00%)
documents 9.17 KB 9.17 KB 0 B (0.00%)
scripts 2.4 MB 2.4 MB 0 B (0.00%)
stylesheets 181.71 KB 181.71 KB 0 B (0.00%)
images 802.2 KB 802.2 KB 0 B (0.00%)
misc 1016.32 KB 1016.32 KB 0 B (0.00%)

@github-actions
Copy link

github-actions bot commented Nov 3, 2020

Bundle difference

Asset group Old size New size Diff
all 12.15 MB 12.15 MB -235 B (-0.00%)
documents 9.17 KB 9.17 KB 0 B (0.00%)
scripts 2.4 MB 2.4 MB -65 B (-0.00%)
stylesheets 181.71 KB 181.71 KB 0 B (0.00%)
images 802.2 KB 802.2 KB 0 B (0.00%)
misc 1016.32 KB 1016.32 KB 0 B (0.00%)

@ChristophWersal ChristophWersal merged commit ffc84fd into master Nov 3, 2020
@ChristophWersal ChristophWersal deleted the tests/enhance-e2e-test-coverage branch November 3, 2020 19:39
@github-actions
Copy link

github-actions bot commented Nov 3, 2020

🎉 This PR is included in version 1.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants