minkphp / webdriver-classic-driver Goto Github PK
View Code? Open in Web Editor NEWMink driver for the W3C WebDriver Classic protocol
License: MIT License
Mink driver for the W3C WebDriver Classic protocol
License: MIT License
Currently, the https://github.com/minkphp/webdriver-classic-driver/blob/main/tests/bootstrap.php file automatically starts/stops the web server with test fixtures used during testing. This is an innovative approach compared to how other drivers would do this.
If we go away from the current approach (start web server inside a test suite), then all that stuff needs to be moved into the GitHub Actions workflow (as in other drivers).
phpunit.xml
.I saw these Chrome default capabilities:
webdriver-classic-driver/src/WebdriverClassicDriver.php
Lines 44 to 49 in 3a116f9
Is it possible to add similar ones for the Firefox browser?
How to reproduce:
Session::visit
window.name
(because no URL is opened yet)w3cwh:{selenium_window_handle_here}
window.name
to the desired valueSession::reset
:
Session::swithToWindow()
works correctly, because it uses selenium-handle-based window identifierFor now the only option, that might work is to consider 1st opened window as initial (the 1st window handle returned) and never close it.
Related issue: #26
When the main window has a name and a couple of other windows are open, then the Session::reset
call throws a NoSuchWindow
exception, because it tries to determine the main window handle by its name after a popup window was just deleted while Selenium is in context of that deleted window (Web View).
Maybe for the internal window manipulations, the driver should use only window handles.
Related issue: #25
P.S.
I stumbled upon this error after fixing the #25 problem locally.
If possible, use selenium action api for all cases.
If not, consider using a syn alternative (or if to complex, depend on syn) for old selenium.
act
The https://github.com/minkphp/MinkSelenium2Driver/blob/master/src/Selenium2Driver.php uses {{ELEMENT}}
to mask the internal element representation of an element in the driver (my understanding). Later it replaces it with arguments[0]
when preparing JS code for a WebDriver.
This driver, however, exposes arguments[0]
instead.
I think, that this also is a BC break, because developers now can't switch to this driver without replacing {{ELEMENT}}
across their test suite first.
Please use the {{ELEMENT}}
as in the current Mink's Selenium2 driver (or at least in the public API of the driver).
The Selenium2 driver was typing Backspace (for Windows) + Delete (for Mac) keys to the input/textarea in the amount needed to erase the current value. That allowed any JavaScript code of that page, that monitored input/textarea value change (e.g., to prevent certain keys from being typed) to behave as if a real human was doing this.
This driver uses the clear
method of the WebDriver to clear the input/textarea value.
Does it fire necessary JS keyboard events in the process as well in every Selenium+Browser combination being tested?
P.S.
clear
WebDriver method might be changing element focus, which might fire a duplicate focus/blur event when using clear
+sendKeys
together.I just realised that the namespace might be wrong, we have Mink\WebdriverClassDriver
- shouldn't it be Mink\WebdriverClassicDriver
?
Browsing through the driver code I've noticed, that most of the error reporting isn't covered by tests. Without this, we can't be sure if the code actually works.
Either the https://github.com/minkphp/driver-testsuite needs to be improved or this repo custom tests.
Please improve the switchToIFrame
method with frame/iframe switching support by an index. Currently, in the W3C-compliant mode, it doesn't work.
Please see minkphp/Mink#866 for more info.
I would happily create PR similar to minkphp/MinkSelenium2Driver#378 as well.
Currently, there is no way to use this driver in the Behat, because there is no corresponding driver in the https://github.com/Behat/MinkExtension/tree/master/src/Behat/MinkExtension/ServiceContainer/Driver .
The driver key would be webdriver-classic
instead of selenium2
. The current Selenium2 driver could be used as a starting point.
@uuf6429 , please submit a PR to that repo.
The namespaces of the PHP classes (both src
and tests
folders) need to be standardized to match other Mink drivers:
src
folder: Behat\Mink\Driver
;tests
folder: Behat\Mink\Tests\Driver
.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.