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

Use interfaces as much as possible; switch to actions convenience class #59

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

uuf6429
Copy link
Member

@uuf6429 uuf6429 commented Jan 4, 2025

Copy link

codecov bot commented Jan 4, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
235 1 234 0
View the full list of 1 ❄️ flaky tests
Behat.Mink.Tests.Driver.Js.WindowTest::testResizeWindow

Flake rate in main: 5.00% (Passed 57 times, Failed 3 times)

Stack Traces | 302s run time
No failure message available

To view more test analytics, go to the Test Analytics Dashboard
📢 Thoughts on this report? Let us know!

{
$element->getLocationOnScreenOnceScrolledIntoView();
$this->getWebDriver()->getMouse()->mouseMove($element->getCoordinates());
$element->click();
Copy link
Member Author

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.

Copy link
Member

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).

Copy link
Member Author

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..

Base automatically changed from chore/upgrade-phpstan to main January 5, 2025 18:33
Copy link
Member

@stof stof left a 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
Copy link
Member

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

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.

3 participants