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

Interacting with opened windows #421

Merged
merged 29 commits into from
Jul 26, 2019
Merged

Interacting with opened windows #421

merged 29 commits into from
Jul 26, 2019

Conversation

michallepicki
Copy link
Contributor

@michallepicki michallepicki commented Mar 27, 2019

Closes #360

TODO:

  • Expose through Selenium, Chrome and Browser modules
  • Check no window_handle vs "current" window_handle (spec says it's "current"), possibly change get_window_size and set_window_size to use it as well
  • Revisit handling errors, reading the value from the response and return types (:ok is just the happy path) that's fine for now I think
  • Test in Selenium: Safari 11, Edge 17, Firefox, Chrome, Opera, Appium (older version compatible with this protocol)
  • Test in Chromedriver with a few Chrome and Chromium versions
  • Add documentation

For the unaware: I'm following the Selenium WebDriver Wire Protocol. The W3C WebDriver Protocol has too many changes to try to support both of them at the same time. We will need to have a separate WebdriverClient module for it for people that want to test in Safari 12 or newer, Edge 18 or newer, new Appium versions etc.

@michallepicki
Copy link
Contributor Author

I think getting and setting window size or position using a handle is not supported in many WebDrivers. Since the user can always change focus to that window first before executing these commands, I'm going to simplify this PR and remove the versions that take a handle. I'll keep the change from "no handle" to "current" to designate the target window since it seems to be working fine and it's more spec compliant with the old protocol.

@michallepicki michallepicki marked this pull request as ready for review July 24, 2019 05:55
@michallepicki
Copy link
Contributor Author

michallepicki commented Jul 24, 2019

@mhanberg @keathley I think this is good enough!

I didn't add an integration test for maximize_window because this command requires a window manager to be running.

A few existing commands got slightly changed to be more in-line with the Selenium WebDriver spec (w3c endpoints were being used), versions that take a window handle got dropped for simplicity (and because they returned values for current window for many browsers anyway), and return values got adjusted so that we always return {:ok, value} from the WebDriverClient module when the command succeeded.

mhanberg
mhanberg previously approved these changes Jul 25, 2019
lib/wallaby/experimental/selenium/webdriver_client.ex Outdated Show resolved Hide resolved
lib/wallaby/experimental/selenium/webdriver_client.ex Outdated Show resolved Hide resolved
@michallepicki michallepicki merged commit 2eca111 into elixir-wallaby:master Jul 26, 2019
@michallepicki michallepicki deleted the focus-window branch July 26, 2019 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interacting with opened windows/popups
2 participants