Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 851 Bytes

no-absolute-url.md

File metadata and controls

22 lines (15 loc) · 851 Bytes

Recommend against navigating to absolute URLs inside browser.get() or browser.driver.get()

The rule would warn if browser.get() or browser.driver.get() are called with an absolute URL as an argument.

Instead, it is recommended to have baseUrl configuration option set and navigating to relative URLs in tests. This helps to easily switch to a different target application URL by simply changing the baseUrl setting (e.g. switch from dev to test or staging).

Rule details

👎 Any use of the following patterns are considered warnings:

browser.get("http://google.com");
browser.driver.get("https://google.com");

👍 The following patterns are not warnings:

browser.get("login");
browser.driver.get("account/signup");