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

Introduce Keys.sequence #164

Merged
merged 2 commits into from
Nov 13, 2024
Merged

Introduce Keys.sequence #164

merged 2 commits into from
Nov 13, 2024

Conversation

tristanlabelle
Copy link
Contributor

  • Removes Keys.operator+ as it could be confused with "hold and press " in favor of an explicit Keys.sequence(...) function.
  • Removes sendKeys overloads taking a Keys array. The array variant is supported by the protocol, but the spec says "The server should flatten the array items to a single string to be typed.", so let's rather encourage the use Keys.sequence. If a client really needs to send a key array, they can drop down to webDriver.send(Requests.SessionKeys(...)).
  • Removes .combo, which was unused and assumed a certain ordering of modifiers that is better expressed in the client code.

Fixes #163

@tristanlabelle tristanlabelle requested review from z2oh, jeffdav and a team November 12, 2024 11:16
@tristanlabelle tristanlabelle enabled auto-merge (squash) November 12, 2024 14:26
Sources/WebDriver/Keys.swift Outdated Show resolved Hide resolved
Copy link
Contributor

@jeffdav jeffdav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good. I think seq() would have been fine, but pixels are cheap these days. :)

Sources/WebDriver/Element.swift Show resolved Hide resolved
Sources/WebDriver/Session.swift Show resolved Hide resolved
@tristanlabelle
Copy link
Contributor Author

@jeffdav I don't want to be the next person responsible for the fact that thousands of programmers have to deal with the fact that /usr/ is missing an e :P. Swift is a pretty verbose language already so this stays in style.

@tristanlabelle tristanlabelle merged commit 24f495b into main Nov 13, 2024
4 checks passed
@tristanlabelle tristanlabelle deleted the tristan/Keys.sequence branch November 13, 2024 10:59
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.

Keys + Keys operator is confusing
3 participants