Skip to content
Open
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
9 changes: 3 additions & 6 deletions tests/library/browsertype-launch.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,15 @@ it('should throw if page argument is passed', async ({ browserType, browserName,
it('should reject if launched browser fails immediately', async ({ mode, browserType, asset, channel }) => {
const error = await browserType.launch({ executablePath: asset('dummy_bad_browser_executable.js') }).catch(e => e);
if (channel === 'webkit-wsl')
expect(error.message).toContain('Cannot specify executablePath when using the \"webkit-wsl\" channel.');
expect(error.message).toContain('Failed to launch');
else
expect(error.message).toMatch(/browserType\.launch(.|\n)*(spawn UNKNOWN|spawn EFTYPE|Browser logs:)/gim);
});

it('should reject if executable path is invalid', async ({ browserType, mode, channel }) => {
it('should reject if executable path is invalid', async ({ browserType, mode }) => {
let waitError: Error | undefined;
await browserType.launch({ executablePath: 'random-invalid-path' }).catch(e => waitError = e);
if (channel === 'webkit-wsl')
expect(waitError!.message).toContain('Cannot specify executablePath when using the \"webkit-wsl\" channel.');
else
expect(waitError!.message).toContain('Failed to launch');
expect(waitError!.message).toContain('Failed to launch');
});

it('should handle timeout', async ({ browserType, mode }) => {
Expand Down
Loading