Jakub Mucha
Jakub Mucha

Reputation: 1360

How to pass baseUrl from protractor.conf into my test to assert it in tests?

What I want to do is:

expect(browser.getCurrentUrl()).toEqual(protractor.baseUrl + urls.cookiesPage());

This is what I get:

 - Expected 'https://somewebsite.com/about/cookies/' to equal 'undefined/about/cookies/'.

How to pass baseUrl from config file into my test so I can assert it?

Upvotes: 23

Views: 16275

Answers (1)

Jakub Mucha
Jakub Mucha

Reputation: 1360

5 minutes later, I found an answer... after 2 hours of research:

expect(browser.getCurrentUrl()).toEqual(browser.baseUrl + 'some/url/right/here');

So, this was the answer:

browser.baseUrl

Upvotes: 60

Related Questions