Changeset 65049
- Timestamp:
- 10/30/2026 04:21:43 PM (2 days ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
.github/workflows/end-to-end-tests.yml (modified) (1 diff)
-
.github/workflows/reusable-end-to-end-tests.yml (modified) (4 diffs)
-
tests/e2e/README.md (modified) (1 diff)
-
tests/e2e/playwright.config.js (modified) (2 diffs)
-
tests/e2e/specs/media-upload.test.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/end-to-end-tests.yml
r63782 r65049 83 83 matrix: 84 84 LOCAL_SCRIPT_DEBUG: [ true, false ] 85 # See the "Projects" section in tests/e2e/README.md. 86 test-group: [ 'parallel', 'serial' ] 85 87 # A matrix value is needed in the 'name' directive for proper grouping in the GitHub UI. 86 88 label: [ 'E2E Tests' ] 87 89 with: 88 90 LOCAL_SCRIPT_DEBUG: ${{ matrix.LOCAL_SCRIPT_DEBUG }} 91 test-group: ${{ matrix.test-group }} 89 92 90 93 slack-notifications: -
trunk/.github/workflows/reusable-end-to-end-tests.yml
r63898 r65049 33 33 type: 'boolean' 34 34 default: true 35 test-group: 36 description: 'The Playwright project to run. Runs the default projects when empty.' 37 required: false 38 type: 'string' 39 default: '' 35 40 36 41 env: … … 63 68 # - Ensures version-controlled files are not modified or deleted. 64 69 e2e-tests: 65 name: SCRIPT_DEBUG ${{ inputs.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }}70 name: ${{ inputs.test-group && format( '{0}, ', inputs.test-group ) || '' }}SCRIPT_DEBUG ${{ inputs.LOCAL_SCRIPT_DEBUG && 'enabled' || 'disabled' }} 66 71 runs-on: ubuntu-24.04 67 72 permissions: … … 148 153 149 154 - name: Run E2E tests 150 run: npm run test:e2e 155 run: | 156 if [ -n "${TEST_GROUP}" ]; then 157 npm run test:e2e -- --project="${TEST_GROUP}" 158 else 159 npm run test:e2e 160 fi 151 161 env: 162 TEST_GROUP: ${{ inputs.test-group }} 152 163 # Chromium is installed above and is the only browser the suite runs. Without this, 153 164 # `wp-scripts test-playwright` also downloads Firefox and WebKit on every run. … … 158 169 if: always() 159 170 with: 160 name: failures-artifacts${{ inputs. LOCAL_SCRIPT_DEBUG && '-SCRIPT_DEBUG' || '' }}-${{ github.run_id }}171 name: failures-artifacts${{ inputs.test-group && format( '-{0}', inputs.test-group ) || '' }}${{ inputs.LOCAL_SCRIPT_DEBUG && '-SCRIPT_DEBUG' || '' }}-${{ github.run_id }} 161 172 path: artifacts 162 173 if-no-files-found: ignore -
trunk/tests/e2e/README.md
r56926 r65049 41 41 42 42 43 ## Projects 44 45 The suite has three Playwright projects, defined in `playwright.config.js`: 46 47 * `all`: every spec, one at a time on one worker. `npm run test:e2e` runs this project. 48 * `parallel`: specs that can share the site with other tests. Spec files run at the same time on several workers, one for every two CPU cores. Tests inside one file still run in order. Run it with `npm run test:e2e -- --project=parallel`. 49 * `serial`: specs that break the site for other tests. They run one at a time on one worker. Run it with `npm run test:e2e -- --project=serial`. 50 51 CI runs `parallel` and `serial` in separate jobs. 52 53 New specs go in `parallel` by default. Add a spec to `SERIAL_SPECS` only if it makes the site unusable for other tests, or if it changes content or settings that other tests use, for example with `requestUtils.deleteAllPosts()`. 54 55 Before you open a pull request with a new spec, run its project a few times with `--shuffle`. Playwright then runs the spec files in a random order, so a spec that needs another spec to run first, or that breaks a spec that runs after it, fails: 56 57 ``` 58 npm run test:e2e -- --project=parallel --shuffle 59 ``` 60 61 Playwright prints the seed of each run, for example `shuffle seed 317753389`. To run the same order again, give the seed: `--shuffle 317753389`. 62 43 63 ## Documentation 44 64 -
trunk/tests/e2e/playwright.config.js
r56926 r65049 3 3 */ 4 4 import path from 'node:path'; 5 import { defineConfig } from '@playwright/test';5 import { defineConfig, devices } from '@playwright/test'; 6 6 7 7 /** … … 16 16 ); 17 17 18 const SERIAL_SPECS = [ 19 'install.test.js', 20 'maintenance-mode.test.js', 21 'fatal-error-handler.test.js', 22 'login-localize-script.test.js', 23 'gutenberg-plugin.test.js', 24 'plugins.test.js', 25 'themes.test.js', 26 // These delete all posts or media, including other workers' content. 27 'cache-control-headers-directives.test.js', 28 'dashboard.test.js', 29 'edit-posts.test.js', 30 'empty-trash-restore-trashed-posts.test.js', 31 'media-library-client-side-upload.test.js', 32 'media-modal-client-side-upload.test.js', 33 'media-new-client-side-upload.test.js', 34 ]; 35 18 36 const config = defineConfig( { 19 37 ...baseConfig, 20 38 globalSetup: require.resolve( './config/global-setup.js' ), 39 workers: '50%', 21 40 webServer: { 22 41 ...baseConfig.webServer, 23 42 command: 'npm run env:start', 24 43 }, 44 projects: [ 45 { 46 name: 'all', 47 fullyParallel: false, 48 workers: 1, 49 use: { ...devices[ 'Desktop Chrome' ] }, 50 }, 51 { 52 name: 'parallel', 53 default: false, 54 testIgnore: SERIAL_SPECS, 55 fullyParallel: false, 56 use: { ...devices[ 'Desktop Chrome' ] }, 57 }, 58 { 59 name: 'serial', 60 default: false, 61 testMatch: SERIAL_SPECS, 62 fullyParallel: false, 63 workers: 1, 64 use: { ...devices[ 'Desktop Chrome' ] }, 65 }, 66 ], 25 67 } ); 26 68 -
trunk/tests/e2e/specs/media-upload.test.js
r64658 r65049 10 10 11 11 test( 'Test dismissing failed upload works correctly', async ({ page, admin, requestUtils }) => { 12 // Log in before visiting admin page.13 await requestUtils.login();14 12 await admin.visitAdminPage( '/media-new.php' ); 15 13
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)