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

DM-45409 Add tests for CM web app #95

Merged
merged 31 commits into from
Sep 12, 2024
Merged

DM-45409 Add tests for CM web app #95

merged 31 commits into from
Sep 12, 2024

Conversation

emanehab99
Copy link
Collaborator

This PR introduces API and E2E tests for the web app.
E2E tests are done using playwright which runs the tests using an actual browser
The changes also introduces a new custom command line argument --run-playwright to pytest. If not present, pytest skips any tests marked as playwright
Playwright tests assumes there is a running web server with specific data (which was added from a snapshot of a real database".
I opted to using this data as it allows for the different states and corresponding UI changes to show up and hence be tested.

@emanehab99 emanehab99 self-assigned this Aug 26, 2024
expect(page.get_by_text("group0", exact=True)).not_to_be_empty()
# check group fullname is correct
expect(page.get_by_text("HSC_DRP-RC2/w_2024_30_DM-45425c/step1/group0")).not_to_be_empty()
# check collections section
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is soooo intensly nitpicking. The code is great. The comments are good and generally clear.

You MIGHT want to adopt a recognised comment convention for test comments. There are a bunch all with pros and cons.

I tend to go for "Thing should do foo".

The only advantage over "check foo" is that "check foo" doesn't tell us what you think should happen. Only what you are testing.

Example:
Instead of

# check group name is correct
# check group fullname is correct

do
# Group0 should be visible on the page
# Group fullname should include the campaign name, run name, step number , and group number as a complete url.

Don't change this right now. Just something to think about in the future.

Copy link
Collaborator Author

@emanehab99 emanehab99 Sep 2, 2024

Choose a reason for hiding this comment

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

Good to know. I'll adopt it whenever I make changes to the tests. Thanks Asher

@eacharles eacharles force-pushed the tickets/DM-45409 branch 2 times, most recently from ac0473a to 0f2fdfe Compare September 6, 2024 18:53
@emanehab99 emanehab99 merged commit 310dd4a into main Sep 12, 2024
9 checks passed
@emanehab99 emanehab99 deleted the tickets/DM-45409 branch September 12, 2024 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants