Giter Club home page Giter Club logo

driver-testsuite's People

Contributors

acoulton avatar aik099 avatar alexpott avatar andrewnicols avatar artursvonda avatar cweiske avatar lctrs avatar longwave avatar mvorisek avatar oleg-andreyev avatar robertfausk avatar stof avatar uuf6429 avatar xurizaemon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

driver-testsuite's Issues

testWindowMaximize is prone to failure

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?"

$this->assertLessThanOrEqual(100, $session->evaluateScript($script));

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

Add test to verify successful upload

The test suite doesn't check uploaded file checksum match. It checks only, this:

  • the upload happened without errors from the Selenium side;
  • the change JS event was triggered.

Need to:

  1. add a test, that compares the checksum of the to-be-uploaded file with the file-received-on-web-server.
  2. check, that all upload-capable drivers pass this test.

P.S.
Created per @uuf6429 comment (see #88 (comment)).

Behat\Mink\Tests\Driver\Js\ChangeEventTest::testSetValueChangeEvent error

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

[RFC] Discussion about the JSON test for drivers

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 ?

Different env var names for test server host

Shouldn't these two points use the same environment variable (at least for the port)?

if (!isset($_SERVER['WEB_FIXTURES_HOST'])) {
and
host=${MINK_HOST-localhost:8002}

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.

Add test for auto-complete

The test needs to be added, that confirms, that auto-complete controls (e.g. jQueryUI.AutoComplete) for JS-enabled drivers works as expected:

  • you can type a test
  • a dropdown appears with a suggestions
  • clicking on a suggestion puts it into the input
  • [not sure about this one] the change event is fired

Right now due way how it's implemented at least for MinkSelenium2Driver this is a big issue.

html_entity_decode before asserting on GeneralTest::testAdvancedForm()

On tests/Form/GeneralTest.php::testAdvancedForm(), when filling out the form field with Foo "item", it's expecting a html-encoded Foo &quot;item&quot; 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

Support PHPUnit 10

this is a meta-issue tracking blockers for using PHPUnit 10:

  • #63
  • symfony/symfony#49069 to support PHPUnit 10 in symfony/phpunit-bridge (that we rely on to report deprecations)
  • Yoast/PHPUnit-Polyfills#82 to support PHPUnit 10 in yoast/phpunit-polyfills (at least marking it as compatible in the composer constraint)
  • #65 Removing usage of TestCase::onNotSuccessfulTest to mark tests as skipped as this is not supported anymore
  • Making our base TestCase compatible with PHPUnit 10 (TestCase::getName was removed, replacing it with 2 methods instead of having a boolean flag)

Test suite is not compatible with PhpUnit 8.0

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

if (class_exists('PHPUnit\Runner\Version') && version_compare(Version::id(), '6.0.0', '>=')) {
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

Drop PHP 5.3 support

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.

Usage of "symfony/phpunit-brige" prevents PHPUnit < 6.0 installation

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).

Question: Wrong keycode expected when using shift modifier in EventsTest::testKeybordEvents?

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.


Assertion:
$input2->keyPress('r', $modifier);
$this->assertEquals('key pressed:114 / '.$eventProperties, $event->getText());
Provider:
'ctrl' => array('ctrl', '0 / 1 / 0 / 1'),

Pressed r:
image
Pressed shift+r:
image

Missing tests for window resize/maximize by name

Tests for window resizing/maximizing don't check these things:

  • the current window isn't changed after the resizing/maximizing operation is finished (e.g. when several windows are open and the user attempts to resize an inactive window);
  • resizing/maximizing a window with a given name does resize/maximize the correct window and the current window remains unchanged.

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.