minkphp / driver-testsuite Goto Github PK
View Code? Open in Web Editor NEWFunctional testsuite for Mink drivers
License: MIT License
Functional testsuite for Mink drivers
License: MIT License
First of all, the code is not very clear - it took me a few moments to realise what it was doing, all the while I was thinking "but where is the screen height defined and is 100 a sane maximised window height?"
driver-testsuite/tests/Js/WindowTest.php
Line 95 in 9f2fb57
It turns out that the test assumes that when a window is maximized, it will be the height of the screen minus some height for desktop widgets such as a taskbar. This extra height is defined as a buffer of up to 100px.
(it could be helpful to assign values to aptly named variables)
Anyway, while testing with Firefox on Selenium (standalone v2.53.1), it seems that the OS needs 102px - causing the test to fail.
A cursory search resulted in this fairly available API that could be used instead of manually checking the window size:
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/windows/WindowState#browser_compatibility
The test suite doesn't check uploaded file checksum match. It checks only, this:
change
JS event was triggered.Need to:
P.S.
Created per @uuf6429 comment (see #88 (comment)).
I'm testing https://github.com/jcalderonzumba/MinkPhantomJSDriver with the test suite using phantomjs 2.1.1 and i get this error that does not happen on older phantomjs browsers.
1) Behat\Mink\Tests\Driver\Js\ChangeEventTest::testSetValueChangeEvent with data set "file" ('the-file', 'from empty', 'from existing')
Zumba\GastonJS\Exception\JavascriptError: One or more errors were raised in the Javascript code on the page.
If you don't care about these errors, you can ignore them by
setting js_errors: false in your Poltergeist configuration (see documentation for details).
InvalidStateError: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable.
InvalidStateError: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable.
at phantomjs://code/agent.js:465 in set
at :187 in textAreaSetValue
at :175 in inputSetValue
at :201
at :211
at :212
at :212
/Users/juan/code/scm/opensource/pjsdriver/vendor/jcalderonzumba/gastonjs/src/Browser/BrowserBase.php:119
/Users/juan/code/scm/opensource/pjsdriver/vendor/jcalderonzumba/gastonjs/src/Browser/BrowserBase.php:99
/Users/juan/code/scm/opensource/pjsdriver/vendor/jcalderonzumba/gastonjs/src/Browser/BrowserScriptTrait.php:16
/Users/juan/code/scm/opensource/pjsdriver/src/FormManipulationTrait.php:39
/Users/juan/code/scm/opensource/pjsdriver/vendor/behat/mink/src/Element/NodeElement.php:105
/Users/juan/code/scm/opensource/pjsdriver/vendor/mink/driver-testsuite/tests/Js/ChangeEventTest.php:50```
A test using a JSON page was added a long time ago (in minkphp/Mink@fb5dfa7).
However, this test asserts that the page content contains the JSON, not that it is exactly the JSON. And this is because in a real browser (Chromium through Selenium, but also PhantomJS), the actual page content looks like this:
<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">{"key1":"val1","key2":234,"key3":[1,2,3]}</pre></body></html>
The same is true for a plain-text page btw (JSON is treated as being plain-text here).
As browsers are meant to deal with HTML pages, I'm wondering whether this test actually makes sense. What do you think @aik099 @everzet ?
Shouldn't these two points use the same environment variable (at least for the port)?
driver-testsuite/tests/AbstractConfig.php
Line 42 in 2ef2bff
driver-testsuite/bin/mink-test-server
Line 9 in 2ef2bff
In minkphp/webdriver-classic-driver#23, I was considering to use the mink-test-server
script instead of calling PHP directly in the bootstrap.php file, but from what I understand it wouldn't work, unless I force MINK_HOST
with:
$parsedUrl = parse_url(WebdriverClassicConfig::getInstance()->getWebFixturesUrl());
$process = new Process(..., ['MINK_HOST' => $parsedUrl['host'] . ':' . $parsedUrl['port']])`
@aik099 that's another reason I wasn't relying on the old/current (broken) approach.
The test needs to be added, that confirms, that auto-complete controls (e.g. jQueryUI.AutoComplete) for JS-enabled drivers works as expected:
change
event is firedRight now due way how it's implemented at least for MinkSelenium2Driver this is a big issue.
On tests/Form/GeneralTest.php::testAdvancedForm(), when filling out the form field with Foo "item"
, it's expecting a html-encoded Foo "item"
result on the page. This will provide inconsistent results across drivers, because on some drivers the response can come either html-encoded or decoded, like on the Selenium2Driver, where this behaviour is browser-dependant.
To normalize this behaviour across drivers, it would be best to html_entity_decode() the page source and expect the decoded content
this is a meta-issue tracking blockers for using PHPUnit 10:
yoast/phpunit-polyfills
(at least marking it as compatible in the composer constraint)TestCase::onNotSuccessfulTest
to mark tests as skipped as this is not supported anymoreTestCase::getName
was removed, replacing it with 2 methods instead of having a boolean flag)https://travis-ci.org/oleg-andreyev/MinkSelenium2Driver/jobs/510999339
PHP Fatal error: Declaration of Behat\Mink\Tests\Driver\SkippingUnsupportedTestCase::onNotSuccessfulTest(Throwable $e) must be compatible with PHPUnit\Framework\TestCase::onNotSuccessfulTest(Throwable $t): void in /home/travis/build/oleg-andreyev/MinkSelenium2Driver/vendor/mink/driver-testsuite/tests/SkippingUnsupportedTestCase.php on line 18
Supporting more and more versions of PHP is becoming quite painful, we already have
which is trying to solve some issue with PHPUnit upgrade.This repository does not define the exact version of PHPUnit it supports and relies on something that Travis-CI will provide. Currently, I think we need to define some version of PHPUnit which still support 5.3 and 7.x
Related to #33
I think we need to drop PHP 5.3, it's too old and we need to keep up with PHP versions.
I'm not sure why, but fact usage of symfony/phpunit-brige
makes it impossible for driver repos, that use this repo to install local version of PHPUnit, that works on PHP 5.x (e.g. PHP 5.4).
This way it's impossible to run driver test suite locally (even when you have desired PHP version).
When I send "r" to the browser then keycode 114
is used but when I send r
and modifier shift
to browser then keycode 82
is used.
I encounter a problem because test case always expects keycode 114
.
driver-testsuite/tests/Js/EventsTest.php
Lines 104 to 105 in d208035
driver-testsuite/tests/Js/EventsTest.php
Line 117 in d208035
Tests for window resizing/maximizing don't check these things:
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.