Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

npm run protractor fail on step-6 #241

Closed
CREATE-AI opened this issue Mar 9, 2015 · 3 comments
Closed

npm run protractor fail on step-6 #241

CREATE-AI opened this issue Mar 9, 2015 · 3 comments

Comments

@CREATE-AI
Copy link

0 info it worked if it ends with ok
1 verbose cli [ 'D:\ng\nodejs\node.exe',
1 verbose cli 'D:\ng\nodejs\node_modules\npm\bin\npm-cli.js',
1 verbose cli 'run',
1 verbose cli 'protractor' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink D:\ng\nodejs\node.exe
5 verbose run-script [ 'preprotractor', 'protractor', 'postprotractor' ]
6 info preprotractor [email protected]
7 verbose unsafe-perm in lifecycle true
8 info protractor [email protected]
9 verbose unsafe-perm in lifecycle true
10 info [email protected] Failed to exec protractor script
11 error [email protected] protractor: protractor test/protractor-conf.js
11 error Exit status 1
12 error Failed at the [email protected] protractor script.
12 error This is most likely a problem with the angular-phonecat package,
12 error not with npm itself.
12 error Tell the author that this fails on your system:
12 error protractor test/protractor-conf.js
12 error You can get their info via:
12 error npm owner ls angular-phonecat
12 error There is likely additional logging output above.
13 error System Windows_NT 6.1.7601
14 error command "D:\ng\nodejs\node.exe" "D:\ng\nodejs\node_modules\npm\bin\npm-cli.js" "run" "protractor"
15 error cwd C:\Users\xxb03\angular-phonecat
16 error node -v v0.10.28
17 error npm -v 1.4.9
18 error code ELIFECYCLE
19 verbose exit [ 1, true ]

@dmitriz
Copy link
Contributor

dmitriz commented Apr 7, 2015

The e2e Test in Step 6 fails for two reasons:

Here is the amendment that makes the test pass:

it('should render phone specific links', function() {
  var query = element(by.model('query'));
  query.sendKeys('nexus');

  //element(by.css('.phones li a')).click();
  var nameLink = element(by.binding('phone.name'));
  expect(nameLink.getText()).toEqual("Nexus S");

  element(by.binding('phone.name')).click();

  var getUrl = browser.getLocationAbsUrl();

    expect(getUrl).toBe('/phones/nexus-s');

  // browser.getLocationAbsUrl().then(function(url) {
  //   expect(url.split('#')[1]).toBe('/phones/nexus-s');
  // });
});

myszy added a commit to myszy/angular.js that referenced this issue Jun 8, 2015
The e2e Test in Step 6 fails
getLocationAbsUrl() returns the relative path, not the absolute one

using:
"angular": "1.3.x",
"angular-mocks": "1.3.x",
"protractor": "2.1.0",

details here:
angular/angular-phonecat#241
@mcmoe
Copy link

mcmoe commented Jun 23, 2015

If you want to get the previous behavior of actually retrieving the full URL, browser.getCurrentUrl() worked for me.

browser.getCurrentUrl().then(function(url) {
   expect(url.split('#')[1]).toBe('/phones');
});

and

browser.getCurrentUrl().then(function(url) {
   expect(url.split('#')[1]).toBe('/phones/nexus-s');
});

@petebacondarwin
Copy link
Contributor

These have now been fixed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants