playwright error handling in ci

This commit is contained in:
Rene Haas
2022-08-19 11:27:24 +02:00
parent 19e4ace972
commit d5019590ff
3 changed files with 30 additions and 23 deletions
@@ -2,10 +2,10 @@ const { expect } = require('@playwright/test');
const startSelector = '#start';
const resultSelector = '#testResult';
const logError = async (page, msg) => {
const logError = async (page, ...args) => {
const title = await page.title();
// eslint-disable-next-line no-console
console.error(title, msg);
console.log(title, ...args);
};
// default timeout = // 10mins
+3 -3
View File
@@ -42,10 +42,10 @@
"sideEffects": ["*.css", "*.scss", "*.sass"],
"scripts": {
"build": "rollup -c",
"test": "jest --coverage && playwright test --grep-invert @special",
"jest": "jest --coverage --testPathPattern",
"test": "jest --coverage --runInBand && playwright test --grep-invert @special",
"jest": "jest --coverage --runInBand --testPathPattern",
"jest:node": "jest --selectProjects node --testPathPattern",
"jest:jsdom": "jest --selectProjects jsdom --testPathPattern",
"jest:jsdom": "jest --runInBand --selectProjects jsdom --testPathPattern",
"playwright": "playwright test --grep-invert @special",
"playwright:dev": "playwright test --workers 1 --timeout 0 --global-timeout 0",
"posttest": "playwright-merge-coverage && full-coverage",
@@ -817,30 +817,37 @@ const start = async () => {
target?.removeAttribute('style');
await overflowTest();
try {
await overflowTest();
osInstance.options({ paddingAbsolute: !initialPaddingAbsolute });
osInstance.options({ paddingAbsolute: !initialPaddingAbsolute });
await overflowTest();
await overflowTest();
osInstance.options({ paddingAbsolute: initialPaddingAbsolute });
osInstance.options({ paddingAbsolute: initialPaddingAbsolute });
await overflowTest({ overflow: { x: 'visible', y: 'visible' } });
await overflowTest({ overflow: { x: 'hidden', y: 'scroll' } });
await overflowTest({ overflow: { x: 'visible-hidden', y: 'scroll' } });
await overflowTest({ overflow: { x: 'visible-scroll', y: 'visible-hidden' } });
await overflowTest({ overflow: { x: 'visible', y: 'visible' } });
await overflowTest({ overflow: { x: 'hidden', y: 'scroll' } });
await overflowTest({ overflow: { x: 'visible-hidden', y: 'scroll' } });
await overflowTest({ overflow: { x: 'visible-scroll', y: 'visible-hidden' } });
if (!isFastTestRun) {
await overflowTest({ overflow: { x: 'hidden', y: 'visible' } });
await overflowTest({ overflow: { x: 'visible', y: 'scroll' } });
await overflowTest({ overflow: { x: 'visible-hidden', y: 'hidden' } });
await overflowTest({ overflow: { x: 'visible', y: 'visible-scroll' } });
await overflowTest({ overflow: { x: 'scroll', y: 'visible-scroll' } });
await overflowTest({ overflow: { x: 'scroll', y: 'hidden' } });
await overflowTest({ overflow: { x: 'scroll', y: 'visible' } });
await overflowTest({ overflow: { x: 'visible', y: 'hidden' } });
if (!isFastTestRun) {
await overflowTest({ overflow: { x: 'hidden', y: 'visible' } });
await overflowTest({ overflow: { x: 'visible', y: 'scroll' } });
await overflowTest({ overflow: { x: 'visible-hidden', y: 'hidden' } });
await overflowTest({ overflow: { x: 'visible', y: 'visible-scroll' } });
await overflowTest({ overflow: { x: 'scroll', y: 'visible-scroll' } });
await overflowTest({ overflow: { x: 'scroll', y: 'hidden' } });
await overflowTest({ overflow: { x: 'scroll', y: 'visible' } });
await overflowTest({ overflow: { x: 'visible', y: 'hidden' } });
}
} catch (e: any) {
console.error(e.message, {
expected: e.expected,
actual: e.actual,
operator: e.operator,
});
}
setTestResult(true);
};