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"],
|
"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"],
|
||||||
|
@ -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();
|
||||||
|
@ -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');
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -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(
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user