Skip to content

E2E | Run E2E tests against other browsers #385

Closed
@bryphe-coder

Description

@bryphe-coder

As a developer, I want our E2E tests to run on all supported browsers and platforms in order to give me confidence when I make changes. Today, our E2E tests are only run on Chrome - but we should ideally expand our E2E tests to run on multiple browsers - documentation here: https://playwright.dev/docs/intro#configuration-file

As a rationale for this, we found several issues in v1 that were specific to Safari on Mac:

We would need to update our playwright configuration file in site/e2e/playwright.config.ts to support different browsers.

This can be done by adding projects that specify browsers explicitly to run:

const config: PlaywrightTestConfig = {
  projects: [
    {
      name: 'chromium',
      use: { ...devices['Desktop Chrome'] },
    },
    {
      name: 'firefox',
      use: { ...devices['Desktop Firefox'] },
    },
    {
      name: 'webkit',
      use: { ...devices['Desktop Safari'] },
    },
  ],
};
export default config;

And then upgrading our scripts in site/package.json to run these, ie:

"playwright:test:chromium": "playwright test --config=e2e/playwright.config.ts --project=chromium",
"playwright:test:firefox": "playwright test --config=e2e/playwright.config.ts --project=firefox",
...

Lastly, we would need to update our e2e tests in .github/coder.yaml to add an additional browser matrix for our test/e2e job, so that we could run each of these browsers for each supported platform.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions