onAccepted?.(item, index)}
role='listitem'
- className={'list-view-entry' + selectedSuffix + highlightedSuffix + errorSuffix + warningSuffix + infoSuffix}
+ className={clsx(
+ 'list-view-entry',
+ selectedItem === item && 'selected',
+ !notSelectable && highlightedItem === item && 'highlighted',
+ isError?.(item, index) && 'error',
+ isWarning?.(item, index) && 'warning',
+ isInfo?.(item, index) && 'info')}
onClick={() => onSelected?.(item, index)}
onMouseEnter={() => setHighlightedItem(item)}
onMouseLeave={() => setHighlightedItem(undefined)}
diff --git a/tests/library/global-fetch.spec.ts b/tests/library/global-fetch.spec.ts
index b3bea9e432..5de98fe9ee 100644
--- a/tests/library/global-fetch.spec.ts
+++ b/tests/library/global-fetch.spec.ts
@@ -21,7 +21,7 @@ import { expect, playwrightTest as base } from '../config/browserTest';
import { kTargetClosedErrorMessage } from 'tests/config/errors';
const it = base.extend({
- context: async () => {
+ context: async ({}, use) => {
throw new Error('global fetch tests should not use context');
}
});
diff --git a/tests/page/page-goto.spec.ts b/tests/page/page-goto.spec.ts
index 830a25e203..a613a7e036 100644
--- a/tests/page/page-goto.spec.ts
+++ b/tests/page/page-goto.spec.ts
@@ -179,7 +179,9 @@ it('should work with Cross-Origin-Opener-Policy after redirect', async ({ page,
expect(firstRequest.url()).toBe(server.PREFIX + '/redirect');
});
-it('should properly cancel Cross-Origin-Opener-Policy navigation', async ({ page, server }) => {
+it('should properly cancel Cross-Origin-Opener-Policy navigation', {
+ annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32107' },
+}, async ({ page, server }) => {
server.setRoute('/empty.html', (req, res) => {
res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
res.end();
diff --git a/tests/page/page-request-continue.spec.ts b/tests/page/page-request-continue.spec.ts
index dd7ed68b49..7487b3e35b 100644
--- a/tests/page/page-request-continue.spec.ts
+++ b/tests/page/page-request-continue.spec.ts
@@ -393,9 +393,12 @@ it('should continue preload link requests', async ({ page, server, browserName }
expect(color).toBe('rgb(255, 192, 203)');
});
-it('continue should propagate headers to redirects', async ({ page, server, browserName }) => {
- it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28758' });
- it.fixme(browserName === 'firefox');
+it('continue should propagate headers to redirects', {
+ annotation: [
+ { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/28758' },
+ { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32045' },
+ ]
+}, async ({ page, server }) => {
await server.setRedirect('/redirect', '/empty.html');
await page.route('**/redirect', route => {
void route.continue({
@@ -413,9 +416,11 @@ it('continue should propagate headers to redirects', async ({ page, server, brow
});
it('redirected requests should report overridden headers', {
- annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31351' }
-}, async ({ page, server, browserName }) => {
- it.fixme(browserName === 'firefox');
+ annotation: [
+ { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/31351' },
+ { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32045' },
+ ]
+}, async ({ page, server }) => {
await server.setRedirect('/redirect', '/empty.html');
await page.route('**/redirect', route => {
const headers = route.request().headers();
@@ -433,9 +438,12 @@ it('redirected requests should report overridden headers', {
expect((await response.request().allHeaders())['custom']).toBe('value');
});
-it('continue should delete headers on redirects', async ({ page, server, browserName }) => {
- it.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/13106' });
- it.fixme(browserName === 'firefox');
+it('continue should delete headers on redirects', {
+ annotation: [
+ { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/13106' },
+ { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32045' },
+ ]
+}, async ({ page, server }) => {
await page.goto(server.PREFIX + '/empty.html');
server.setRoute('/something', (request, response) => {
response.writeHead(200, { 'Access-Control-Allow-Origin': '*' });
diff --git a/tests/playwright-test/types.spec.ts b/tests/playwright-test/types.spec.ts
index da8d88a38b..c34c586f7a 100644
--- a/tests/playwright-test/types.spec.ts
+++ b/tests/playwright-test/types.spec.ts
@@ -19,7 +19,7 @@ import { test, expect } from './playwright-test-fixtures';
test('should check types of fixtures', async ({ runTSC }) => {
const result = await runTSC({
'helper.ts': `
- import { test as base, expect } from '@playwright/test';
+ import { test as base, expect, Page } from '@playwright/test';
export type MyOptions = { foo: string, bar: number };
export const test = base.extend<{ foo: string }, { bar: number }>({
foo: 'foo',
@@ -71,7 +71,7 @@ test('should check types of fixtures', async ({ runTSC }) => {
// @ts-expect-error
baz: true,
});
- const fail9 = test.extend<{ foo: string }>({
+ const fail9 = test.extend({
foo: [ async ({}, use) => {
await use('foo');
// @ts-expect-error
@@ -100,7 +100,21 @@ test('should check types of fixtures', async ({ runTSC }) => {
return y;
});
},
- })
+ });
+
+ const chain1 = base.extend({
+ page: async ({ page }, use) => {
+ await use(page);
+ },
+ });
+ const chain2 = chain1.extend<{ pageAsUser: Page }>({
+ pageAsUser: async ({ page }, use) => {
+ // @ts-expect-error
+ const x: number = page;
+ // @ts-expect-error
+ await use(x);
+ },
+ });
`,
'playwright.config.ts': `
import { MyOptions } from './helper';
diff --git a/utils/generate_types/overrides-test.d.ts b/utils/generate_types/overrides-test.d.ts
index 3a42d27f83..5c108d7b25 100644
--- a/utils/generate_types/overrides-test.d.ts
+++ b/utils/generate_types/overrides-test.d.ts
@@ -144,9 +144,9 @@ export type Fixtures
| [TestFixtureValue, { scope: 'test', timeout?: number | undefined, title?: string, box?: boolean }];
} & {
- [K in Exclude]?: [WorkerFixtureValue, { scope: 'worker', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
+ [K in keyof W]?: [WorkerFixtureValue, { scope: 'worker', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
} & {
- [K in Exclude]?: TestFixtureValue | [TestFixtureValue, { scope?: 'test', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
+ [K in keyof T]?: TestFixtureValue | [TestFixtureValue, { scope?: 'test', auto?: boolean, option?: boolean, timeout?: number | undefined, title?: string, box?: boolean }];
};
type BrowserName = 'chromium' | 'firefox' | 'webkit';