Issue 1:
When trying to use evaluateAll or dispatchEvent in a specific web page, an TypeError: extraEngines is not iterable error is throw

Seems to be the same bug as #18641 that was closed due to lack of public reproduction. This can be reproduced in public (see below)

Its similar to #23192 in the same web page / app but unlike the other bug this occurs using the library also, not only the codegen

System info

Playwright Version: [v1.33]

Operating System: [Windows 10]

Browser: [Chromium]

Other info:

Source code

-[x] I provided exact source code that allows reproducing the issue locally.

import { chromium, Page } from 'playwright'

async function testSAWTypeError() {
const browser = await chromium.launch({ headless: false })
const context = await browser.newContext()
const result = await context.newPage()
await result.goto('https://saw.trixti.com.br/saw')
const s = await result.locator('a').evaluateAll((els) => {
return els.map((el) => el.textContent)
})
console.log(s)
await result.locator('input#submitForm').dispatchEvent('click')
}

Steps

Enter https://saw.trixti.com.br/saw

Try to call locator.dispatchEvent or locator.evaluateAll

Expected

Should not crash

Actual

It crashes

Issue 2:
System info

Playwright Version: v1.32

Operating System: Windows 10, Ubuntu 20

Browser: Chromium

Other info:

When using a "setup" in project dependencies and you run a test with --repeat-each the setup step is repeated as well.

I don't know if this is bug or "works as design" but it would be nice if the setup code only ran once. We can work around this my just running the setup one and then run the test with a project that do not have the setup as dependency, like this (see the playwright.config.ts below):

npx playwright test ./tests/setup.ts && npx playwright test ./tests/myTest.spec.ts --project local-chromium --repeat-each 25 --workers 1

But this is not optimal since the second playwright run will overwrite the report from the setup.

Source code

[*] I provided exact source code that allows reproducing the issue locally.

Config file

// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
projects: [
{
name: 'setup',
testMatch: /setup\.ts/,
},
{
name: 'chromium',
use: {
...devices['Desktop Chrome'],
},
dependencies: ['setup'],
},
{
name: 'local-chromium',
use: {
...devices['Desktop Chrome'],
},
},
});

Test file (self-contained)

// setup.ts
import { test as setup } from '@playwright/test';
setup('setup', async ({}) => {
// setup code that takes long time
});

// myTest.spec.ts
test('some fine test', async ({ page }) => {
// some excellent test code
});

Steps

Run the test: npx playwright test ./tests/myTest.spec.ts --repeat-each 3 --workers 1

Expected

✓ 1 [setup] › setup.ts:11:6 › setup (11.0s)
✓ 2 [chromium] › myTest.spec.ts › some fine test (740ms)
✓ 3 [chromium] › myTest.spec.ts › some fine test (647ms)
✓ 4 [chromium] › myTest.spec.ts› some fine test (656ms)

the setup code should only run once

Actual

✓ 1 [setup] › setup.ts:11:6 › setup (12.7s)
✓ 2 [setup] › setup.ts:11:6 › setup (10.1s)
✓ 3 [setup] › setup.ts:11:6 › setup (11.0s)
✓ 4 [chromium] › myTest.spec.ts › some fine test (740ms)
✓ 5 [chromium] › myTest.spec.ts › some fine test (647ms)
✓ 6 [chromium] › myTest.spec.ts› some fine test (656ms)

The set up is ran the "repeat-each" number of times