Coder Social home page Coder Social logo

Comments (7)

aik099 avatar aik099 commented on June 12, 2024 1

@uuf6429 , I'm not saying it's a bug. I'm saying that method signature change has prevented certain (might not be documented) Mink usage scenarios from working.

Since method DocBlock always was string|null $name, then nobody likely thought that specifying a frame index was actually an option. However, due to WebDriver ->frame(...) being used internally, it worked perfectly.

P.S.

  1. Frame switching by name works with Selenium 3 + https://github.com/minkphp/webdriver-classic-driver .
  2. I really want to know why it doesn't with https://github.com/minkphp/MinkSelenium2Driver (the bug in the https://github.com/instaclick/php-webdriver maybe).

from mink.

aik099 avatar aik099 commented on June 12, 2024

(clean) Or revert relevant switchToIFrame method signature changes, because $name can't be declared as both integer and string (in supported PHP versions).

Implemented in these PRs:

  1. #867 (merge this first)
  2. minkphp/driver-testsuite#87 (rerun tests to see they now pass and then merge)
  3. minkphp/MinkSelenium2Driver#378
  4. minkphp/webdriver-classic-driver#11

I've also updated relevant DocBlocks to indicate, that frame index can also be specified.

Probably the $name parameter of the switchToIFrame methods should be renamed into the $nameOrIndex to make IDE code assist a bit more helpful.

from mink.

uuf6429 avatar uuf6429 commented on June 12, 2024

Before calling this a bug, let's be clear - it was never defined that we can switch an iframe by index, as can be seen by your update of that comment:
https://github.com/minkphp/Mink/pull/867/files#diff-d76d9e3222ed852fe6951aa849d5e7c111042b6a5209a9fe6b53c0c7c7530735R187

I'm fine with supporting this though, just saying that any old usages with integers were misuses.

from mink.

aik099 avatar aik099 commented on June 12, 2024

Update: with the help of the @uuf6429 , I was able to get frame switching by name working on Selenium 3 (see minkphp/MinkSelenium2Driver#382).

from mink.

aik099 avatar aik099 commented on June 12, 2024

@stof , I only need a review from you. The merging and build rerunning I can do myself to save your time.

Also please look at the minkphp/MinkSelenium2Driver#382.

from mink.

stof avatar stof commented on June 12, 2024

I don't think using an integer index was ever meant to be supported in the Mink API. It worked in Selenium2Driver in the past only due to the lack of native parameter types that allowed to ignore the intended method signature.

If we were adding support for integer indexes in the Mink API, we would have to specify the meaning of those indexes. And if we say "this is the index in WebDriver Classic", this would not impossible to implement in any driver not based on the WebDriver protocol.

As you managed to fix the issue in the Selenium2Driver to actually support names, I suggest closing this issue.

from mink.

aik099 avatar aik099 commented on June 12, 2024

Agreed.

Here are the actions I've performed based on your response:

Closed

Repurposed

from mink.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.