-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
Bundle difference
|
Notification: @DanielHabenicht, @ChristophWersal |
Bundle difference
|
Bundle difference
|
testcafe/searchField.test.ts
Outdated
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; |
There was a problem hiding this comment.
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)
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
testcafe/searchField.test.ts
Outdated
// 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");; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Bundle difference
|
Bundle difference
|
Bundle difference
|
Bundle difference
|
Bundle difference
|
1 similar comment
Bundle difference
|
Bundle difference
|
Bundle difference
|
🎉 This PR is included in version 1.7.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
No description provided.