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

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
238 2 236 20
View the top 1 failed tests by shortest run time
Behat.Mink.Tests.Driver.Js.WindowTest::testGetWindowNames
Stack Traces | 300s run time
No failure message available
View the full list of 1 ❄️ flaky tests
Behat.Mink.Tests.Driver.Js.WindowTest::testResizeWindow

Flake rate in main: 13.89% (Passed 62 times, Failed 10 times)

Stack Traces | 300s 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 ?

src/WebdriverClassicDriver.php Outdated Show resolved Hide resolved
@uuf6429 uuf6429 force-pushed the chore/depend-on-interfaces branch from 5be7ce6 to 75eac8b Compare January 7, 2025 19:17
@@ -18,14 +18,18 @@
use Facebook\WebDriver\Exception\TimeoutException;
use Facebook\WebDriver\Exception\UnsupportedOperationException;
use Facebook\WebDriver\Exception\WebDriverException;
use Facebook\WebDriver\Interactions\WebDriverActions;
use Facebook\WebDriver\Internal\WebDriverLocatable;
Copy link
Member

Choose a reason for hiding this comment

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

The Internal namespace suggests, that this class/interface shouldn't be used outside of the library and therefore not included in BC promise. But maybe I'm mistaken.

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