-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use interfaces as much as possible; switch to actions convenience class #59
base: main
Are you sure you want to change the base?
Conversation
uuf6429
commented
Jan 4, 2025
•
edited
Loading
edited
-
⚠️ Must be rebased on main after Upgrade phpstan; increase phpstan level; fix a few bugs #55 is merged.
❌ 1 Tests Failed:
View the full list of 1 ❄️ flaky tests
To view more test analytics, go to the Test Analytics Dashboard |
{ | ||
$element->getLocationOnScreenOnceScrolledIntoView(); | ||
$this->getWebDriver()->getMouse()->mouseMove($element->getCoordinates()); | ||
$element->click(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to be consistent with the other actions by using this:
$this->actions()->click($element)->perform();
but for some strange reason, it does not work well in firefox, failing many tests:
https://github.com/minkphp/webdriver-classic-driver/actions/runs/12611297356/job/35146807053
I thought it might be because of the geckdriver-specific fix in RemoteWebElement->click()
, but it does not seem to be the case.
My last remaining guess is that DriverCommand::CLICK_ELEMENT
also waits for the page to finish loading, whereas DriverCommand::ACTIONS
(W3C)/DriverCommand::CLICK
(JWP) do not wait.
It may be useful to figure out exactly why, it might be the reason behind various fragile tests we have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to guess. Just do real-time debugging inside a WebDriver code (if you can reproduce a problem locally).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This happens within selenium (and possibly the webbrowser). DriverCommand::CLICK_ELEMENT
and DriverCommand::ACTIONS
(W3C)/DriverCommand::CLICK
(JWP) produce a different request to selenium. Of course I'll dig deeper..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you rebase this PR ?
@@ -77,7 +83,10 @@ class WebdriverClassicDriver extends CoreDriver | |||
|
|||
private const W3C_WINDOW_HANDLE_PREFIX = 'w3cwh:'; | |||
|
|||
private ?RemoteWebDriver $webDriver = null; | |||
/** | |||
* @var TWebDriver|null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
anything using phpstan type aliases should use a phpstan-
prefix for @var
, @param
and @return
to avoid issues with tools reading phpdoc without knowing about phpstan type aliases, which would treat this TWebDriver
as a class name