-
Notifications
You must be signed in to change notification settings - Fork 2.3k
getcurrentUrl|() #87
Comments
The reason I want to save it to a variable is because the thing I need to test has test builds that change every so often. |
It's seeing the URL in the Try this: ptor.getCurrentUrl().
then(function(url) {
ptor.findElement(protractor.By.input('user')).sendKeys('user');
ptor.findElement(protractor.By.input('pass')).sendKeys('pass');
ptor.findElement(protractor.By.id('login')).click().
then(function(newUrl) {
expect(newUrl).toEqual(url + 'site.lol');
});
}); |
stickel's got it. At the risk of TMI - it would be valid to say |
So yeah it's working but the script is going so fast it's getting the url same as the first. Is there a way to make the script wait? while the page gets loaded? |
Ah, ptor.waitForAngular();
ptor.getCurrentUrl().then... That should fix it. I'll consider adding |
Made a separate bug to consolidate these issues - now duplicate of #92 |
it('should login to the backoffice', function () {
var url = ptor.getCurrentUrl();
ptor.findElement(protractor.By.input('username')).sendKeys('username');
ptor.findElement(protractor.By.input('password')).sendKeys('lol');
ptor.findElement(protractor.By.id('login')).click();
var url2 = ptor.getCurrentUrl();
expect(url2).toEqual(url + 'site.lol');
});
Expected 'https://link.com//' to equal '[object Object]site.lol'
Somehow it doesn't want to see url in the toEqual?
The text was updated successfully, but these errors were encountered: