Skip to content

Conversation

@individual-it
Copy link
Member

Description

This is an UI test for the PR #26979 that fixes the issue #26975

This also includes the complete setup of the selenium infrastructure that can be used as the basis of further UI tests. After the discussion in #27057 behat+mink is used instead of the facebook webdriver.

See also discussion in #27191

For this to work travis starts behat/mink tests. And they connect to selenium running on https://saucelabs.com

Related Issue

PR #26979
issue #26975

List of PRs/issues that potentially would benefit of UI tests:

Can't set a user's quota back to Unlimited #26975
Fix long display names #27059
files_external: Keep checkbox and its label on one line #25120
Improve quota validation including a regexp which matches expected formats #25358
Rows are not updated after sharing via web ui. #27294 nextcloud/server#3688
Fixed disappearing of share info in file view #26534 nextcloud/server#2010

Motivation and Context

See issue #27055
Some bugs are hard to catch with karma & PHPUnit tests. Primarily this are front-end bugs. This PR implements end-to-end testing environment run on real browsers. Currently only Chrome browser is used, but it can be extended to multiple browsers/platforms including mobile browsers.
Currently my own sauce-labs account is used. Of course it would be good that a oC account would be used in future.

run this tests locally

export SRV_HOST_NAME=localhost
export SRV_HOST_URL=owncloud-core
export SRV_HOST_PORT=80
  • if no webserver is already running start php development server with: bash tests/travis/start_php_dev_server.sh (leave SRV_HOST_URL empty if you are using the php dev. server export SRV_HOST_URL="")
    it will bind to: $SRV_HOST_NAME:$SRV_HOST_PORT
  • run tests: bash tests/travis/start_behat_tests.sh

limitations

Only PRs from local branches are tested. PRs that come from a fork cannot be tested as they do not have access to the saucelabs username+key.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

How Has This Been Tested?

@individual-it joined travis with their own account on sauce labs and has run multiple tests. Created bugs and run tests again to see if they are failing.

Screenshots (if appropriate):

travis job:
https://travis-ci.org/individual-it/owncloud-core/jobs/203733741
saucelabs job:
https://saucelabs.com/beta/tests/840fed2401854c50ab20109ac2812fb3/watch#305

@mention-bot
Copy link

@individual-it, thanks for your PR! By analyzing the history of the files in this pull request, we identified @DeepDiver1975, @SergioBertolinSG and @PVince81 to be potential reviewers.

@DeepDiver1975
Copy link
Member

👍

@DeepDiver1975 DeepDiver1975 added this to the 10.0 milestone Mar 7, 2017
@DeepDiver1975 DeepDiver1975 force-pushed the ui_tests_for_PR_26979 branch from e8a1eed to cee7b04 Compare March 7, 2017 10:27
@SergioBertolinSG
Copy link
Contributor

SergioBertolinSG commented Mar 7, 2017

I've tested this locally and I am getting four failures:

Examples:
  | start_quota | wished_quota |
  | Unlimited   | 5 GB         |
    Fatal error: Call to a member function click() on null (Behat\Testwork\Call\Exception\FatalThrowableError)
  | Unlimited   | 1 GB         |
    Fatal error: Call to a member function click() on null (Behat\Testwork\Call\Exception\FatalThrowableError)
  | 1 GB        | 5 GB         |
  | 5 GB        | Unlimited    |
    Fatal error: Call to a member function click() on null (Behat\Testwork\Call\Exception\FatalThrowableError)
  | 1 GB        | Unlimited    |
    Fatal error: Call to a member function click() on null (Behat\Testwork\Call\Exception\FatalThrowableError)

Any idea why those tests are failing?

I thought it was because the size of the window, but maximizing it manually has not helped.

Maybe it is not waiting for the elements?

@DeepDiver1975
Copy link
Member

Any idea why those tests are failing?

no - can you try to get an understanding of this @SergioBertolinSG - THX

@SergioBertolinSG
Copy link
Contributor

Ok, the problem was that my server was in spanish and this was looking for "Unlimited" instead of "Ilimitado". Works fine.

@DeepDiver1975 DeepDiver1975 force-pushed the ui_tests_for_PR_26979 branch from cee7b04 to 81b736c Compare March 7, 2017 23:42
individual-it and others added 2 commits March 8, 2017 00:45
This sets up UI tests. It uses behat/mink/selenium to run the tests on
saucelabs.com
Included are some basic tests
1. Login as admin
2. Tests to cover the fix made in PR #26979
@DeepDiver1975 DeepDiver1975 force-pushed the ui_tests_for_PR_26979 branch from 81b736c to b90f10c Compare March 7, 2017 23:45
@DeepDiver1975
Copy link
Member

👍

@lock
Copy link

lock bot commented Aug 3, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants