chore: fix failing test for the chrome headless (#8364)
This commit is contained in:
parent
bfead976f1
commit
ea47ff0766
@ -22,11 +22,13 @@ describe('Browser specs', function () {
|
|||||||
|
|
||||||
describe('Browser.version', function () {
|
describe('Browser.version', function () {
|
||||||
it('should return whether we are in headless', async () => {
|
it('should return whether we are in headless', async () => {
|
||||||
const { browser, isHeadless } = getTestState();
|
const { browser, isHeadless, headless } = getTestState();
|
||||||
|
|
||||||
const version = await browser.version();
|
const version = await browser.version();
|
||||||
expect(version.length).toBeGreaterThan(0);
|
expect(version.length).toBeGreaterThan(0);
|
||||||
expect(version.startsWith('Headless')).toBe(isHeadless);
|
expect(version.startsWith('Headless')).toBe(
|
||||||
|
isHeadless && headless !== 'chrome'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -137,6 +137,7 @@ interface PuppeteerTestState {
|
|||||||
isFirefox: boolean;
|
isFirefox: boolean;
|
||||||
isChrome: boolean;
|
isChrome: boolean;
|
||||||
isHeadless: boolean;
|
isHeadless: boolean;
|
||||||
|
headless: string;
|
||||||
puppeteerPath: string;
|
puppeteerPath: string;
|
||||||
}
|
}
|
||||||
const state: Partial<PuppeteerTestState> = {};
|
const state: Partial<PuppeteerTestState> = {};
|
||||||
@ -270,6 +271,7 @@ export const mochaHooks = {
|
|||||||
state.isFirefox = isFirefox;
|
state.isFirefox = isFirefox;
|
||||||
state.isChrome = isChrome;
|
state.isChrome = isChrome;
|
||||||
state.isHeadless = isHeadless;
|
state.isHeadless = isHeadless;
|
||||||
|
state.headless = headless;
|
||||||
state.puppeteerPath = path.resolve(path.join(__dirname, '..'));
|
state.puppeteerPath = path.resolve(path.join(__dirname, '..'));
|
||||||
},
|
},
|
||||||
coverageHooks.beforeAll,
|
coverageHooks.beforeAll,
|
||||||
|
Loading…
Reference in New Issue
Block a user