You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
getLocationAbsUrl relies on a document query selector which does not work with Angular 2.
lib/clientsidescripts.js:
var el = document.querySelector(selector);
if (angular.getTestability) {
return angular.getTestability(el).
getLocation();
}
sample spec:
var url = 'http://localhost:3000/';
browser.get(url);
expect(browser.getCurrentUrl()).toBe(url);
expect(browser.getLocationAbsUrl()).toBe(url); // <-- does not work
error output:
1) test suite should navigate to the baes url
Message:
Failed: invalid element state: Failed to execute 'querySelector' on 'Document': The provided selector is empty.
(Session info: chrome=48.0.2564.116)
(Driver info: chromedriver=2.21.371459 (36d3d07f660ff2bc1bf28a75d1cdabed0983e7c4),platform=Mac OS X 10.11.3 x86_64) (WARNING: The server did not provide any stacktrace information)
The text was updated successfully, but these errors were encountered:
Historically, the only reason we have getLocationAbsUrl is kind of a workaround for IE. You should be able to use getCurrentUrl just fine in Angular2, and generally prefer that.
Ok about getLocationAbsUrl, but looks like he will get the same issue if he calls setLocation.
The error message says 'The provided selector is empty' because he is using useAllAngular2AppRoots() I suppose.
getLocationAbsUrl relies on a document query selector which does not work with Angular 2.
lib/clientsidescripts.js:
sample spec:
error output:
The text was updated successfully, but these errors were encountered: