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

Fixed frame switching by name on Selenium 3 #382

Merged
merged 1 commit into from
Oct 31, 2024

Conversation

aik099
Copy link
Member

@aik099 aik099 commented Feb 22, 2024

Fixes this error from the #383:

Behat\Mink\Tests\Driver\Basic\IFrameTest::testIFrame
WebDriver\Exception\InvalidArgument: data did not match any variant of untagged enum FrameId at line 3 column 1
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'fv-az779-213', ip: '10.1.0.12', os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.0-1056-azure', java.version: '1.8.0_[29](https://github.com/minkphp/MinkSelenium2Driver/actions/runs/8015977437/job/21897049622?pr=383#step:8:30)2'
Driver info: driver.version: unknown

Implementation ported from the https://github.com/minkphp/webdriver-classic-driver.

It appears, that on Selenium 3 frame switching is possible only by index or WebElement. This PR implements the later approach. In Selenium 2 frame switching by its name/id was also supported.

Additionally, the build script was updated to run tests on Selenium 3 in addition to Selenium 2. Should I split the build script change into a separate PR?

Copy link

codecov bot commented Feb 22, 2024

Codecov Report

Attention: Patch coverage is 82.35294% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 89.87%. Comparing base (4ca4083) to head (900ba20).

Files Patch % Lines
src/Selenium2Driver.php 82.35% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #382      +/-   ##
============================================
- Coverage     90.19%   89.87%   -0.32%     
- Complexity      168      174       +6     
============================================
  Files             1        1              
  Lines           469      484      +15     
============================================
+ Hits            423      435      +12     
- Misses           46       49       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

I suggest splitting the usage of Selenium 3 in CI into a separate PR as this is failing in CI (and maybe not worth the trouble given we have our new driver that aims at supporting it better)

@aik099 aik099 force-pushed the frame-switching-in-selenium3 branch from c3382cf to 73869e4 Compare February 23, 2024 07:21
@aik099
Copy link
Member Author

aik099 commented Feb 23, 2024

@stof , extract build changes into #383 .

@aik099 aik099 mentioned this pull request Feb 23, 2024
@aik099
Copy link
Member Author

aik099 commented Feb 23, 2024

I've also created a PR instaclick/php-webdriver#132 to allow WebDriver to properly convert WebElement into JSON (as it should be doing initially). When it's merged + release is made that would allow me to remove that ugly WebElement wrapping code, that surely doesn't belong to this repo at all.

@aik099 aik099 changed the title Allow frame switching by name on Selenium 3 Fixed frame switching by name on Selenium 3 Feb 24, 2024
@aik099 aik099 force-pushed the frame-switching-in-selenium3 branch from b0e2369 to 900ba20 Compare February 24, 2024 15:48
@aik099
Copy link
Member Author

aik099 commented Mar 16, 2024

@stof , please review. Ideally please review my other PRs as well: https://github.com/minkphp/MinkSelenium2Driver/pulls/aik099 .

andriokha added a commit to FabbDev/MinkSelenium2Driver that referenced this pull request Jun 29, 2024
@aik099 aik099 force-pushed the frame-switching-in-selenium3 branch from 900ba20 to 1a2dbf9 Compare October 31, 2024 12:24
@aik099 aik099 merged commit 6331c38 into minkphp:master Oct 31, 2024
2 of 9 checks passed
@aik099 aik099 deleted the frame-switching-in-selenium3 branch October 31, 2024 12:28
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.

2 participants