owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.36k stars 2.06k forks source link

MinkSelenium2Driver recent change breaks webUI tests #32143

Closed phil-davis closed 6 years ago

phil-davis commented 6 years ago

Steps to reproduce

  1. do a composer update to get the latest dependencies
  2. you will get later commits of dev-master for https://github.com/minkphp/MinkSelenium2Driver
  3. run a webUI test that types in a text box and presses enter, e.g.
    bash tests/travis/start_ui_tests.sh --feature tests/acceptance/features/webUIFiles/createFolders.feature:15

Expected behaviour

The test passes.

Actual behaviour

The test fails with:

  Scenario: Create a folder inside another folder                             # /drone/src/tests/acceptance/features/webUIFiles/createFolders.feature:15
    When the user creates a folder with the name "top-folder" using the webUI # WebUIFilesContext::theUserCreatesAFolderUsingTheWebUI()
      WebDriver\Exception\StaleElementReference: stale element reference: element is not attached to the page document
        (Session info: chrome=67.0.3396.99)
        (Driver info: chromedriver=2.40.565383 (76257d1ab79276b2d53ee976b2c3e3b9f335cde7),platform=Linux 4.4.0-130-generic x86_64) in /drone/src/lib/composer/instaclick/php-webdriver/lib/WebDriver/Exception.php:155
      Stack trace:
      #0 /drone/src/lib/composer/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php(157): WebDriver\Exception::factory(10, 'stale element r...')
      #1 /drone/src/lib/composer/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php(218): WebDriver\AbstractWebDriver->curl('POST', '/execute', Array)
      #2 /drone/src/lib/composer/instaclick/php-webdriver/lib/WebDriver/Container.php(224): WebDriver\AbstractWebDriver->__call('execute', Array)
      #3 /drone/src/lib/composer/behat/mink-selenium2-driver/src/Selenium2Driver.php(295): WebDriver\Container->__call('execute', Array)
      #4 /drone/src/lib/composer/behat/mink-selenium2-driver/src/Selenium2Driver.php(699): Behat\Mink\Driver\Selenium2Driver->executeJsOnElement(Object(WebDriver\Element), 'var node = argu...')
      #5 /drone/src/lib/composer/behat/mink/src/Element/NodeElement.php(105): Behat\Mink\Driver\Selenium2Driver->setValue('(//html/.//*\n[s...', '\xEE\x80\x83\xEE\x80\x97\xEE\x80\x83\xEE\x80\x97\xEE\x80\x83...')
      #6 /drone/src/lib/composer/behat/mink/src/Element/TraversableElement.php(160): Behat\Mink\Element\NodeElement->setValue('top-folder\xEE\x80\x87')
#7 /drone/src/tests/acceptance/features/lib/FilesPage.php(136): Behat\Mink\Element\TraversableElement->fillField('New folder', 'top-folder\xEE\x80\x87')

Server configuration

Local git repo master branch, or on drone CI.

phil-davis commented 6 years ago

The problem was introduced by https://github.com/minkphp/MinkSelenium2Driver/pull/286

The setValue method now tries to blur out of the input field after typing the value to be set. But in our case, we already pressed enter at the end of the input, which makes the field go away immediately. So the attempt to blur out fails with StaleElementReference

ownclouders commented 6 years ago

GitMate.io thinks possibly related issues are https://github.com/owncloud/core/issues/13402 (... broken), https://github.com/owncloud/core/issues/22485 (test), https://github.com/owncloud/core/issues/31579 (test), https://github.com/owncloud/core/issues/22492 (test), and https://github.com/owncloud/core/pull/31408 (Add scenario result to webUI test output).

phil-davis commented 6 years ago

https://github.com/minkphp/MinkSelenium2Driver/issues/292 raises the issue with the upstream project.