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

I cannot get e2e tests running, and ng e2e gives 0 feedback of errors. #906

Closed
NullVoxPopuli opened this issue May 24, 2016 · 8 comments
Closed
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix

Comments

@NullVoxPopuli
Copy link

NullVoxPopuli commented May 24, 2016

Please provide us with the following information:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 15.10
Release:    15.10
Codename:   wily
  1. Versions. Please run ng --version
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.2-mobile.3
node: 5.10.1
os: linux x64
  1. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.

Yes. and I have no idea why this isn't working. I even generated a new angular-cli project, and I just keep running in to problems. The blank angular-cli project had ng e2e run (failed, but it at least ran the tests).

I'm using:

  • angular master
  • angular-cli master
  • angular/protractor master

all via npm install

  1. The log given by the failure. Normally this include a stack trace and some
    more information.
 $ 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.

> app0.0.0 pree2e /path
> webdriver-manager update

Updating selenium standalone to version 2.53.0
downloading https://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.0.jar...
Updating chromedriver to version 2.21
downloading https://chromedriver.storage.googleapis.com/2.21/chromedriver_linux64.zip...
selenium-server-standalone-2.53.0.jar downloaded to /..../node_modules/protractor/selenium/selenium-server-standalone-2.53.0.jar
chromedriver_2.21linux64.zip downloaded to /..../node_modules/protractor/selenium/chromedriver_2.21linux64.zip

> [email protected] e2e /path
> protractor "config/protractor.conf.js"


Some end-to-end tests failed, see above.
$ protractor config/protractor.conf.js
module.js:341
    throw err;
    ^

Error: Cannot find module '../built/cli.js'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/..../node_modules/protractor/bin/protractor:5:1)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)

@NullVoxPopuli
Copy link
Author

correction, angular/angular won't install from master today. see: angular/angular#8815

my package.json lists:

    "@angular/common": "2.0.0-rc.1",
    "@angular/compiler": "2.0.0-rc.1",
    "@angular/core": "2.0.0-rc.1",
    "@angular/http": "2.0.0-rc.1",
    "@angular/platform-browser": "2.0.0-rc.1",
    "@angular/platform-browser-dynamic": "2.0.0-rc.1",
    "@angular/router": "2.0.0-rc.1",
    "angular-cli": "^1.0.0-beta.5",

@filipesilva
Copy link
Contributor

Heya @NullVoxPopuli, can you run npm run protractor -- config/protractor.conf.js and tell me the result?

@filipesilva filipesilva added type: bug/fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent labels May 25, 2016
@NullVoxPopuli
Copy link
Author

I didn't have protractor in my package.json, so I just ran this:

protractor config/protractor.conf.js

I got this error:

$ protractor config/protractor.conf.js
module.js:341
    throw err;
    ^

Error: Cannot find module '../built/cli.js'
    at Function.Module._resolveFilename (module.js:339:15)
    at Function.Module._load (module.js:290:25)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/home/webdev/ClientDevelopment/ATI/Portal.Librarian/node_modules/protractor/bin/protractor:5:1)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)

However, @etkirsch was able to 'fix' the repository, by just copying all our code into a new ng new project.

Here is the diff between the two commits:

-- a/package.json
+++ b/package.json
@@ -29,21 +29,20 @@
   },
   "devDependencies": {
     "angular-cli": "^1.0.0-beta.5",
-    "broccoli-funnel": "1.0.1",
     "broccoli-render-template": "0.0.3",
-    "clang-format": "^1.0.35",
+    "codelyzer": "0.0.19",
     "ember-cli-inject-live-reload": "^1.4.0",
-    "jade": "^1.11.0",
     "jasmine-core": "^2.4.1",
     "jasmine-spec-reporter": "^2.4.0",
     "karma": "^0.13.15",
     "karma-chrome-launcher": "^0.2.3",
     "karma-jasmine": "^0.3.8",
-    "node-sass": "3.5.3",
-    "protractor": "git+https://github.com/angular/protractor.git",
+    "protractor": "^3.3.0",
     "ts-node": "^0.5.5",
     "tslint": "^3.6.0",
     "typescript": "^1.8.10",
-    "typings": "^0.8.1"
+    "typings": "^0.8.1",
+    "jade": "^1.11.0",
+    "node-sass": "3.5.3"
   }
 }

deleted repoRoot/karma.conf.js
deleted repoRoot/kerma-test-shim.js

--- a/config/protractor.conf.js
+++ b/config/protractor.conf.js
@@ -9,6 +9,7 @@ exports.config = {
   capabilities: {
     browserName: 'chrome',
   },
+  chromeOnly: true,
   directConnect: true,
   baseUrl: 'http://localhost:4200/',
   framework: 'jasmine',
--- a/angular-cli.json
+++ b/angular-cli.json
@@ -1,6 +1,6 @@
 {
   "project": {
-    "version": "1.0.0-beta.2-mobile.3",
+    "version": "1.0.0-beta.5",
     "name": "Portal.Librarian"
   },

So, it could have just been a configuration / dependency version issue.

@etkirsch
Copy link

I think it was an issue with an earlier version of angular-cli. As @NullVoxPopuli mentioned, when we updated angular-cli to the most recent version and ran ng new, everything worked in the new app.

@filipesilva
Copy link
Contributor

Glad to hear it's up and running again. There's a lot of updated between versions at the moment and we're still lacking changelogs, but we're working on them.

@Blasz
Copy link

Blasz commented Jun 8, 2016

Part of this issue is that ng e2e shouldn't swallow errors, similar to ng lint. I'd say they'd probably be handled the same?

As a starting point, would it be possible to document how ng runs the npm scripts as well, i.e. what arguments they use, as they contain debugging info.

Something like:

ng e2e
Runs: npm run e2e -- config/protractor.conf.js

@ghost
Copy link

ghost commented Aug 31, 2016

@Blasz I think it would be a bad idea for a ng command to internally run a npm run command, since it could be overwritten by an end user, who then wonders why the ng x command is broken. Better call ./node_modules/x/bin/whatever --your-params etc...

clydin pushed a commit that referenced this issue Jun 5, 2018
PR #906 updated the app schematics to display the name of the app in the title,
so the e2e test has to be fixed.
The prefix is now useless (it was introduced by #720 to fix the e2e test when it was using prefix),
and has been removed.
hansl pushed a commit that referenced this issue Jun 6, 2018
PR #906 updated the app schematics to display the name of the app in the title,
so the e2e test has to be fixed.
The prefix is now useless (it was introduced by #720 to fix the e2e test when it was using prefix),
and has been removed.
hansl pushed a commit that referenced this issue Jun 6, 2018
PR #906 updated the app schematics to display the name of the app in the title,
so the e2e test has to be fixed.
The prefix is now useless (it was introduced by #720 to fix the e2e test when it was using prefix),
and has been removed.
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent type: bug/fix
Projects
None yet
Development

No branches or pull requests

4 participants