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: upgrade playwright #18793

Merged
merged 7 commits into from
Nov 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/storybook-chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
container:
image: mcr.microsoft.com/playwright:v1.29.2 # Same as @storybook/test-runner@0.13's dependency
image: mcr.microsoft.com/playwright:v1.32.2 # Same as @storybook/test-runner@0.15.2's dependency
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I only bumped to 1.32.2 based on what the @storybook/test-runner had in the latest version (v0.15.2)

strategy:
fail-fast: false
matrix:
Expand Down
2 changes: 1 addition & 1 deletion .storybook/test-runner.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { toMatchImageSnapshot } from 'jest-image-snapshot'
import { getStoryContext, TestRunnerConfig, TestContext } from '@storybook/test-runner'
import type { Locator, Page, LocatorScreenshotOptions } from 'playwright-core'
import type { Locator, Page, LocatorScreenshotOptions } from '@playwright/test'
import type { Mocks } from '~/mocks/utils'
import { StoryContext } from '@storybook/types'

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.playwright
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
# We do this to ensure our reference images for visual regression tests are the same during development and in CI.
#

FROM mcr.microsoft.com/playwright:v1.29.2
FROM mcr.microsoft.com/playwright:v1.32.2

WORKDIR /work

RUN npm install -g pnpm

Check warning on line 10 in Dockerfile.playwright

View workflow job for this annotation

GitHub Actions / Lint changed Dockerfiles

Pin versions in npm. Instead of `npm install <package>` use `npm install <package>@<version>`

COPY package.json pnpm-lock.yaml ./

Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"engines": {
"node": ">=18 <19"
},
"packageManager": "pnpm@8.6.0",
"packageManager": "pnpm@8.10.5",
"scripts": {
"copy-scripts": "mkdir -p frontend/dist/ && ./bin/copy-posthog-js",
"test": "pnpm test:unit && pnpm test:visual-regression",
Expand Down Expand Up @@ -182,7 +182,7 @@
"@babel/preset-typescript": "^7.22.5",
"@babel/runtime": "^7.22.10",
"@cypress/webpack-preprocessor": "^5.17.1",
"@playwright/test": "1.29.2",
"@playwright/test": "1.32.2",
"@sentry/types": "7.22.0",
"@storybook/addon-a11y": "^7.5.1",
"@storybook/addon-actions": "^7.5.1",
Expand Down Expand Up @@ -271,7 +271,6 @@
"msw": "^0.49.0",
"path-browserify": "^1.0.1",
"pixelmatch": "^5.3.0",
"playwright-core": "1.29.2",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wasn't sure if this was needed but tried removing it and nothing broke. Basing things off this release note it suggested relying on @playwright/test for types

"pngjs": "^6.0.0",
"postcss": "^8.4.31",
"postcss-loader": "^4.3.0",
Expand Down
9 changes: 3 additions & 6 deletions playwright.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { PlaywrightTestConfig } from '@playwright/test'
import { devices } from '@playwright/test'
import { defineConfig, devices } from '@playwright/test'

/**
* Read environment variables from file.
Expand All @@ -10,7 +9,7 @@ import { devices } from '@playwright/test'
/**
* See https://playwright.dev/docs/test-configuration.
*/
const config: PlaywrightTestConfig = {
export default defineConfig({
testDir: './playwright',
/* Maximum time one test can run for. */
timeout: 30 * 1000,
Expand Down Expand Up @@ -102,6 +101,4 @@ const config: PlaywrightTestConfig = {
// command: 'npm run start',
// port: 3000,
// },
}

export default config
})
Loading
Loading