Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(FirefoxLauncher): use wait-for-process option on Windows #6315

Merged
merged 1 commit into from Aug 10, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/node/Launcher.ts
Expand Up @@ -467,6 +467,9 @@ class FirefoxLauncher implements ProductLauncher {

defaultArgs(options: ChromeArgOptions = {}): string[] {
const firefoxArguments = ['--no-remote', '--foreground'];
if (os.platform().startsWith('win')) {
firefoxArguments.push('--wait-for-browser');
}
const {
devtools = false,
headless = !devtools,
Expand Down
8 changes: 5 additions & 3 deletions test/launcher.spec.ts
Expand Up @@ -34,9 +34,10 @@ const mkdtempAsync = promisify(fs.mkdtemp);
const readFileAsync = promisify(fs.readFile);
const statAsync = promisify(fs.stat);
const TMP_FOLDER = path.join(os.tmpdir(), 'pptr_tmp_folder-');
const FIREFOX_TIMEOUT = 30 * 1000;

describe('Launcher specs', function () {
if (getTestState().isFirefox) this.timeout(30 * 1000);
if (getTestState().isFirefox) this.timeout(FIREFOX_TIMEOUT);

describe('Puppeteer', function () {
describe('BrowserFetcher', function () {
Expand Down Expand Up @@ -477,9 +478,10 @@ describe('Launcher specs', function () {
* properly with help from the Mozilla folks.
*/
itFailsWindowsUntilDate(
new Date('2020-07-30'),
new Date('2020-08-30'),
'should be able to launch Firefox',
async () => {
async function () {
this.timeout(FIREFOX_TIMEOUT);
const { puppeteer } = getTestState();
const browser = await puppeteer.launch({ product: 'firefox' });
const userAgent = await browser.userAgent();
Expand Down