Skip to content

Commit

Permalink
fix(Launcher): use wait-for-process Firefox option (#6315)
Browse files Browse the repository at this point in the history
  • Loading branch information
mjzffr committed Aug 10, 2020
1 parent 996e82c commit 054d782
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
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

0 comments on commit 054d782

Please sign in to comment.