mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-05-17 04:49:39 +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 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
|
||||
|
||||
@@ -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",
|
||||
|
||||
+25
-18
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user