fix(Launcher): use wait-for-process Firefox option (#6315)

This commit is contained in:
Maja Frydrychowicz 2020-08-10 04:23:17 -04:00 committed by GitHub
parent 996e82c7aa
commit 054d782c82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 3 deletions

View File

@ -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,

View File

@ -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 () {
@ -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();