Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ./wpt run --channel=preview safari #13460

Merged
merged 1 commit into from
Oct 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/_running-tests/safari.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Now, run the tests using the `safari` product:
```

This will use the `safaridriver` found on the path, which will be stable Safari.
To run Safari Technology Preview instead, use the `--webdriver-binary` argument:
To run Safari Technology Preview instead, use the `--channel=preview` argument:
```
./wpt run --webdriver-binary "/Applications/Safari Technology Preview.app/Contents/MacOS/safaridriver" safari [test_list]
./wpt run --channel=preview safari [test_list]
```
29 changes: 16 additions & 13 deletions tools/wpt/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def find_binary(self, venv_path=None, channel=None):
return NotImplemented

@abstractmethod
def find_webdriver(self):
def find_webdriver(self, channel=None):
"""Find the binary of the WebDriver."""
return NotImplemented

Expand Down Expand Up @@ -211,7 +211,7 @@ def find_certutil(self):
return None
return path

def find_webdriver(self):
def find_webdriver(self, channel=None):
return find_executable("geckodriver")

def get_version_and_channel(self, binary):
Expand Down Expand Up @@ -387,7 +387,7 @@ def install(self, dest=None, channel=None):
def find_binary(self, venv_path=None, channel=None):
raise NotImplementedError

def find_webdriver(self):
def find_webdriver(self, channel=None):
raise NotImplementedError

def install_webdriver(self, dest=None, channel=None):
Expand Down Expand Up @@ -441,7 +441,7 @@ def platform_string(self):
def find_binary(self, venv_path=None, channel=None):
raise NotImplementedError

def find_webdriver(self):
def find_webdriver(self, channel=None):
return find_executable("chromedriver")

def install_webdriver(self, dest=None, channel=None):
Expand Down Expand Up @@ -489,7 +489,7 @@ def install(self, dest=None, channel=None):
def find_binary(self, venv_path=None, channel=None):
raise NotImplementedError

def find_webdriver(self):
def find_webdriver(self, channel=None):
return find_executable("chromedriver")

def install_webdriver(self, dest=None, channel=None):
Expand Down Expand Up @@ -541,7 +541,7 @@ def platform_string(self):
def find_binary(self, venv_path=None, channel=None):
raise NotImplementedError

def find_webdriver(self):
def find_webdriver(self, channel=None):
return find_executable("operadriver")

def install_webdriver(self, dest=None, channel=None):
Expand Down Expand Up @@ -584,7 +584,7 @@ def install(self, dest=None, channel=None):
def find_binary(self, venv_path=None, channel=None):
raise NotImplementedError

def find_webdriver(self):
def find_webdriver(self, channel=None):
return find_executable("MicrosoftWebDriver")

def install_webdriver(self, dest=None, channel=None):
Expand All @@ -610,7 +610,7 @@ def install(self, dest=None, channel=None):
def find_binary(self, venv_path=None, channel=None):
raise NotImplementedError

def find_webdriver(self):
def find_webdriver(self, channel=None):
return find_executable("IEDriverServer.exe")

def install_webdriver(self, dest=None, channel=None):
Expand All @@ -635,8 +635,11 @@ def install(self, dest=None, channel=None):
def find_binary(self, venv_path=None, channel=None):
raise NotImplementedError

def find_webdriver(self):
return find_executable("safaridriver")
def find_webdriver(self, channel=None):
path = None
if channel == "preview":
path = "/Applications/Safari Technology Preview.app/Contents/MacOS"
jgraham marked this conversation as resolved.
Show resolved Hide resolved
return find_executable("safaridriver", path)

def install_webdriver(self, dest=None, channel=None):
raise NotImplementedError
Expand Down Expand Up @@ -695,7 +698,7 @@ def find_binary(self, venv_path=None, channel=None):
path = find_executable("servo")
return path

def find_webdriver(self):
def find_webdriver(self, channel=None):
return None

def install_webdriver(self, dest=None, channel=None):
Expand All @@ -719,7 +722,7 @@ def install(self, dest=None, channel=None):
def find_binary(self, venev_path=None, channel=None):
raise NotImplementedError

def find_webdriver(self):
def find_webdriver(self, channel=None):
raise NotImplementedError

def install_webdriver(self, dest=None, channel=None):
Expand All @@ -741,7 +744,7 @@ def install(self, dest=None, channel=None):
def find_binary(self, venv_path=None, channel=None):
return None

def find_webdriver(self):
def find_webdriver(self, channel=None):
return None

def install_webdriver(self, dest=None, channel=None):
Expand Down
2 changes: 2 additions & 0 deletions tools/wpt/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
latest_channels = {
'firefox': 'nightly',
'chrome': 'dev',
'safari': 'preview',
'safari_webdriver': 'preview',
'servo': 'nightly'
}

Expand Down
2 changes: 1 addition & 1 deletion tools/wpt/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def install(self, venv, channel=None):

def setup_kwargs(self, kwargs):
if kwargs["webdriver_binary"] is None:
webdriver_binary = self.browser.find_webdriver()
webdriver_binary = self.browser.find_webdriver(channel=kwargs["browser_channel"])

if webdriver_binary is None:
raise WptrunError("Unable to locate safaridriver binary")
Expand Down