Commit Graph

131 Commits

Author SHA1 Message Date
Daniel Calviño Sánchez d4f39a9033 Add acceptance tests for hiding download in link shares
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-10-30 15:18:55 +01:00
Daniel Calviño Sánchez 565556b277 Move acceptance tests that crash the PHP built-in server to Apache
The PHP built-in server can crash when certain actions are performed in
Nextcloud (but although the crash is triggered by Nextcloud it does not
seem to be a Nextcloud bug), which can lead to failures in the
acceptance tests that would have otherwise passed.

A crash of the PHP built-in server during an acceptance test can be
identified by the message "sh: 1: kill: No such process" in the
acceptance tests output; as the PHP built-in server crashed its process
does no longer exist when it is tried to be killed when the scenario
ends.

Although the crash has been observed in other tests too it is more
prevalent in the tests for tags and the theming app. In order to
reduce the false positives those tests are now run on Apache instead of
on the PHP built-in sever. However, the rest of tests are still run on
the PHP built-in server due to its lower resource consumption.

In order to run a feature or just a scenario using Apache it has to be
tagged with "@apache"; features or scenarios without that tag (the
default) will run on the PHP built-in server instead.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-10-29 12:38:42 +01:00
Daniel Calviño Sánchez 34f397fd22 Link the default Apache directory to the Nextcloud server in all runners
In order to run the acceptance tests in Apache "/var/www/html" has to be
linked to the root directory of the Nextcloud server. Before this was
automatically done when launching the acceptance tests through
"./run.sh", but an explicit command was needed when run in Drone. Now
the linking was moved from "run.sh" to "run-local.sh", so it is
automatically done when run through "./run.sh" and in Drone, including
when running the tests for an app instead of for the server.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-10-29 12:38:42 +01:00
Daniel Calviño Sánchez 95dc2ad13c Extract acceptance tests for tags to their own feature file
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-10-29 08:40:05 +01:00
Daniel Calviño Sánchez f844799d9b Move the browser window of an actor to the foreground when acting as him
Each time a new actor appears in a scenario the browser window of the
new actor is put in front of the browser windows of the previous actors.
Before, when acting again as a previous actor his browser window stayed
in the background; in most cases everything worked fine even if the
window was in the background, but due to a bug in the Firefox driver of
Selenium and/or maybe in Firefox itself when the window was in the
background it was not possible to set the value of an input field that
had a range selected.

Now, when acting again as a previous actor his browser window is brought
to the foreground. This prevents the bug from manifesting, but also
reflects better how a user would interact with the browser in real life.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-10-26 11:07:13 +02:00
Daniel Calviño Sánchez 779000eb13 Add acceptance tests for opening a section in the Files app
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-10-21 20:21:59 +02:00
Jan-Christoph Borchardt 9b8e884b19
Change wording of 'Copy URL' to more understandable 'Copy link'
Signed-off-by: Jan-Christoph Borchardt <hey@jancborchardt.net>
2018-10-01 11:02:12 +02:00
John Molakvoæ (skjnldsv) f5f31e221c
Fix class selector for acceptance tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-09-28 08:20:10 +02:00
Roeland Jago Douma 1fecea6c08
Also test enabling of the Antivirus App for files
Since there is no calendar release for 15 yet we should use an app that
we can quickly release for 15 as well.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-09-26 22:05:42 +02:00
Daniel Calviño Sánchez bc84aa0269 Include empty directories in the default state of acceptance tests
Before each scenario of the acceptance tests is run the Nextcloud server
is reset to a default state. To do this the full directory of the
Nextcloud server is commited to a local Git repository and then reset to
that commit when needed.

Unfortunately, Git does not support including empty directories in a
commit. Due to this, when the default state was restored, it could
happen that the file cache listed an empty directory that did not exist
because it was not properly restored (for example,
"data/appdata_*/css/icons"), and that in turn could lead to an error
when the directory was used.

Currently the only way to force Git to include an empty directory is to
add a dummy file to the directory (so it will no longer be empty,
but that should not be a problem in the affected directories, even if
the dummy file is not included in the file cache); although Git FAQ
suggests using a ".gitignore" file a ".keep" file was used instead, as
it conveys better its purpose.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-09-18 10:23:35 +02:00
Michael Weimann 55cf7c35e1
Adds an acceptance test for the users settings navigation without disabled users
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
2018-08-14 22:28:11 +02:00
Julius Härtl 1b4d502bfd
Adjust acceptance test to check if the correct sidebar view is shown
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-08-03 14:06:04 +02:00
Daniel Calviño Sánchez 029b33a664 Add acceptance test for creating a user with a custom display name
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-07-31 13:40:47 +02:00
Roeland Jago Douma 71028fde6b
Merge pull request #10322 from weeman1337/feature-9978-improve-disabled-user-login-message
Login: Implements the "user disabled" message like the "wrong password" message
2018-07-24 20:00:20 +02:00
Michael Weimann 801bf81317 Adds disabled user acceptance tests
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
2018-07-24 17:31:03 +02:00
John Molakvoæ (skjnldsv) 0274507cb1
Acceptance and mobile navigation fixes
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-07-24 11:01:11 +02:00
Daniel Calviño Sánchez 70262fb11a Adjust acceptance tests to the new share link UI
The share link UI no longer uses its own layout below the other shares;
now it is shown as a share row with a menu for the actions (except
enabling it, which is shown in the row itself), just like the other
shares.

The share link is no longer shown, either; now the link is got by
clicking on a "Copy URL" menu item, which copies the link to the
clipboard. As the clipboard is not accessible from the acceptance tests
the URL is now extracted from the attributes of that menu item (although
the menu item is clicked anyway to mimic the user behaviour).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-07-21 17:31:11 +02:00
John Molakvoæ (skjnldsv) 562e2aa30b
Adjust acceptance tests to sidebar changes in Files app
Before, each section of the Files app ("All files", "Favorites"...) had
its own sidebar element. Now there is a single sidebar element for all
the sections in the Files app.

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-07-20 23:38:03 +02:00
Julius Härtl 4d5c01e066
Fix accceptance tests
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-07-20 16:49:05 +02:00
Michael Weimann 37e0f85ad0 Adds tests for testing removing an empty group
Signed-off-by: Michael Weimann <mail@michael-weimann.eu>
2018-07-20 09:51:23 +02:00
Daniel Calviño Sánchez ea6b5063b5 Fix variable not replaced in "behat.yml" when default value was used
As "selenium.server" is a simulated variable it is not recognized by
Mink, so it must be always replaced by its value in "behat.yml" before
the file is parsed by Behat.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-06-28 17:32:38 +02:00
Daniel Calviño Sánchez e9012021fe Fix documentation
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-06-22 19:47:46 +02:00
Daniel Calviño Sánchez d70b6bc94b Set "wd_host" directly in "behat.yml" instead of through "BEHAT_PARAMS"
The "wd_host" parameter of Selenium2 sessions specify the URL used by
the Selenium driver to connect with the Selenium server. Thus, when the
Selenium server is at a different host or port than the default one (for
example, when run on Drone) the "wd_host" parameter must be set for each
of the Selenium2 sessions defined in "behat.yml".

The "BEHAT_PARAMS" environment variable, which extends the "behat.yml"
configuration file, was used for that. However, this required adding to
the "BEHAT_PARAMS" in "run-local.sh" each new session added to
"behat.yml", including those added in the acceptance tests of apps.

To address that limitation, this commit introduces a simulated variable,
"selenium.server"; just before the acceptance tests are run the
"selenium.server" variable in the "wd_host" parameter is replaced in the
"behat.yml" file used by the acceptance tests. Note that the file that
is modified is the one inside the Docker container used to run the
acceptance tests, so the original file is not touched.

Note that a simulated variable is needed because Behat does not support
overridding nor setting configuration parameters with environment
variables.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-06-22 19:46:44 +02:00
Roeland Jago Douma 8ebc3d90a0
Merge pull request #9518 from nextcloud/feature/5986/public_share_controller_middleware
Public share middleware & controller
2018-06-21 10:09:20 +02:00
Daniel Calviño Sánchez 2cfb3832fa
Adjust theming acceptance tests to new header colour transition
Before, the acceptance tests checked the header colour just once, as the
header colour was immediately changed once the new theming colour was
saved. This is no longer the case, as currently a transition is used to
change between the original colour and the new one, so now the
acceptance tests check repeteadly for the expected header colour until
it matches or the timeout expires.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-06-20 19:21:54 +02:00
John Molakvoæ (skjnldsv) e01f004a13
Fixed tests and improved app-navigation-caption
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-06-20 19:21:54 +02:00
Roeland Jago Douma 5805159487
Fix acceptance test
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-06-20 08:57:13 +02:00
Julius Härtl cdbe39d006
Properly check for the sidebar
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-06-09 12:06:14 +02:00
Julius Härtl de66336f9c
Add basic acceptance tests for apps management
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-06-09 11:37:41 +02:00
John Molakvoæ (skjnldsv) da583f05fc
Allow 0 quota by provisioning api
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-06-07 11:30:37 +02:00
Daniel Calviño Sánchez aedcbb64da Use "paths.base" parameter for the path to the custom Firefox profile
Although in the case of the acceptance tests for the server it is not
strictly needed it was modified for consistency with the configuration
used for the acceptance tests in apps.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-05-29 20:25:18 +02:00
Daniel Calviño Sánchez 3bdb07320d Add workaround for parameter not available in Mink Extension
Due to a bug in the Mink Extension for Behat it is not possible to use
the "paths.base" parameter in the path to the custom Firefox profile.
"paths.base" is a special parameter in the Behat configuration that
refers to the directory in which "behat.yml" is stored. This comes in
very handy to set the path to custom Firefox profiles in the acceptance
tests for apps, as even if the "behat.yml" file belongs to an app its
paths are relative to the directory in which the tests are run, that is,
the "tests/acceptance" directory of the server.

Until the bug is fixed, just before the acceptance tests are run the
"paths.base" parameter in the path to the custom Firefox profile is
replaced by its value in the "behat.yml" file used by the acceptance
tests. Note that the file that is modified is the one inside the Docker
container used to run the acceptance tests, so the original file is not
touched.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-05-29 20:24:32 +02:00
Daniel Calviño Sánchez f4a64051b6 Extract path to configuration dir to its own variable
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-05-29 18:20:58 +02:00
Morris Jobke a2c518ee5a
Merge pull request #8824 from nextcloud/settings-vue
Vue migration: settings
2018-05-23 00:32:46 +02:00
Daniel Calviño Sánchez cb20503341 Add Firefox profile with support for CSS grid to acceptance tests
The acceptance tests are currently run on Firefox 47; in that version
the CSS grid support was not enabled by default, but it could be enabled
through a setting in the Firefox profile.

By default Selenium uses a clean Firefox profile when a new session is
started, but it also allows the customization of the profile through a
zipped "user.js" file. The contents of that file have to be provided in
the "firefox_profile" capability when the Firefox session is created.

In the Mink extension for Behat several Mink sessions can be defined in
the "behat.yml" file. Each Mink session uses a different browser session
in Selenium, and each of those browser sessions is initialized with the
capabilities provided in the "behat.yml" file.

From the point of view of the acceptance tests each Mink session is an
actor, so different actors can use different browsers with different
capabilities.

Due to all this a new actor was introduced, "Rubeus", who uses a Firefox
browser that has CSS grid support; this actor is meant to be used only
in those acceptance tests that require proper support for CSS grids.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-05-18 17:44:43 +02:00
John Molakvoæ (skjnldsv) 549940ddb9
Fixed root url detection, new tests, default new user group to current
opened group and user removal update fix

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-05-16 09:50:24 +02:00
John Molakvoæ (skjnldsv) 6b1452bd7b
Bump script and fixed copyright template
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-05-16 09:50:24 +02:00
John Molakvoæ (skjnldsv) a434077251
Tabs fix
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-05-16 09:50:24 +02:00
John Molakvoæ (skjnldsv) 07a592bd27
Users list acceptance tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-05-16 09:50:23 +02:00
John Molakvoæ (skjnldsv) f3a06259e4
newt acceptance tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-05-16 09:50:23 +02:00
John Molakvoæ (skjnldsv) e45147d7d6
Fixed router
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-05-16 09:50:23 +02:00
John Molakvoæ (skjnldsv) a30eacccbf
Fixed new user form detection in acceptance
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-05-16 09:50:23 +02:00
John Molakvoæ (skjnldsv) f9143f8db4
Fix row detection acceptance test
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-05-16 09:50:23 +02:00
Daniel Calviño Sánchez 4341d8731e Rename helper for PHP built-in web server
For consistency with the helper for the Apache web server the helper for
the PHP built-in web server was renamed too.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-04-09 21:50:30 +02:00
Daniel Calviño Sánchez aa96dfd173 Add helper to run acceptance tests on an Apache server
The default and only helper to run acceptance tests run them on the PHP
built-in web server. This commit introduces a new helper that can be
used to run them on an Apache web server instead.

This helper is meant to be used by the acceptance tests of apps that
require a multi-threaded web server to run (like Talk, due to its use of
long polling). To use the helper it is only needed to set it in the
Behat configuration for the acceptance tests of the app, as explained in
the "NextcloudTestServerContext" documentation.

It is assumed that the acceptance tests are run using the default setup,
and therefore inside a Docker container based on the image for
acceptance tests from Nextcloud. Due to that the helper is expected to
have root permissions, and thus it starts and stops the Apache web
server directly using "service start/stop apache2". In the same way it
also restores the owner and group for "apps", "config" and "data" to
"www-data", as it is the user that Apache sub-processes are run as.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-04-09 21:50:30 +02:00
Daniel Calviño Sánchez ea21fe2dbc Add support for setting the domain also when a specific helper is used
Before, the domain was automatically added assuming that the
NextcloudTestServerContext had no parameters defined in the Behat
configuration. However, in order to use a helper for Apache it would
need to be specified in the configuration with something like:

- NextcloudTestServerContext:
    nextcloudTestServerHelper: NextcloudTestServerLocalApacheHelper

The substitution now works both when a helper is specified and when it
is not; note, however, that providing custom parameters to the helper is
not supported, although they are not needed anyway so it is not really a
problem.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-04-09 21:50:30 +02:00
Daniel Calviño Sánchez a09b787a01 Install and configure Nextcloud server as www-data
Apache sub-processes are run as the www-data user, and they need to be
able to write to the "apps", "config" and "data" directories, so they
have to belong to that user, and therefore the Nextcloud server has to
be installed and configured too as the www-data user. The PHP built-in
web server will still be run as the root user, but in that case the
owner of those directories makes no difference, so this is compatible
with both cases.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-04-09 21:50:30 +02:00
Daniel Calviño Sánchez f6d34587a2 Use Docker image for acceptance tests
The Docker image for acceptance tests provides support for both the PHP
built-in web server and the Apache web server; the acceptance tests for
the server are run on the PHP built-in web server, but the acceptance
tests for some apps will have to be run on the Apache web server (for
example, Talk, as it uses long polling), so a Docker image to support
both cases has to be used in "run.sh". ".drone.yml" was just updated for
consistency, although it was not really needed.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-04-09 21:50:30 +02:00
Morris Jobke db6fa03ad6
Merge pull request #9114 from nextcloud/make-possible-to-provide-acceptance-tests-for-apps
Make possible to provide acceptance tests for apps
2018-04-09 17:31:28 +02:00
Daniel Calviño Sánchez c8df4f5df4 Make possible to set the acceptance tests directory to use
When the acceptance tests were run they were always loaded from the
"tests/acceptance" directory of the Nextcloud server. Now it is possible
to set the directory used to look for the Behat configuration and the
Nextcloud installation script, which makes possible to run acceptance
tests for the apps too instead of only for the server (although if no
directory is explicitly given the tests for the server are the ones
run).

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-04-06 21:56:12 +02:00