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

chore: add playwright #1139

Merged
merged 8 commits into from
Oct 23, 2024
Merged

chore: add playwright #1139

merged 8 commits into from
Oct 23, 2024

Conversation

stephenkilbourn
Copy link
Contributor

@stephenkilbourn stephenkilbourn commented Aug 29, 2024

Related Ticket: #1024 #1197

Description of Changes

This adds Playwright tests of some key user flows. The tests are set to run on the github action. On failure, an html report along with traces containing screenshots and network calls will be attached to the action's step.

The tests will run only on release branches (branches starting with release).

Notes & Questions About Changes

Validation / Testing

tests can be run locally with yarn test:e2e and they can also be seen in the github action.

Copy link

netlify bot commented Aug 29, 2024

Deploy Preview for veda-ui ready!

Name Link
🔨 Latest commit e4da6a8
🔍 Latest deploy log https://app.netlify.com/sites/veda-ui/deploys/67164ae0b2a0730008a9e8c1
😎 Deploy Preview https://deploy-preview-1139--veda-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@stephenkilbourn
Copy link
Contributor Author

It looks like I don't have access to view/change github secrets. This is expecting a mapbox token stored as MAPBOX_TOKEN like in the veda-config.

@dzole0311 dzole0311 self-requested a review October 17, 2024 07:44
@dzole0311
Copy link
Collaborator

Thanks @stephenkilbourn for the great work and getting the tests green! I'm considering adjusting the github job to run on release branches only instead of each feature branch, to keep the fast development lifecycle. @sandrahoang686 @AliceR @hanbyul-here @snmln – any opinions before we merge these?

@sandrahoang686
Copy link
Collaborator

sandrahoang686 commented Oct 21, 2024

@stephenkilbourn thanks for setting this up, tests will be pretty crucial going forward and we could definitely spend more time here. Just a few thoughts -

  • Do we want routing tests here? For those tests, we'd probably want at the instance level?
    • Path would eventually change - was looking at this line await page.goto('/data-catalog'); for example this path would eventually come from instance
  • At the instance level we would orchestrate the e2e behavior of an entire route/page view, so would we want to move more towards integration testing?

cc @dzole0311 maybe you have already thought about this though

@stephenkilbourn
Copy link
Contributor Author

@sandrahoang686 @dzole0311

We do have existing tests at the instance level in veda-config and GHG. My intent was to move the common ones down to the UI level to remove duplication. We can then have tests against anything unique to that instance live in the config repos.

I can set up the routes to read from an env if you think that makes sense. I can set in the playwright config to read from the env and default to the route that is in the current UI.
something along the lines of

const catalogRoute = process.env.CATALOG_ROUTE ? process.env.CATALOG_ROUTE : 'data-catalog`
await page.goto(catalogRoute);

@dzole0311
Copy link
Collaborator

@sandrahoang686 Yes I think we can move away from routing in the tests as we break out the components. But for consistency with our current architecture, I propose we keep it for now.

Since this PR provides a solid base for more extensive Playwright tests in the veda-ui, I’ll go ahead and merge it so we can start playing with them and using them into our dev workflow, and make modifications as needed. Thanks @stephenkilbourn for setting these up!

We have a follow-up here: #1200

@dzole0311 dzole0311 merged commit c38b67d into main Oct 23, 2024
9 checks passed
@dzole0311 dzole0311 deleted the chore/add-playwright branch October 23, 2024 08:52
@hanbyul-here hanbyul-here mentioned this pull request Oct 29, 2024
snmln added a commit that referenced this pull request Oct 30, 2024
You can find VEDA Dashboard preview link to test these changes:
NASA-IMPACT/veda-config#470

## 🎉 Features
- Cookie consent component:
#1163,
#1165,
#1127,
#1177
- Stories Hub export in #1162
- Expose As Is - PageHeader, LinkElement Prop & Logo in
#1184
## 🚀 Improvements

- Add docs for registry dev in
#1169
- Timeline date selection centering functionality in
#1181
- Deprecate old explore page, Mapbox component
#1176
- Update doc with new diagrams about general architecture in
#1195
-  Add playwright in #1139
- Pre-select AOIs that have the "selected" prop set to true in
#1215
- 
## 🐛 Fixes
- Check dastaset analysis exclude attribute before running analysis in
#1175
- Restrict dynamic colormaps to applicable layer types in
#1183
- Fix external link badge display for tools hosted under the same domain
in #1192
- Escape special characters in regex expression when searching datasets
in #1204


### New Contributors
* @snmln made their first contribution in
#1127
* @AliceR made their first contribution in
#1204
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