Commit Graph

4610 Commits

Author SHA1 Message Date
Morris Jobke c4c6943c1e
Merge pull request #9127 from nextcloud/make-possible-to-run-acceptance-tests-on-apache
Make possible to run acceptance tests on Apache
2018-04-09 23:50:44 +02:00
Morris Jobke acbcc607ea
Merge pull request #9111 from nextcloud/use-proper-bool-user-disabled-state
Return proper boolean and do not save enabled state in db
2018-04-09 23:39:02 +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
John Molakvoæ (skjnldsv) 8b9bd37e4e
Fixed tests
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-04-09 15:13:11 +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
Roeland Jago Douma 2b7d4d5069
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-04-06 19:58:37 +02:00
Morris Jobke 2a2ab1b871
Merge pull request #9084 from nextcloud/public-page-template-extend
Public page template enhancements
2018-04-06 13:16:26 +02:00
Daniel Calviño Sánchez 50d35bee9f Add context classes to Composer autoload
In order to autoload the server context classes the "bootstrap"
directory was explicitly listed in Behat autoload configuration. This is
fine in the configuration of acceptance tests for the server, but it
would force the configuration of acceptance tests for the apps to
explicitly include the path for the server context classes to be able to
use them (for example, for the login step).

Besides with its own configuration Behat also supports autoloading
classes using Composer, so now context classes are autoloaded using
Composer instead; thanks to this the server context classes are
autoloaded also in the acceptance tests for apps without any explicit
configuration in them.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-04-06 04:13:42 +02:00
Roeland Jago Douma 176b4d6832
Ping more privacy respecting organizations
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-04-05 21:43:51 +02:00
Julius Härtl 5598d30ef1
Fix files acceptance test
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-04-05 21:10:33 +02:00
Julius Härtl bbeb3402b6
Move styling and menu handling to publicpage.js
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2018-04-05 12:21:39 +02:00
Roeland Jago Douma 73e6eea57e
Fix tests
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-04-04 12:50:54 +02:00
Björn Schießle c3900c9d0d
Merge pull request #9018 from nextcloud/fix-copy-encrypted-files
reset encryptionVersion to '1' if a file was stream copied
2018-04-03 18:24:27 +02:00
Bjoern Schiessle a0923d9ffb
reset encryptionVersion to '1' if a file was stream copied, because this means that we basically write the file from scratch
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
2018-04-03 18:01:23 +02:00
John Molakvoæ (skjnldsv) 1d7b14dfb1
Use app version to generate scss filename
Fixed scsscacher tests

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-03-28 08:33:46 +02:00
Daniel Calviño Sánchez c5cc1d80e6 Fix typo
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-27 16:48:19 +02:00
Roeland Jago Douma af31fa82e8
Fix test
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-22 12:06:45 +01:00
Morris Jobke f843b7edfe
Merge pull request #8506 from nextcloud/use-appmanager
Use isInstalled of AppManger instead of reimplement it
2018-03-22 09:55:19 +01:00
Morris Jobke 514de5dfa1
Use isInstalled of AppManger instead of reimplement it
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-03-21 11:34:18 +01:00
Morris Jobke 934eade56f
Migrate tests for contacts manager to correct test class
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-03-21 10:43:18 +01:00
Morris Jobke c8340ace5c
Merge pull request #7904 from nextcloud/fix_7224
Add Cache-control: immutable
2018-03-21 08:27:09 +01:00
Joas Schilling ec1e039790
Show EOL warning in the update section
Signed-off-by: Joas Schilling <coding@schilljs.com>
2018-03-20 15:52:30 +01:00
Roeland Jago Douma 796b4f19f8
Add Cache-control: immutable
Cache generated CSS forever!
Also cache combined JS forever
Fix tests

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-19 14:21:53 +01:00
Roeland Jago Douma 1088068c60
Remove \OCP\Files::tmpFolder
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-19 10:54:39 +01:00
Roeland Jago Douma 47a3008141
Remove \OCP\Files::tmpFile
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-19 10:52:35 +01:00
blizzz 208e38e84e
Merge pull request #8255 from nextcloud/bugfix/noid/group-display-name
Full implement group display names
2018-03-15 12:07:30 +01:00
Morris Jobke 8d4b76c0e2
Remove deprecated OCP\Contacts
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-03-14 10:47:09 +01:00
Roeland Jago Douma 7785c3752f
Remove deprecated HTTPHelper
* Remove the HTTP Helper
* Remove from Server Containter
* Removed legacy share tests that use it

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-13 21:54:56 +01:00
Morris Jobke 57eaa48e3d
Merge pull request #8788 from nextcloud/cleanup-oc_api
Remove unused methods and constants from legacy OC_API
2018-03-13 08:52:24 +01:00
Morris Jobke a1232f46ca
Remove unused methods and constants from legacy OC_API
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-03-12 18:03:25 +01:00
Morris Jobke 2b335fd607
Use insertIfNotExist of the new interface
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-03-12 17:45:49 +01:00
Morris Jobke 432e529827
Merge pull request #8784 from nextcloud/remove-unused-deprecated-apphelper
Remove unused and deprecated class and interface AppHelper
2018-03-12 16:33:46 +01:00
Morris Jobke f5c5c5181f
Remove unused and deprecated class and interface AppHelper
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-03-12 15:27:10 +01:00
Morris Jobke 44289ff134
Use proper method to format absolute timestamp
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
2018-03-12 15:16:52 +01:00
Roeland Jago Douma af89db3407
Merge pull request #8743 from nextcloud/strict_settings
Strict settings
2018-03-12 12:37:03 +01:00
John Molakvoæ (skjnldsv) 3d99a9d24e Header acceptance features
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
2018-03-09 14:33:22 +01:00
Roeland Jago Douma 7fc85bbf78
Obsolete test
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2018-03-09 14:10:20 +01:00
blizzz 054a45c079
Merge pull request #8710 from nextcloud/followup/8596/tests-for-user-pagination
Tests for email collaborators pagination
2018-03-09 11:21:21 +01:00
Daniel Calviño Sánchez 15c12eb027 Add acceptance tests for creation of subfolders in public shared folders
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-09 03:37:08 +01:00
Daniel Calviño Sánchez 1a2d9a2fdd Extract common "wait for" functions to a helper class
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-09 03:37:08 +01:00
Daniel Calviño Sánchez fcd6cf08e0 Generalize file list steps so a specific ancestor can be used
The "FileListContext" provides steps to interact with and check the
behaviour of a file list. However, the "FileListContext" does not know
the right file list ancestor that has to be used by the file list steps,
so until now the file list steps were explicitly wired to the Files app
and they could be used only in that case.

Instead of duplicating the steps with a slightly different name (for
example, "I create a new folder named :folderName in the public shared
folder" instead of "I create a new folder named :folderName") the steps
were generalized; now contexts that "know" that certain file list
ancestor has to be used by the FileListContext steps performed by
certain actor from that point on (until changed again) set it
explicitly. For example, when the current page is the Files app then the
ancestor of the file list is the main view of the current section of the
Files app, but when the current page is a shared link then the ancestor
is set to null (because there will be just one file list, and thus its
ancestor is not relevant to differentiate between instances)

A helper trait, "FileListAncestorSetter", was introduced to reduce the
boilerplate needed to set the file list ancestor from other contexts.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-09 03:37:08 +01:00
Daniel Calviño Sánchez 766135cb64 Generalize file list locators so a specific ancestor can be used
The file list is used in other places besides the Files app (for
example, the File sharing app); in those cases the locators for the file
list elements are the same, but not for the ancestor of the file list.
To make possible to reuse the file list locators in those cases too now
they receive the ancestor to use.

Note that the locators for the file actions menu were not using an
ancestor locator because it is expected that there is only one file
actions menu at a time in the whole page; that may change in the future,
but for the time being it is a valid assumption and thus the ancestor
was not added to those locators in this commit.

Although the locators were generalized the steps themselves still use
the "FilesAppContext::currentSectionMainView" locator as ancestor; the
steps will be generalized in a following commit.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-09 03:37:08 +01:00
Daniel Calviño Sánchez 10490f2ac3 Store the name of the actor in the Actor object
This is needed to be able to easily use the actor as a key in an array.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-09 03:37:08 +01:00
Daniel Calviño Sánchez 49f2ba16f0 Extract file list locators and steps to its own class
Besides the extraction some minor adjustments (sorting locators for file
action menu entries to reflect the order of the menu entries in the UI,
moving parametrized locators like "createMenuItemFor" above the locators
that use them and placing "descendantOf" calls always in a new line)
were made too.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
2018-03-09 03:37:08 +01:00
Roeland Jago Douma 1329061d31
Merge pull request #8648 from nextcloud/feature/csrf-token-controller
Use session heartbeat to update CSRF token
2018-03-08 21:15:24 +01:00