mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: rename tests (#11699)
This commit is contained in:
parent
5b9923c925
commit
da2dfc717c
@ -755,18 +755,6 @@
|
||||
"parameters": ["webDriverBiDi"],
|
||||
"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",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
@ -2629,12 +2617,6 @@
|
||||
"parameters": ["firefox", "webDriverBiDi"],
|
||||
"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",
|
||||
"platforms": ["darwin", "linux", "win32"],
|
||||
|
@ -22,7 +22,7 @@ describe('Browser specs', function () {
|
||||
});
|
||||
|
||||
describe('Browser.userAgent', function () {
|
||||
it('should include WebKit', async () => {
|
||||
it('should include Browser engine', async () => {
|
||||
const {browser, isChrome} = await getTestState();
|
||||
|
||||
const userAgent = await browser.userAgent();
|
||||
|
@ -98,17 +98,16 @@ describe('network', function () {
|
||||
});
|
||||
|
||||
describe('Request.headers', function () {
|
||||
it('should define Chrome as user agent header', async () => {
|
||||
const {page, server} = await getTestState();
|
||||
it('should define Browser in user agent header', async () => {
|
||||
const {page, server, isChrome} = await getTestState();
|
||||
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 () => {
|
||||
const {page, server} = await getTestState();
|
||||
|
||||
const response = (await page.goto(server.EMPTY_PAGE))!;
|
||||
expect(response.request().headers()['user-agent']).toContain('Firefox');
|
||||
if (isChrome) {
|
||||
expect(userAgent).toContain('Chrome');
|
||||
} else {
|
||||
expect(userAgent).toContain('Firefox');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -110,7 +110,7 @@ describe('testIdMatchesExpectationPattern', () => {
|
||||
fullTitle() {
|
||||
return 'Page Page.setContent should work';
|
||||
},
|
||||
} satisfies Pick<Mocha.Test, 'title' | 'file' | 'fullTitle'> as Mocha.Test;
|
||||
};
|
||||
|
||||
for (const [pattern, expected] of expectations) {
|
||||
assert.equal(
|
||||
|
@ -272,7 +272,7 @@ export function getTestId(file: string, fullTitle?: string): string {
|
||||
}
|
||||
|
||||
export function testIdMatchesExpectationPattern(
|
||||
test: MochaTestResult | Mocha.Test,
|
||||
test: MochaTestResult | Pick<Mocha.Test, 'title' | 'file' | 'fullTitle'>,
|
||||
pattern: string
|
||||
): boolean {
|
||||
const patternRegExString = pattern
|
||||
|
Loading…
Reference in New Issue
Block a user