chore: rename tests (#11699)

This commit is contained in:
Nikolay Vitkov 2024-01-18 11:26:35 +01:00 committed by GitHub
parent 5b9923c925
commit da2dfc717c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 11 additions and 30 deletions

View File

@ -755,18 +755,6 @@
"parameters": ["webDriverBiDi"], "parameters": ["webDriverBiDi"],
"expectations": ["FAIL", "PASS"] "expectations": ["FAIL", "PASS"]
}, },
{
"testIdPattern": "[network.spec] network Request.headers should define Chrome as user agent header",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox"],
"expectations": ["SKIP"]
},
{
"testIdPattern": "[network.spec] network Request.headers should define Firefox as user agent header",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome"],
"expectations": ["SKIP"]
},
{ {
"testIdPattern": "[network.spec] network Request.initiator should return the initiator", "testIdPattern": "[network.spec] network Request.initiator should return the initiator",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],
@ -2629,12 +2617,6 @@
"parameters": ["firefox", "webDriverBiDi"], "parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL", "PASS"] "expectations": ["FAIL", "PASS"]
}, },
{
"testIdPattern": "[network.spec] network Request.headers should define Firefox as user agent header",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["PASS"]
},
{ {
"testIdPattern": "[network.spec] network Request.initiator should return the initiator", "testIdPattern": "[network.spec] network Request.initiator should return the initiator",
"platforms": ["darwin", "linux", "win32"], "platforms": ["darwin", "linux", "win32"],

View File

@ -22,7 +22,7 @@ describe('Browser specs', function () {
}); });
describe('Browser.userAgent', function () { describe('Browser.userAgent', function () {
it('should include WebKit', async () => { it('should include Browser engine', async () => {
const {browser, isChrome} = await getTestState(); const {browser, isChrome} = await getTestState();
const userAgent = await browser.userAgent(); const userAgent = await browser.userAgent();

View File

@ -98,17 +98,16 @@ describe('network', function () {
}); });
describe('Request.headers', function () { describe('Request.headers', function () {
it('should define Chrome as user agent header', async () => { it('should define Browser in user agent header', async () => {
const {page, server} = await getTestState(); const {page, server, isChrome} = await getTestState();
const response = (await page.goto(server.EMPTY_PAGE))!; const response = (await page.goto(server.EMPTY_PAGE))!;
expect(response.request().headers()['user-agent']).toContain('Chrome'); const userAgent = response.request().headers()['user-agent'];
});
it('should define Firefox as user agent header', async () => { if (isChrome) {
const {page, server} = await getTestState(); expect(userAgent).toContain('Chrome');
} else {
const response = (await page.goto(server.EMPTY_PAGE))!; expect(userAgent).toContain('Firefox');
expect(response.request().headers()['user-agent']).toContain('Firefox'); }
}); });
}); });

View File

@ -110,7 +110,7 @@ describe('testIdMatchesExpectationPattern', () => {
fullTitle() { fullTitle() {
return 'Page Page.setContent should work'; return 'Page Page.setContent should work';
}, },
} satisfies Pick<Mocha.Test, 'title' | 'file' | 'fullTitle'> as Mocha.Test; };
for (const [pattern, expected] of expectations) { for (const [pattern, expected] of expectations) {
assert.equal( assert.equal(

View File

@ -272,7 +272,7 @@ export function getTestId(file: string, fullTitle?: string): string {
} }
export function testIdMatchesExpectationPattern( export function testIdMatchesExpectationPattern(
test: MochaTestResult | Mocha.Test, test: MochaTestResult | Pick<Mocha.Test, 'title' | 'file' | 'fullTitle'>,
pattern: string pattern: string
): boolean { ): boolean {
const patternRegExString = pattern const patternRegExString = pattern