Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/library/trace-viewer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ test('should filter actions by text', async ({ showTraceViewer }) => {
const filterInput = traceViewer.page.getByRole('searchbox', { name: 'Filter actions' });
await expect(filterInput).toBeVisible();

await expect(traceViewer.actionTitles.filter({ hasText: 'Close page' })).toBeVisible();
const fullCount = await traceViewer.actionTitles.count();
await filterInput.fill('Click');
await expect(traceViewer.actionTitles.filter({ hasText: 'Click' }).first()).toBeVisible();
Expand Down
12 changes: 8 additions & 4 deletions tests/page/page-event-console.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,14 @@ it('do not update console count on unhandled rejections', async ({ page }) => {
it('should have timestamp', async ({ page, isAndroid }) => {
it.skip(isAndroid, 'there is a time difference between android emulator and host machine');

const before = Date.now() - 1; // Account for the rounding of fractional timestamps.
// Generous slack to absorb host wall-clock resolution (e.g. ~15.6ms on Windows)
// vs sub-millisecond browser timestamps.
const before = Date.now() - 100;
const [message] = await Promise.all([
page.waitForEvent('console'),
page.evaluate(() => console.log('timestamp test')),
]);
const after = Date.now() + 1; // Account for the rounding of fractional timestamps.
const after = Date.now() + 100;
expect(message.timestamp()).toBeGreaterThanOrEqual(before);
expect(message.timestamp()).toBeLessThanOrEqual(after);
});
Expand All @@ -255,9 +257,11 @@ it('should have increasing timestamps', async ({ page }) => {
it('should have timestamp in consoleMessages', async ({ page, isAndroid }) => {
it.skip(isAndroid, 'there is a time difference between android emulator and host machine');

const before = Date.now() - 1; // Account for the rounding of fractional timestamps.
// Generous slack to absorb host wall-clock resolution (e.g. ~15.6ms on Windows)
// vs sub-millisecond browser timestamps.
const before = Date.now() - 100;
await page.evaluate(() => console.log('stored message'));
const after = Date.now() + 1; // Account for the rounding of fractional timestamps.
const after = Date.now() + 100;
const messages = await page.consoleMessages();
expect(messages.length).toBeGreaterThanOrEqual(1);
const last = messages[messages.length - 1];
Expand Down
Loading