hashicorp / boundary-ui

Monorepo for Boundary UIs and addons.
http://boundary-ui.vercel.app
Other
87 stars 28 forks source link

feat: šŸŽø Setup initial desktop E2E tests #2416

Closed ZedLi closed 1 month ago

ZedLi commented 2 months ago

āœ… Closes: https://hashicorp.atlassian.net/browse/ICU-14061

Description

Sets up the initial end to end tests for desktop client. I didn't use a helper class but instead integrated them as fixtures in combination with page object models.

These fixtures get loaded as part of each test and automatically setup and tear down the things needed for the electron app to be tested as well as provide helpers for common actions.

Screenshots (if appropriate)

Forced Failure:

image image image

How to Test

Run npx playwright test --reporter=html to get an html report. Force an error by adding something like expect(1).toBe(2) to a test to see an example of a trace and screenshot that gets captured.

Note that the trace is a bit buggy though the html viewer (still works, just images/css not loaded correctly for the snapshots though screenshots look fine). You can see it rendered properly by taking the trace in tests/e2e/artifacts and passing it to npx playwright show-trace

Checklist

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ā†—ļøŽ

Name Status Preview Comments Updated (UTC)
boundary-ui āœ… Ready (Inspect) Visit Preview šŸ’¬ Add feedback Aug 2, 2024 4:24pm
boundary-ui-desktop āœ… Ready (Inspect) Visit Preview šŸ’¬ Add feedback Aug 2, 2024 4:24pm
calcaide commented 2 months ago

We can tweak or create new yarn scripts to run specific reporter as the one you suggest: npx playwright test --reporter=html totally happy to swap the e2e:dev script to use the html reporter

ZedLi commented 2 months ago

We can tweak or create new yarn scripts to run specific reporter as the one you suggest: npx playwright test --reporter=html totally happy to swap the e2e:dev script to use the html reporter

Yup good call, wasn't sure if we even wanted to make that default or a separate command since you could also just run it without the reporter as we were doing before