-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[java] use FileDetector to install Firefox addons
- Loading branch information
1 parent
05a3a5e
commit 54a03b9
Showing
4 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ | |
import org.openqa.selenium.remote.RemoteWebDriver; | ||
import org.openqa.selenium.remote.SessionId; | ||
import org.openqa.selenium.remote.UnreachableBrowserException; | ||
import org.openqa.selenium.remote.UselessFileDetector; | ||
import org.openqa.selenium.support.ui.ExpectedCondition; | ||
import org.openqa.selenium.support.ui.WebDriverWait; | ||
import org.openqa.selenium.testing.Ignore; | ||
|
@@ -501,10 +502,16 @@ public void testFirefoxCanNativelyClickOverlappingElements() { | |
|
||
@Test | ||
public void canAddRemoveExtensions() { | ||
Path extension = InProject.locate("third_party/firebug/favourite_colour-1.1-an+fx.xpi"); | ||
HasExtensions extensions = (HasExtensions) driver; | ||
String extensionID; | ||
|
||
((HasExtensions) driver).installExtension(extension); | ||
((HasExtensions) driver).uninstallExtension("[email protected]"); | ||
Path extension = InProject.locate("third_party/firebug/favourite_colour-1.1-an+fx.xpi"); | ||
if (((RemoteWebDriver) driver).getFileDetector().getClass() != UselessFileDetector.class) { | ||
extensionID = extensions.installExtension(extension, ((RemoteWebDriver) driver).getFileDetector()); | ||
} else { | ||
extensionID = extensions.installExtension(extension); | ||
} | ||
extensions.uninstallExtension(extensionID); | ||
} | ||
|
||
@Test | ||
|