-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI test for PR #26979 #27191
UI test for PR #26979 #27191
Conversation
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
@individual-it, thanks for your PR! By analyzing the history of the files in this pull request, we identified @DeepDiver1975, @PVince81 and @phisch to be potential reviewers. |
What version of java is good for this step? openjdk can be used there? |
According to the selenium github page you need Java 8
https://github.com/vvo/selenium-standalone/blob/master/README.md
recent OpenJDK should be fine
The java version on my Debian dev. machine is:
openjdk version "1.8.0_111"
OpenJDK Runtime Environment (build 1.8.0_111-8u111-b14-2~bpo8+1-b14)
OpenJDK 64-Bit Server VM (build 25.111-b14, mixed mode)
|
|Unlimited |1 GB | | ||
|1 GB |5 GB | | ||
|5 GB |Unlimited | | ||
|1 GB |Unlimited | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feature cannot work, seems like a snippet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why shouldn't it work? At least it works fine for me. It runs 5 scenarios from that table. Check the bottom travis output:
https://travis-ci.org/individual-it/owncloud-core/jobs/203733741
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh right. It failed in my environment for different reasons.
tests/travis/start_behat_tests.sh
Outdated
# | ||
|
||
|
||
export BEHAT_PARAMS='{"extensions" : {"Behat\\MinkExtension" : {"base_url" : "http://'$SRV_HOST_NAME:$SRV_HOST_PORT/'","selenium2":{"wd_host":"http://'$SAUCE_USERNAME:$SAUCE_ACCESS_KEY'@localhost:4445/wd/hub"}}}}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have localhost as hostname and a path to access your server this sentence doesn't work as it uses:
localhost/path:80 which doesn't work it has to be localhost:80/path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes that is true, need to have $SRV_HOST_URL here too
always tested it with "start_behat_tests.sh" and that does not have any path
Also just found out that if you use port 80, the browser does not display it and so you get:
Expected to be on "http://localhost:80/index.php/login" but found "http://localhost/index.php/login" instead (SensioLabs\Behat\PageObjectExtension\PageObject\Exception\UnexpectedPageException)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
both problems should be fixed now
Quota validation has this issue open #25358 . |
I don't like that all travis tests are failing now - can we isolate this to only have selenium failing? @individual-it can you please quide me to the docs on how to integrate travis and sauce? THX |
The travis tests are failing because the saucelab add-on is enabled but the sauce credentials are not set up in the owncloud travis account. All tests pass on my fork: https://travis-ci.org/individual-it/owncloud-core/builds/204940857 If you agree with the concept you should do this to integrate it and make all tests pass:
more information is available here: https://docs.travis-ci.com/user/sauce-connect |
@individual-it I have added the credentials in the travis settings as environment variables. Mind rebasing and removing your credentials? THX |
right, my instructions were far too complicated, most of it I can make in the PR itself. |
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. |
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.
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
java -jar selenium-server-standalone-3.0.1.jar -port 4445
SRV_HOST_NAME, SRV_HOST_URL and SRV_HOST_PORT
e.g.:bash tests/travis/start_php_dev_server.sh
(leaveSRV_HOST_URL
empty if you are using the php dev. serverexport SRV_HOST_URL=""
)it will bind to:
$SRV_HOST_NAME:$SRV_HOST_PORT
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
Checklist:
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