mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-17 23:00:37 +03:00
playwright error handling in ci
This commit is contained in:
@@ -2,10 +2,10 @@ const { expect } = require('@playwright/test');
|
|||||||
|
|
||||||
const startSelector = '#start';
|
const startSelector = '#start';
|
||||||
const resultSelector = '#testResult';
|
const resultSelector = '#testResult';
|
||||||
const logError = async (page, msg) => {
|
const logError = async (page, ...args) => {
|
||||||
const title = await page.title();
|
const title = await page.title();
|
||||||
// eslint-disable-next-line no-console
|
// eslint-disable-next-line no-console
|
||||||
console.error(title, msg);
|
console.log(title, ...args);
|
||||||
};
|
};
|
||||||
|
|
||||||
// default timeout = // 10mins
|
// default timeout = // 10mins
|
||||||
|
|||||||
@@ -42,10 +42,10 @@
|
|||||||
"sideEffects": ["*.css", "*.scss", "*.sass"],
|
"sideEffects": ["*.css", "*.scss", "*.sass"],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "rollup -c",
|
"build": "rollup -c",
|
||||||
"test": "jest --coverage && playwright test --grep-invert @special",
|
"test": "jest --coverage --runInBand && playwright test --grep-invert @special",
|
||||||
"jest": "jest --coverage --testPathPattern",
|
"jest": "jest --coverage --runInBand --testPathPattern",
|
||||||
"jest:node": "jest --selectProjects node --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": "playwright test --grep-invert @special",
|
||||||
"playwright:dev": "playwright test --workers 1 --timeout 0 --global-timeout 0",
|
"playwright:dev": "playwright test --workers 1 --timeout 0 --global-timeout 0",
|
||||||
"posttest": "playwright-merge-coverage && full-coverage",
|
"posttest": "playwright-merge-coverage && full-coverage",
|
||||||
|
|||||||
+25
-18
@@ -817,30 +817,37 @@ const start = async () => {
|
|||||||
|
|
||||||
target?.removeAttribute('style');
|
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: 'visible', y: 'visible' } });
|
||||||
await overflowTest({ overflow: { x: 'hidden', y: 'scroll' } });
|
await overflowTest({ overflow: { x: 'hidden', y: 'scroll' } });
|
||||||
await overflowTest({ overflow: { x: 'visible-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-scroll', y: 'visible-hidden' } });
|
||||||
|
|
||||||
if (!isFastTestRun) {
|
if (!isFastTestRun) {
|
||||||
await overflowTest({ overflow: { x: 'hidden', y: 'visible' } });
|
await overflowTest({ overflow: { x: 'hidden', y: 'visible' } });
|
||||||
await overflowTest({ overflow: { x: 'visible', y: 'scroll' } });
|
await overflowTest({ overflow: { x: 'visible', y: 'scroll' } });
|
||||||
await overflowTest({ overflow: { x: 'visible-hidden', y: 'hidden' } });
|
await overflowTest({ overflow: { x: 'visible-hidden', y: 'hidden' } });
|
||||||
await overflowTest({ overflow: { x: 'visible', y: 'visible-scroll' } });
|
await overflowTest({ overflow: { x: 'visible', y: 'visible-scroll' } });
|
||||||
await overflowTest({ overflow: { x: 'scroll', y: 'visible-scroll' } });
|
await overflowTest({ overflow: { x: 'scroll', y: 'visible-scroll' } });
|
||||||
await overflowTest({ overflow: { x: 'scroll', y: 'hidden' } });
|
await overflowTest({ overflow: { x: 'scroll', y: 'hidden' } });
|
||||||
await overflowTest({ overflow: { x: 'scroll', y: 'visible' } });
|
await overflowTest({ overflow: { x: 'scroll', y: 'visible' } });
|
||||||
await overflowTest({ overflow: { x: 'visible', y: 'hidden' } });
|
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);
|
setTestResult(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user