Closed
Description
The main goal I try to achieve is to run the e2e tests of an angular-cli generated app on multiple browsers which currently fails because as soon as I add a second browser I get Unexpected token import
errors when I run tests.
Please provide us with the following information:
- OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
Mac OS X El Capitan (10.11.4).
- Versions. Please run
ng --version
. If there's nothing outputted, please
run in a Terminal:
node --version
And paste the result here.
$ ng --version
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
angular-cli: 1.0.0-beta.5
node: 5.9.1
os: darwin x64
$ node --version
v5.9.1
- Repro steps. Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
- Create an app with angular-cli:
ng new testfoo
- Change protractor.conf.js like this to make tests run in multiple browsers:
diff --git a/config/protractor.conf.js b/config/protractor.conf.js
index 57f4f87..76b4df8 100644
--- a/config/protractor.conf.js
+++ b/config/protractor.conf.js
@@ -6,9 +6,10 @@ exports.config = {
specs: [
'../e2e/**/*.e2e.ts'
],
- capabilities: {
- 'browserName': 'chrome'
- },
+ multiCapabilities: [
+ { 'browserName': 'chrome' },
+ { 'browserName': 'firefox' }
+ ],
directConnect: true,
baseUrl: 'http://localhost:4200/',
framework: 'jasmine',
- The log given by the failure. Normally this include a stack trace and some more information.
$ ng serve &
$ ng e2e
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://ember-cli.com/user-guide/#watchman for more info.
> [email protected] pree2e /Users/u1235/tmp/angularclitest/testfoo
> webdriver-manager update
selenium standalone is up to date.
chromedriver is up to date.
> [email protected] e2e /Users/u1235/tmp/angularclitest/testfoo
> protractor "config/protractor.conf.js"
[14:02:58] I/launcher - Running 2 instances of WebDriver
[14:02:59] I/testLogger -
------------------------------------
[14:02:59] I/testLogger - [chrome #01] PID: 4694
[chrome #01] Specs: /Users/u1235/tmp/angularclitest/testfoo/e2e/app.e2e.ts
[chrome #01]
[chrome #01] [14:02:58] I/direct - Using ChromeDriver directly...
[chrome #01] [14:02:59] I/runnerCli - Unexpected token import
[14:02:59] I/testLogger -
[14:02:59] E/launcher - Runner process exited unexpectedly with error code: 1
[14:02:59] I/launcher - 1 instance(s) of WebDriver still running
[14:03:00] I/testLogger -
------------------------------------
[14:03:00] I/testLogger - [firefox #11] PID: 4695
[firefox #11] Specs: /Users/u1235/tmp/angularclitest/testfoo/e2e/app.e2e.ts
[firefox #11]
[firefox #11] [14:02:58] I/direct - Using FirefoxDriver directly...
[firefox #11] [14:03:00] I/runnerCli - Unexpected token import
[14:03:00] I/testLogger -
[14:03:00] E/launcher - Runner process exited unexpectedly with error code: 1
[14:03:00] I/launcher - 0 instance(s) of WebDriver still running
[14:03:00] I/launcher - chrome #01 failed with exit code: 1
[14:03:00] I/launcher - firefox #11 failed with exit code: 1
[14:03:00] I/launcher - overall: 2 process(es) failed to complete
[14:03:00] E/launcher - Process exited with error code 100
Some end-to-end tests failed, see above.
5. Mention any other details that might be useful.
Interestingly it works if multiCapabilities
is used with only one browser, no matter which.