mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
test: support slow marker (#3018)
This commit is contained in:
parent
7d2078ef6f
commit
c45b5797fa
@ -290,7 +290,7 @@ describe('launchPersistentContext()', function() {
|
||||
await removeUserDataDir(userDataDir);
|
||||
await removeUserDataDir(userDataDir2);
|
||||
});
|
||||
it.slow().fail(CHROMIUM && (WIN || MAC))('should restore cookies from userDataDir', async({browserType, defaultBrowserOptions, server, launchPersistent}) => {
|
||||
it.fail(CHROMIUM && (WIN || MAC)).slow()('should restore cookies from userDataDir', async({browserType, defaultBrowserOptions, server, launchPersistent}) => {
|
||||
const userDataDir = await makeUserDataDir();
|
||||
const browserContext = await browserType.launchPersistentContext(userDataDir, defaultBrowserOptions);
|
||||
const page = await browserContext.newPage();
|
||||
|
@ -27,7 +27,7 @@ describe('Headful', function() {
|
||||
await browserContext.close();
|
||||
await removeUserDataDir(userDataDir);
|
||||
});
|
||||
it.slow().fail(WIN && CHROMIUM)('headless should be able to read cookies written by headful', async({browserType, defaultBrowserOptions, server}) => {
|
||||
it.fail(WIN && CHROMIUM).slow()('headless should be able to read cookies written by headful', async({browserType, defaultBrowserOptions, server}) => {
|
||||
// see https://github.com/microsoft/playwright/issues/717
|
||||
const userDataDir = await makeUserDataDir();
|
||||
// Write a cookie in headful chrome
|
||||
|
@ -64,14 +64,21 @@ class PlaywrightEnvironment extends NodeEnvironment {
|
||||
return super.runScript(script);
|
||||
}
|
||||
|
||||
async handleTestEvent(event, state) {
|
||||
if (event.name === 'setup') {
|
||||
const beforeEach = this.global.beforeEach;
|
||||
this.global.beforeEach = fn => {
|
||||
return beforeEach(async () => {
|
||||
patchToEnableFixtures(object, name) {
|
||||
const original = object[name];
|
||||
object[name] = fn => {
|
||||
return original(async () => {
|
||||
return await this.fixturePool.resolveParametersAndRun(fn);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
async handleTestEvent(event, state) {
|
||||
if (event.name === 'setup') {
|
||||
|
||||
this.patchToEnableFixtures(this.global, 'beforeEach');
|
||||
this.patchToEnableFixtures(this.global, 'afterEach');
|
||||
|
||||
const describeSkip = this.global.describe.skip;
|
||||
this.global.describe.skip = (...args) => {
|
||||
if (args.length = 1)
|
||||
@ -88,7 +95,11 @@ class PlaywrightEnvironment extends NodeEnvironment {
|
||||
return itSkip(...args);
|
||||
};
|
||||
this.global.it.fail = this.global.it.skip;
|
||||
this.global.it.slow = () => this.global.it;
|
||||
this.global.it.slow = () => {
|
||||
return (name, fn) => {
|
||||
return this.global.it(name, fn, 90000);
|
||||
}
|
||||
}
|
||||
|
||||
const testOptions = this.global.testOptions;
|
||||
function toBeGolden(received, goldenName) {
|
||||
|
@ -76,7 +76,7 @@ describe('Playwright', function() {
|
||||
const error = await browserType.launch(options).catch(e => e);
|
||||
expect(error.message).toContain('<launching>');
|
||||
});
|
||||
it.slow().skip(CHANNEL)('should accept objects as options', async({browserType, defaultBrowserOptions}) => {
|
||||
it.skip(CHANNEL).slow()('should accept objects as options', async({browserType, defaultBrowserOptions}) => {
|
||||
const browser = await browserType.launch({ ...defaultBrowserOptions, process });
|
||||
await browser.close();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user