chore: flaky tests fixes (#26714)

This commit is contained in:
Pavel Feldman 2023-08-25 12:43:50 -07:00 committed by GitHub
parent 0ecd561db2
commit 376f2850b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -77,7 +77,7 @@ export function dumpTestTree(page: Page, options: { time?: boolean } = {}): () =
const selected = listItem.classList.contains('selected') ? ' <=' : '';
const title = listItem.querySelector('.ui-mode-list-item-title').textContent;
const timeElement = options.time ? listItem.querySelector('.ui-mode-list-item-time') : undefined;
const time = timeElement ? ' ' + timeElement.textContent.replace(/\d+m?s/, 'XXms') : '';
const time = timeElement ? ' ' + timeElement.textContent.replace(/[.\d]+m?s/, 'XXms') : '';
result.push(' ' + ' '.repeat(indent) + treeIcon + ' ' + statusIcon + ' ' + title + time + watch + selected);
}
return '\n' + result.join('\n') + '\n ';

View file

@ -39,11 +39,11 @@ test('should show screenshots', async ({ runUITest }) => {
await expect(
page.locator('.CodeMirror .source-line-running'),
).toContainText(`test('test 1', async ({ page }) => {`);
await expect(page.locator('.film-strip-frame')).toBeVisible();
await expect(page.locator('.film-strip-frame').first()).toBeVisible();
await page.getByText('test 2', { exact: true }).click();
await expect(
page.locator('.CodeMirror .source-line-running'),
).toContainText(`test('test 2', async ({ page }) => {`);
await expect(page.locator('.film-strip-frame')).toBeVisible();
await expect(page.locator('.film-strip-frame').first()).toBeVisible();
});