add tests
This commit is contained in:
parent
f1af4c9466
commit
db3acf12f2
|
|
@ -432,7 +432,6 @@ class FrameSession {
|
||||||
this._firstNonInitialNavigationCommittedFulfill = f;
|
this._firstNonInitialNavigationCommittedFulfill = f;
|
||||||
this._firstNonInitialNavigationCommittedReject = r;
|
this._firstNonInitialNavigationCommittedReject = r;
|
||||||
});
|
});
|
||||||
// We do not always await this promise.
|
|
||||||
this._firstNonInitialNavigationCommittedPromise.catch(() => {});
|
this._firstNonInitialNavigationCommittedPromise.catch(() => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,3 +95,27 @@ test('install playwright-chromium should work', async ({ exec, installedSoftware
|
||||||
await exec('npx playwright install chromium');
|
await exec('npx playwright install chromium');
|
||||||
await exec('node sanity.js playwright-chromium chromium');
|
await exec('node sanity.js playwright-chromium chromium');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('should print error if recording video without ffmpeg', async ({ exec }) => {
|
||||||
|
await exec('npm i playwright');
|
||||||
|
|
||||||
|
await test.step('BrowserType.launch', async () => {
|
||||||
|
const result = await exec('node', '-e', `"
|
||||||
|
import playwright from 'playwright';
|
||||||
|
const browser = await playwright.chromium.launch({ channel: 'chrome' });
|
||||||
|
const context = await browser.newContext({ recordVideo: { dir: 'videos' } });
|
||||||
|
const page = await context.newPage();
|
||||||
|
"`, { expectToExitWithError: true });
|
||||||
|
expect(result).toContain(`browserContext.newPage: Executable doesn't exist at`);
|
||||||
|
});
|
||||||
|
|
||||||
|
await test.step('BrowserType.launchPersistentContext', async () => {
|
||||||
|
const result = await exec('node', '-e', `"
|
||||||
|
import playwright from 'playwright';
|
||||||
|
process.on('unhandledRejection', (e) => console.error('unhandledRejection', e));
|
||||||
|
const context = await playwright.chromium.launchPersistentContext('', { channel: 'chrome', recordVideo: { dir: 'videos' } });
|
||||||
|
"`, { expectToExitWithError: true });
|
||||||
|
expect(result).not.toContain('unhandledRejection');
|
||||||
|
expect(result).toContain(`browserType.launchPersistentContext: Executable doesn't exist at`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue