improve tests and setup test workflow

This commit is contained in:
Rene Haas
2022-08-17 11:18:50 +02:00
parent 4b1e85b1ff
commit e7178b3ce8
9 changed files with 74 additions and 40 deletions
@@ -5,7 +5,6 @@ playwrightRollup();
test.describe('DOMObserver', () => {
test('test', async ({ page }) => {
await page.click('#start');
await expectSuccess(page);
});
});
@@ -5,14 +5,12 @@ playwrightRollup();
test.describe('SizeObserver', () => {
test('with ResizeOserver', async ({ page }) => {
await page.click('#start');
await expectSuccess(page);
});
test('with ResizeOserver polyfill', async ({ page }) => {
await page.click('#roPolyfill');
await page.waitForTimeout(500);
await page.click('#start');
await expectSuccess(page);
});
});
@@ -5,23 +5,19 @@ playwrightRollup();
test.describe('TrinsicObserver', () => {
test('with IntersectionObserver', async ({ page }) => {
await page.click('#start');
await expectSuccess(page);
});
test('with ResizeObserver', async ({ page }) => {
await page.click('#ioPolyfill');
await page.waitForTimeout(500);
await page.click('#start');
await expectSuccess(page);
});
test('with ResizeObserver polyfill', async ({ page }) => {
await page.click('#ioPolyfill');
await page.waitForTimeout(500);
await page.click('#roPolyfill');
await page.waitForTimeout(500);
await page.click('#start');
await expectSuccess(page);
});
});
@@ -5,7 +5,6 @@ playwrightRollup();
test.describe('StructureSetup.nesting', () => {
test('nesting updates', async ({ page }) => {
await page.click('#start');
await expectSuccess(page);
});
});
@@ -830,7 +830,7 @@ const start = async () => {
setTestResult(true);
};
startBtn?.addEventListener('click', start);
startBtn!.addEventListener('click', start);
if (!useContentElement) {
envElms.forEach((elm) => {
@@ -4,22 +4,20 @@ import { test, Page } from '@playwright/test';
playwrightRollup();
test.describe('StructureSetup.update', () => {
[false].forEach(async (targetIsViewport) => {
[false].forEach((targetIsViewport) => {
const isOrIsNot = targetIsViewport ? 'is' : 'is not';
const setTargetIsVp = async (page: Page) => {
if (targetIsViewport) {
await page.click('#tvp');
await page.waitForTimeout(500);
}
};
test.describe(`target ${isOrIsNot} viewport`, () => {
[false, true].forEach(async (nativeScrollbarStyling) => {
[false, true].forEach((nativeScrollbarStyling) => {
const withText = nativeScrollbarStyling ? 'with' : 'without';
const nss = async (page: Page) => {
const nsh = async (page: Page) => {
if (!nativeScrollbarStyling) {
await page.click('#nss');
await page.waitForTimeout(500);
await page.click('#nsh');
}
};
@@ -28,17 +26,17 @@ test.describe('StructureSetup.update', () => {
test('default', async ({ page }) => {
await setTargetIsVp(page);
await nss(page);
await page.click('#start');
await nsh(page);
await expectSuccess(page);
});
test('with fully overlaid scrollbars', async ({ page }) => {
await setTargetIsVp(page);
await nss(page);
await nsh(page);
await page.click('#fo');
await page.waitForTimeout(500);
await page.click('#start');
await expectSuccess(page);
});
@@ -49,21 +47,20 @@ test.describe('StructureSetup.update', () => {
);
await setTargetIsVp(page);
await nss(page);
await nsh(page);
await page.click('#po');
await page.waitForTimeout(500);
await page.click('#start');
await expectSuccess(page);
});
test('without flexbox glue & css custom props', async ({ page }) => {
await setTargetIsVp(page);
await nss(page);
await nsh(page);
await page.click('#fbg');
await page.waitForTimeout(500);
await page.click('#ccp');
await page.waitForTimeout(500);
await page.click('#start');
await expectSuccess(page);
});
});