Skip to content

TEST.browser

TEST.browser is a read-only property that returns the browser the current test is running in.

This is useful if you need browser-specific handling, e.g. validating if the iOS app banner shows up for Safari browsers.

Usage

js
TEST.browser

Returns

A string identifying the browser the test is running in:

  • chrome : for Google Chrome
  • firefox : for Mozilla Firefox
  • edge : for legacy Microsoft Edge (EdgeHTML)
  • edgechromium : for Chromium-based Microsoft Edge
  • safari : for Safari
  • ie11 : for Internet Explorer 11

Examples

js
if (TEST.browser === "safari") {
	I.see("#ios-app-install-banner")
} else {
	I.dontSee("#ios-app-install-banner")
}

In the example above, the test checks that the element #ios-app-install-banner is displayed only when running in Safari.