Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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?

like image 463
Jakub Mucha Avatar asked Aug 21 '15 14:08

Jakub Mucha


1 Answers

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 
like image 125
Jakub Mucha Avatar answered Sep 30 '22 19:09

Jakub Mucha