Skip to content
This repository was archived by the owner on Mar 4, 2020. It is now read-only.

Commit 252e5ac

Browse files
author
Jeroen Versteeg
committed
DesiredCapabilities factory for Firefox disables Reader View help tooltip
This tooltip can hide window.document elements, which can break tests. See http://stackoverflow.com/questions/30764805/how-to-disable-reader-view-in-firefox-using-webdriver
1 parent 8eb1952 commit 252e5ac

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

lib/Remote/DesiredCapabilities.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,17 @@ public static function chrome() {
195195
* @return DesiredCapabilities
196196
*/
197197
public static function firefox() {
198-
return new DesiredCapabilities(array(
198+
$caps = new DesiredCapabilities(array(
199199
WebDriverCapabilityType::BROWSER_NAME => WebDriverBrowserType::FIREFOX,
200200
WebDriverCapabilityType::PLATFORM => WebDriverPlatform::ANY,
201201
));
202+
203+
// disable the "Reader View" help tooltip, which can hide elements in the window.document
204+
$profile = new FirefoxProfile();
205+
$profile->setPreference('reader.parse-on-load.enabled', false);
206+
$caps->setCapability(FirefoxDriver::PROFILE, $profile);
207+
208+
return $caps;
202209
}
203210

204211
/**

0 commit comments

Comments
 (0)