diff --git a/.eslintrc.js b/.eslintrc.js index e4e195b8967..9b76ac6ae1a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -200,8 +200,14 @@ module.exports = { parserOptions: { project: 'tsconfig.json', }, - extends: ['plugin:playwright/jest-playwright'], - rules: {}, + extends: ['plugin:playwright/recommended'], + rules: { + 'playwright/expect-expect': 'off', + 'playwright/no-conditional-expect': 'off', + 'playwright/no-conditional-in-test': 'off', + 'playwright/no-wait-for-selector': 'off', + 'playwright/valid-title': 'off', + }, }, // rules which apply only to Markdown diff --git a/.github/workflows/assign_release_conductor.yml b/.github/workflows/assign_release_conductor.yml index baacf81c019..2163612d577 100644 --- a/.github/workflows/assign_release_conductor.yml +++ b/.github/workflows/assign_release_conductor.yml @@ -18,7 +18,6 @@ jobs: - uses: actions/setup-node@v4 with: node-version: 22 - - run: npm i -g npm@^10.5.1 - run: npm ci - uses: ./.github/actions/pagerduty id: pagerduty diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6784360787..ddcb6795761 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci - name: Check for unformatted files @@ -43,7 +42,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci - name: Lint JavaScript @@ -63,7 +61,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci - name: Build @@ -81,7 +78,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci - name: Build project @@ -99,7 +95,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci - name: Build @@ -118,7 +113,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci - name: Build storybook @@ -159,7 +153,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: install dependencies run: npm ci - name: download all reports @@ -196,7 +189,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci - name: Build storybook @@ -237,7 +229,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: install dependencies run: npm ci - name: download all reports @@ -270,7 +261,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci - name: Build storybook @@ -311,7 +301,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: install dependencies run: npm ci - name: download all reports @@ -348,7 +337,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci - name: Build storybook @@ -389,7 +377,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: install dependencies run: npm ci - name: download all reports @@ -419,7 +406,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci - name: Build components.json @@ -435,7 +421,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci - name: Build diff --git a/.github/workflows/codescan.yml b/.github/workflows/codescan.yml index 3ebb8186f6c..c859a6973ac 100644 --- a/.github/workflows/codescan.yml +++ b/.github/workflows/codescan.yml @@ -18,7 +18,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci diff --git a/.github/workflows/deploy_preview.yml b/.github/workflows/deploy_preview.yml index f8d7810bedd..92196d8130a 100644 --- a/.github/workflows/deploy_preview.yml +++ b/.github/workflows/deploy_preview.yml @@ -18,7 +18,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci - name: Build docs preview diff --git a/.github/workflows/deploy_preview_forks.yml b/.github/workflows/deploy_preview_forks.yml index ae3fa7f9845..98a033ec12b 100644 --- a/.github/workflows/deploy_preview_forks.yml +++ b/.github/workflows/deploy_preview_forks.yml @@ -19,7 +19,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci - name: Build docs preview diff --git a/.github/workflows/release-schedule.yml b/.github/workflows/release-schedule.yml index d032decd5ca..fd696dc17ee 100644 --- a/.github/workflows/release-schedule.yml +++ b/.github/workflows/release-schedule.yml @@ -31,7 +31,6 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 - - run: npm i -g npm@^10.5.1 - name: Install packages for github-script run: npm i date-fns - name: Create Release Issue diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 75650f7e244..f3444e52f60 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci diff --git a/.github/workflows/release_canary.yml b/.github/workflows/release_canary.yml index a33cca6c59b..3801452fe12 100644 --- a/.github/workflows/release_canary.yml +++ b/.github/workflows/release_canary.yml @@ -27,7 +27,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci - name: Build diff --git a/.github/workflows/release_candidate.yml b/.github/workflows/release_candidate.yml index 22c4ef1b47e..0a29d2b637d 100644 --- a/.github/workflows/release_candidate.yml +++ b/.github/workflows/release_candidate.yml @@ -23,7 +23,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci diff --git a/.github/workflows/vrt.yml b/.github/workflows/vrt.yml index 1cd02e91ebd..526e1ffba5e 100644 --- a/.github/workflows/vrt.yml +++ b/.github/workflows/vrt.yml @@ -39,7 +39,6 @@ jobs: with: node-version: 22 cache: 'npm' - - run: npm i -g npm@^10.5.1 - name: Install dependencies run: npm ci - name: Build storybook diff --git a/e2e/components/DataTable.test.ts b/e2e/components/DataTable.test.ts index b9fb4c3ecdf..9c96b048f41 100644 --- a/e2e/components/DataTable.test.ts +++ b/e2e/components/DataTable.test.ts @@ -175,12 +175,12 @@ test.describe('DataTable', () => { const region = page.getByRole('region') const table = region.getByRole('table') - const tabIndex = await region.getAttribute('tabindex') - const labelledby = await region.getAttribute('aria-labelledby') + const tabIndex = region + const labelledby = region await expect(region).toBeVisible() - expect(tabIndex).toBe('0') - expect(labelledby).toBe(headingId) + await expect(tabIndex).toHaveAttribute('tabindex', '0') + await expect(labelledby).toHaveAttribute('aria-labelledby', headingId!) await expect(table).toBeVisible() expect(labelledby).toBe(headingId) diff --git a/package-lock.json b/package-lock.json index 1eb9a8e7d56..e54147a6610 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,7 +32,7 @@ "eslint-plugin-jest": "28.8.3", "eslint-plugin-jsx-a11y": "6.7.1", "eslint-plugin-mdx": "3.1.5", - "eslint-plugin-playwright": "0.15.1", + "eslint-plugin-playwright": "^2.1.0", "eslint-plugin-prettier": "5.0.0", "eslint-plugin-primer-react": "5.4.0", "eslint-plugin-react": "7.32.2", @@ -13874,17 +13874,51 @@ } }, "node_modules/eslint-plugin-playwright": { - "version": "0.15.1", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-2.1.0.tgz", + "integrity": "sha512-wMbHOehofSB1cBdzz2CLaCYaKNLeTQ0YnOW+7AHa281TJqlpEJUBgTHbRUYOUxiXphfWwOyTPvgr6vvEmArbSA==", "dev": true, "license": "MIT", + "workspaces": [ + "examples" + ], + "dependencies": { + "globals": "^13.23.0" + }, + "engines": { + "node": ">=16.6.0" + }, "peerDependencies": { - "eslint": ">=7", - "eslint-plugin-jest": ">=25" + "eslint": ">=8.40.0" + } + }, + "node_modules/eslint-plugin-playwright/node_modules/globals": { + "version": "13.24.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz", + "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.20.2" }, - "peerDependenciesMeta": { - "eslint-plugin-jest": { - "optional": true - } + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint-plugin-playwright/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/eslint-plugin-prettier": { diff --git a/package.json b/package.json index e5e34f232e6..f4723bf4e63 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "eslint-plugin-jest": "28.8.3", "eslint-plugin-jsx-a11y": "6.7.1", "eslint-plugin-mdx": "3.1.5", - "eslint-plugin-playwright": "0.15.1", + "eslint-plugin-playwright": "^2.1.0", "eslint-plugin-prettier": "5.0.0", "eslint-plugin-primer-react": "5.4.0", "eslint-plugin-react": "7.32.2", @@ -94,5 +94,5 @@ "running": false } ], - "packageManager": "npm@10.9.1+sha512.c89530d37c4baa38afd43e76a077a84b9aa63840b986426584fd5c5a54ab0a0b21bb1595c851042b733784b0b43706d36a494b4d8ae1a086a762cb8d3f95942a" + "packageManager": "npm@10.9.2+sha512.8ab88f10f224a0c614cb717a7f7c30499014f77134120e9c1f0211ea3cf3397592cbe483feb38e0c4b3be1c54e347292c76a1b5edb94a3289d5448484ab8ac81" }