test: move skipped tests to expectations (#11789)

This commit is contained in:
Alex Rudenko 2024-01-30 17:42:49 +01:00 committed by GitHub
parent b99d478cd4
commit 422b5a5b03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 67 additions and 69 deletions

View File

@ -689,18 +689,6 @@
"parameters": ["firefox"],
"expectations": ["SKIP"]
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should work with no default arguments",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome"],
"expectations": ["SKIP"]
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should work with no default arguments",
"platforms": ["linux"],
"parameters": ["webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should work with no default arguments",
"platforms": ["darwin", "linux", "win32"],
@ -1111,6 +1099,18 @@
"parameters": ["firefox"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots Cdp should work in \"fromSurface: false\" mode",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["headless"],
"expectations": ["SKIP"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots Cdp should work in \"fromSurface: false\" mode",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["new-headless"],
"expectations": ["SKIP"]
},
{
"testIdPattern": "[screenshot.spec] Screenshots Page.screenshot should get screenshot bigger than the viewport",
"platforms": ["darwin", "linux", "win32"],
@ -2245,6 +2245,18 @@
"parameters": ["cdp", "firefox"],
"expectations": ["FAIL", "PASS"]
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should work with no default arguments",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "headless"],
"expectations": ["SKIP"]
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch should work with no default arguments",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["chrome", "new-headless"],
"expectations": ["SKIP"]
},
{
"testIdPattern": "[launcher.spec] Launcher specs Puppeteer Puppeteer.launch tmp profile should be cleaned up",
"platforms": ["darwin", "linux", "win32"],

View File

@ -16,7 +16,7 @@ import type {Page} from 'puppeteer-core/internal/api/Page.js';
import {rmSync} from 'puppeteer-core/internal/node/util/fs.js';
import sinon from 'sinon';
import {getTestState, isHeadless, launch} from './mocha-utils.js';
import {getTestState, launch} from './mocha-utils.js';
import {dumpFrames, waitEvent} from './utils.js';
const TMP_FOLDER = path.join(os.tmpdir(), 'pptr_tmp_folder-');
@ -408,9 +408,7 @@ describe('Launcher specs', function () {
expect(puppeteer.product).toBe('firefox');
}
});
(!isHeadless ? it : it.skip)(
'should work with no default arguments',
async () => {
it('should work with no default arguments', async () => {
const {context, close} = await launch({
ignoreDefaultArgs: true,
});
@ -421,8 +419,7 @@ describe('Launcher specs', function () {
} finally {
await close();
}
}
);
});
it('should filter out ignored default arguments in Chrome', async () => {
const {defaultBrowserOptions, puppeteer} = await getTestState({
skipLaunch: true,
@ -590,9 +587,7 @@ describe('Launcher specs', function () {
});
expect(error.message).toContain('either pipe or debugging port');
});
(!isHeadless ? it : it.skip)(
'should launch Chrome properly with --no-startup-window and waitForInitialPage=false',
async () => {
it('should launch Chrome properly with --no-startup-window and waitForInitialPage=false', async () => {
const {defaultBrowserOptions} = await getTestState({
skipLaunch: true,
});
@ -613,8 +608,7 @@ describe('Launcher specs', function () {
} finally {
await close();
}
}
);
});
});
describe('Puppeteer.launch', function () {

View File

@ -8,12 +8,7 @@ import assert from 'assert';
import expect from 'expect';
import {
getTestState,
isHeadless,
launch,
setupTestBrowserHooks,
} from './mocha-utils.js';
import {getTestState, launch, setupTestBrowserHooks} from './mocha-utils.js';
describe('Screenshots', function () {
setupTestBrowserHooks();
@ -436,9 +431,7 @@ describe('Screenshots', function () {
});
expect(screenshot).toBeGolden('white.jpg');
});
(!isHeadless ? it : it.skip)(
'should work in "fromSurface: false" mode',
async () => {
it('should work in "fromSurface: false" mode', async () => {
const {page, server} = await getTestState();
await page.setViewport({width: 500, height: 500});
@ -446,8 +439,7 @@ describe('Screenshots', function () {
const screenshot = await page.screenshot({
fromSurface: false,
});
expect(screenshot).toBeDefined(); // toBeGolden('screenshot-fromsurface-false.png');
}
);
expect(screenshot).toBeDefined();
});
});
});