Skip to content

Commit

Permalink
chore: migrate all karma tests to playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
subzero10 committed Aug 26, 2023
1 parent c14661a commit 717755a
Show file tree
Hide file tree
Showing 5 changed files with 415 additions and 292 deletions.
13 changes: 13 additions & 0 deletions packages/js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,19 @@ However, since the package is isomorphic, TypeScript users will likely be writin
account and use `BROWSERSTACK_USERNAME=your_username BROWSERSTACK_ACCESS_KEY=your-access-key npm run test:integration`.
3. To test the TypeScript type definitions: `npm run tsd`.

#### End-to-end tests with Playwright
We use [Playwright](https://playwright.dev) to run integration tests in a real browser.
The config file is at the root of this package: `playwright.config.ts`.
To run these tests locally, you'll need to install the browsers you want to test with.
The easiest way to do this is to use the `npx playwright install --with-deps` command.
Then run `npm run test:integration:playwright`.

##### Architecture
Inside `./test/e2e`, you will find a `server.js` file that runs a simple nodejs http server.
This server is used to serve the test page, along with other static assets and to receive the error reports from the browser.
The test page is found in `./test/e2e/sandbox.html`.
All tests are found in `./test/e2e/integration.spec.ts`.

## Releasing

This package comes with a `postpublish` script (`scripts/release-cdn.sh`)
Expand Down
8 changes: 4 additions & 4 deletions packages/js/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ export default defineConfig({
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
{
name: 'Microsoft Edge',
use: { ...devices['Desktop Edge'], channel: 'msedge' },
},
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
Expand Down
Loading

0 comments on commit 717755a

Please sign in to comment.