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
3 changes: 2 additions & 1 deletion tests/page/page-drag.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,10 @@ it.describe('Drag and drop', () => {
});
});

it('should respect the drop effect', async ({page, browserName, platform}) => {
it('should respect the drop effect', async ({page, browserName, platform, trace}) => {
it.fixme(browserName === 'webkit' && platform !== 'linux', 'WebKit doesn\'t handle the drop effect correctly outside of linux.');
it.fixme(browserName === 'firefox');
it.slow(!!trace);

expect(await testIfDropped('copy', 'copy')).toBe(true);
expect(await testIfDropped('copy', 'move')).toBe(false);
Expand Down
28 changes: 18 additions & 10 deletions tests/trace-viewer/trace-viewer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ test.beforeAll(async function recordTrace({ browser, browserName, browserType, s
}
await doClick();

const styleDone = page.waitForEvent('requestfinished', request => request.url().includes('style.css'));
await page.route(server.PREFIX + '/frames/script.js', async route => {
// Make sure script arrives after style for predictable results.
await styleDone;
await route.continue();
});

await Promise.all([
page.waitForNavigation(),
page.waitForTimeout(200).then(() => page.goto(server.PREFIX + '/frames/frame.html'))
Expand All @@ -149,15 +156,16 @@ test('should show empty trace viewer', async ({ showTraceViewer }, testInfo) =>
test('should open simple trace viewer', async ({ showTraceViewer }) => {
const traceViewer = await showTraceViewer(traceFile);
await expect(traceViewer.actionTitles).toHaveText([
/page.gotodata:text\/html,<html>Hello world<\/html>— \d+ms/,
/page.setContent— \d+ms/,
/page.evaluate— \d+ms/,
/page.click"Click"— \d+ms/,
/page.waitForNavigation— \d+ms/,
/page.waitForTimeout— \d+ms/,
/page.gotohttp:\/\/localhost:\d+\/frames\/frame.html— \d+ms/,
/page.setViewportSize— \d+ms/,
/page.hoverbody— \d+ms/,
/page.gotodata:text\/html,<html>Hello world<\/html>— [\d.ms]+/,
/page.setContent— [\d.ms]+/,
/page.evaluate— [\d.ms]+/,
/page.click"Click"— [\d.ms]+/,
/page.waitForEvent— [\d.ms]+/,
/page.waitForNavigation— [\d.ms]+/,
/page.waitForTimeout— [\d.ms]+/,
/page.gotohttp:\/\/localhost:\d+\/frames\/frame.html— [\d.ms]+/,
/page.setViewportSize— [\d.ms]+/,
/page.hoverbody— [\d.ms]+/,
]);
});

Expand Down Expand Up @@ -200,7 +208,7 @@ test('should show params and return value', async ({ showTraceViewer, browserNam
const traceViewer = await showTraceViewer(traceFile);
await traceViewer.selectAction('page.evaluate');
await expect(traceViewer.callLines).toHaveText([
/page.evaluate — \d+ms/,
/page.evaluate — [\d.ms]+/,
'expression: "({↵ a↵ }) => {↵ console.log(\'Info\');↵ console.warn(\'Warning\');↵ con…"',
'isFunction: true',
'arg: {"a":"paramA","b":4}',
Expand Down
7 changes: 3 additions & 4 deletions tests/video.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,9 @@ it.describe('screencast', () => {

const saveAsPath = testInfo.outputPath('my-video.webm');
const error = await popup.video().saveAs(saveAsPath).catch(e => e);
// WebKit pauses renderer before win.close() and actually writes something.
if (browserName === 'webkit')
expect(fs.existsSync(saveAsPath)).toBeTruthy();
else
// WebKit pauses renderer before win.close() and actually writes something,
// and other browsers are sometimes fast as well.
if (!fs.existsSync(saveAsPath))
expect(error.message).toContain('Page did not produce any video frames');
});

Expand Down