Skip to content

Conversation

@elisherer
Copy link
Contributor

Allow development under Windows platform:

Problems resolved

  • Setting environment variables using cross-env since Windows requires the SET command.
  • Calling Jasmine in the script debug-unit using jasmine's JavaScript binary instead of shell.
  • Add /test/test-user-data-dir* to .gitignore since temporary user data directories, in case of test fails, remains in the test directory.

Problems which didn't resolve

  • Two unit tests of using a custom user data directory hangs when trying to close the browser. Currently patched by crossing those when in Windows platform.
    Output:
Failures:
1) Puppeteer Puppeteer.launch userDataDir option
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at ontimeout (timers.js:469:11)
        at tryOnTimeout (timers.js:304:5)
        at Timer.listOnTimeout (timers.js:264:5)

2) Puppeteer Puppeteer.launch userDataDir argument
  Message:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
  Stack:
    Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
        at ontimeout (timers.js:469:11)
        at tryOnTimeout (timers.js:304:5)
        at Timer.listOnTimeout (timers.js:264:5)

},
"scripts": {
"unit": "jasmine test/test.js",
"debug-unit": "DEBUG_TEST=true node --inspect-brk ./node_modules/.bin/jasmine test/test.js",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

out of curiosity, why changing .bin/jasmine to jasmine/bin/jasmine.js?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had an exception:

basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^
SyntaxError: missing ) after argument list

This is where I found the solution https://github.com/gotwarlost/istanbul#usage-on-windows

expect(error.message).toContain('Protocol error');
}));
it('userDataDir option', SX(async function() {
// Windows has issues running Chromium using a custom user data dir. It hangs when closing the browser.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be the #918

Could you please refer to the issue in the comment so that we keep track of it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

rm(userDataDir);
}));
it('userDataDir argument', SX(async function() {
(windows ? xit : it)('userDataDir argument', SX(async function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's refer to #918 here as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@aslushnikov aslushnikov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, these are good changes. I wonder though why @JoelEinbinder didn't experience any of these during his time on Windows machine.

Copy link
Contributor

@JoelEinbinder JoelEinbinder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I hit these problems but was just living with the pain.

@aslushnikov aslushnikov merged commit 9ecf20f into puppeteer:master Oct 11, 2017
@elisherer elisherer deleted the feature/windows-dev-support branch October 15, 2017 10:21
ithinkihaveacat pushed a commit to ithinkihaveacat/puppeteer that referenced this pull request Oct 31, 2017
This patch improves life of puppeteer contributor on Windows:

- Setting environment variables using cross-env since Windows requires the SET command.
- Calling Jasmine in the script debug-unit using jasmine's JavaScript binary instead of shell.
- Add /test/test-user-data-dir* to .gitignore since temporary user data directories, in case of test 
  fails, remains in the test directory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants