summaryrefslogtreecommitdiffstats
path: root/tests/acceptance
Commit message (Collapse)AuthorAgeFilesLines
* Add acceptance tests for opening a section in the Files appDaniel Calviño Sánchez2018-10-232-0/+88
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Include empty directories in the default state of acceptance testsDaniel Calviño Sánchez2018-09-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Add acceptance tests for creation of subfolders in public shared foldersDaniel Calviño Sánchez2018-03-093-0/+121
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Extract common "wait for" functions to a helper classDaniel Calviño Sánchez2018-03-093-46/+86
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Generalize file list steps so a specific ancestor can be usedDaniel Calviño Sánchez2018-03-094-3/+115
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Generalize file list locators so a specific ancestor can be usedDaniel Calviño Sánchez2018-03-092-54/+66
| | | | | | | | | | | | | | | | | | | | 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>
* Store the name of the actor in the Actor objectDaniel Calviño Sánchez2018-03-092-3/+19
| | | | | | 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>
* Extract file list locators and steps to its own classDaniel Calviño Sánchez2018-03-093-250/+288
| | | | | | | | | | 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>
* Add automatic handling of NoSuchElement exceptionsDaniel Calviño Sánchez2018-03-091-6/+16
| | | | | | | | | | | | NoSuchElement exceptions are sometimes thrown instead of StaleElementReference exceptions. This can happen when the Selenium2 driver for Mink performs an action on an element through the WebDriver session instead of directly through the WebDriver element. In that case, if the element with the given ID does not exist, a NoSuchElement exception would be thrown instead of a StaleElementReference exception, so those cases are handled like StaleElementReference exceptions. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add automatic handling of MoveTargetOutOfBounds exceptionsDaniel Calviño Sánchez2018-03-091-3/+17
| | | | | | | | | | | | | | | | | | MoveTargetOutOfBounds exceptions are sometimes thrown instead of ElementNotVisible exceptions. This can happen when the Selenium2 driver for Mink moves the cursor on an element using the "moveto" method of the Webdriver session, for example, before clicking on an element. In that case, if the element is not visible, "moveto" would throw a MoveTargetOutOfBounds exception instead of an ElementNotVisible exception, so those cases are handled like ElementNotVisible exceptions. Note that MoveTargetOutOfBounds exceptions could be thrown too if the element was visible but "out of reach"; there is no problem in handling those cases as if the element was not visible, as the exception will be thrown again anyway once it is verified that the element is indeed visible. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Take into account the comment message when looking for itDaniel Calviño Sánchez2018-02-162-24/+17
| | | | | | | | Instead of checking that the list contains one comment it is now checked that a comment with certain message is visible. This makes the step (and the locator) more reusable in future tests and also simplifies the code. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Adjust timeouts in the step to create a new commentDaniel Calviño Sánchez2018-02-161-2/+2
| | | | | | | | | | | | | Depending on the previous steps the new comment field may be already shown or not when the step to create a new comment is executed. Therefore, the timeout was increased from 2 to the "standard" 10 seconds used in other tests. If the new comment field was found there is no need to use a timeout when looking for the new comment button; it is either there or not, it will not appear after some time. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Move locators above step definitionsDaniel Calviño Sánchez2018-02-161-21/+26
| | | | | | | | | The locators are moved above the step definitions for consistency with other context files; besides that I made some minor adjustments for consistency too in the locator descriptions and identation, and moved the locators for ".newCommentRow" descendants together. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Merge pull request #7650 from rpirritano/masterMorris Jobke2018-01-111-1/+1
|\ | | | | made small changes to login screen
| * made small changes to login screenRobert Pirritano2018-01-111-1/+1
| | | | | | | | | | | | added height back 70px back to footer and removed .htaccess file Signed-off-by: Robert R Pirritano <rpirritano@gmail.com>
* | Add acceptance test for renaming a file with the details view openDaniel Calviño Sánchez2018-01-112-0/+57
|/ | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Wait for the shared link to be set in the acceptance testsDaniel Calviño Sánchez2017-12-221-1/+24
| | | | | | | | | | | | | | | | | When clicking on "Share link" in the "Sharing" tab of the Files app an input field with the link appears. That input field already exists in the DOM, although empty, before clicking on "Share link", and when that is done the proper value is set and then the input field is shown. In the acceptance tests "getValue()" can return the value of hidden elements too, so as long as an element exists its value is returned without waiting for the field to be visible. Due to this if the test code runs too fast the "I write down the shared link" step could be executed before the proper value was set, so the shared link got in that case would be an empty value, and this would lead to failures when the following steps were executed. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add missing timeout multiplierDaniel Calviño Sánchez2017-12-221-2/+6
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Fix typo in callback nameDaniel Calviño Sánchez2017-12-221-2/+2
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add acceptance test for opening the menu in a public shared linkDaniel Calviño Sánchez2017-12-192-0/+95
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Allows adding of hex color to the theme-colorAbijeet2017-12-082-29/+33
| | | | | | | | | | | | | | | | Fixes #7158. Adds a # on the color if missing. Increased maxlength, added hash:true for jscolor, and adding a # if not present on the change event. Since the input element now allows a hex code, changed values to hexcode. In addition, added a function to get RGB array from hex or rgb values. Calling it in both methods and using it to perform comparison. Also changed the way we were determining whether the jscolor component had loaded. Changed the control to use data-jscolor rather than defining opts in the class. Signed-off-by: Abijeet <abijeetpatro@gmail.com>
* Fix acceptance testJohn Molakvoæ (skjnldsv)2017-11-081-1/+1
| | | | Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
* Merge branch 'master' into autocomplete-guiArthur Schiwon2017-11-013-8/+58
|\
| * bump acceptance test suite to use php 7.1 imageArthur Schiwon2017-10-311-1/+1
| | | | | | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
| * Solve acceptance test failure due to clicks on covered elementsDaniel Calviño Sánchez2017-10-192-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Firefox and Chrome drivers for Selenium refuse to click on an element if the point to be clicked is covered by a different element, throwing an UnknownError exception with message "Element is not clickable at point ({x}, {y}). Other element would receive the click: {element}". Although in general that would be a legit error (as the user would not be able to click on the element) due to a bad layout, sometimes this can be just a temporal issue caused by an animation, in which case there would be no problem once the animation finished and the elements are all in their final location. Unfortunately, automatically handling those situations in which the problem is caused by an animation by just retrying a few times if the element to be clicked is covered before giving up would probably cause confusion instead of easing test writing. The reason is that if the center of the element is covered by another one the Firefox driver for Selenium tries to click on the corners of the element instead. The problem is that the coordinates used for the click are integer values, but Firefox has sub-pixel accuracy, so sometimes (depending on which corner is not covered and whether the left, top, width or height properties of the element to be clicked have a decimal component or not) the clicks silently land on a different HTML element (and that is with squared borders; with round borders they always land on a different HTML element. That was partially addressed for Selenium 3.0 by clicking first on the edges, but it would still fail if the middle point of the edges is covered but not the corners). It is not possible to fix or even detect all that from the tests (except maybe with some extreme hacks involving accessing private PHP members from Mink and bypassing or replacing the standard JavaScript executed by the Firefox driver with a custom implementation...), so it is not possible to ensure that clicks during an animation will land on the right element (in fact it is not possible even on static elements, although except when the layout is wrong there should be no problem); sometimes retrying a click when the element is covered would solve the problem, sometimes it would cause a different element to be clicked (and sometimes there would be even no retry, as the first click would have silently landed on a different element than the expected one). Therefore, a different approach must be used. Instead of trying to automatically handle clicks during animations the tests must be written being aware of the problem and thus waiting somehow for the animations that can cause a problem to end before performing the clicks. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Replace inline favorite action with just a favorite iconDaniel Calviño Sánchez2017-10-191-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a preparatory step for a following commit in which the position of the favorite icon and the checkbox will be swapped; in that new design the favorite icon is no longer expected to be an action but just a simple mark on whether the file is favorited or not (the action is expected to be triggered then only from the file actions menu). The favorite icon is now fully shown or completely hidden depending on whether the file is favorited or not. As the icon is just informative but no longer an action now it does not change when hovered or focus. In the same way, the alternative text when the file is not favorited now it is not "Favorite" (an action) but "Not favorited" instead. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Update acceptance tests to favorite files through the file actions menuDaniel Calviño Sánchez2017-10-191-2/+20
| | | | | | | | | | | | | | | | | | Currently a file can be favorited either through the inline action or through the file actions menu. However, the inline action will be removed in a following commit and then it will be possible to do it only through the file actions menu. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* | add acceptance testsArthur Schiwon2017-10-283-0/+91
|/ | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Add acceptance tests for setting the color in the Theming appDaniel Calviño Sánchez2017-08-103-0/+178
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add getter for the timeout multiplierDaniel Calviño Sánchez2017-08-101-0/+9
| | | | | | | | | In some cases the acceptance tests have to explicitly wait for something to happen without using the "find" method from the actor; in those cases the timeout multiplier needs to be taken into account too, so the test cases must be able to retrieve it from the actor. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add option to acceptance test runner to set the Selenium serverDaniel Calviño Sánchez2017-07-201-1/+40
| | | | | | | | By default "127.0.0.1:4444" is used, so nothing needs to be set when the acceptance tests and the Selenium server share the same network (like when called by "run.sh"). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add option to acceptance test runner to set the Nextcloud server domainDaniel Calviño Sánchez2017-07-202-1/+45
| | | | | | | | | | | | By default "127.0.0.1" is used, so nothing needs to be set when the Selenium server and the Nextcloud test server share the same network (like when called by "run.sh"). Besides passing the domain to the acceptance tests the Nextcloud test server configuration must be modified to see the given domain as a trusted domain; otherwise the access would be forbidden. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Make possible to configure the domain for the Nextcloud test serverDaniel Calviño Sánchez2017-07-201-6/+16
| | | | | | | | | | | | | The NextcloudTestServerLocalHelper started the PHP built-in web server for the Nextcloud test server at 127.0.0.1; as the Selenium server has to access the Nextcloud test server they were forced to share the same network. Now, the domain at which the PHP built-in web server is started can be specified when the NextcloudTestServerLocalHelper is created, which removes the need of sharing the same network, as the Selenium server now can access the Nextcloud test server at an arbitrary domain. However, by default "127.0.0.1" is still used if no domain is given. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add acceptance tests for unselecting items in dropdown for tagsDaniel Calviño Sánchez2017-07-104-0/+318
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Extract app navigation elements to its own contextDaniel Calviño Sánchez2017-07-083-39/+70
| | | | | | | | The app navigation is not exclusive to the Files app but a generic component used by other apps too, so its locators and steps should be in its own context. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Fix typoDaniel Calviño Sánchez2017-07-081-2/+2
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add acceptance tests for sorting of favorite filesDaniel Calviño Sánchez2017-07-052-0/+105
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* try to lower the timeout in an acceptance testArthur Schiwon2017-06-261-1/+1
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* fix typos and unnecessary white spacesArthur Schiwon2017-06-262-5/+4
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Fix and extend acceptance testsArthur Schiwon2017-06-233-6/+55
| | | | Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
* Extract duplicated code to a methodDaniel Calviño Sánchez2017-06-091-28/+15
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add acceptance tests for showing the input field for tagsDaniel Calviño Sánchez2017-06-092-0/+123
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Update acceptance tests for issue #4921Daniel Calviño Sánchez2017-05-211-1/+10
| | | | | | | | | Acceptance tests opened the details view by clicking on the middle of the file row, but due to the changes made in issue #4921 that now opens the file instead; this commit updates the acceptance tests to open the details view through the "Details" item in the file actions menu. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add automatic handling of common command failures of Mink elementsDaniel Calviño Sánchez2017-05-063-2/+315
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commands executed on Mink elements may fail for several reasons. ElementWrapper is introduced to automatically handle some of those situations, like StaleElementReference exceptions and ElementNotVisible exceptions. StaleElementReference exceptions are thrown when the command is executed on an element that is no longer attached to the DOM. When that happens the ElementWrapper finds again the element and executes the command again on the new element. ElementNotVisible exceptions are thrown when the command requires the element to be visible but the element is not. When that happens the ElementWrapper waits for the element to be visible before executing the command again. These changes are totally compatible with the current acceptance tests. They just make the tests more robust, but they do not change their behaviour. In fact, this should minimize some of the sporadic failures in the acceptance tests caused by their concurrent nature with respect to the web browser executing the commands. However, the ElementWrapper is not a silver bullet; it handles the most common situations, but it does not handle every possible scenario. For example, the acceptance tests would still fail sporadically if an element can become staled several times in a row (uncommon) or if it does not become visible before the timeout expires (which could still happen in a loaded system even if the components under test work right, but obviously it is not possible to wait indefinitely for them). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Extract element finding to a command objectDaniel Calviño Sánchez2017-05-062-78/+178
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Make internal find methods staticDaniel Calviño Sánchez2017-05-061-8/+10
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Add missing type hintsDaniel Calviño Sánchez2017-05-061-3/+3
| | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
* Merge pull request #4682 from ↵Morris Jobke2017-05-044-11/+96
|\ | | | | | | | | nextcloud/try-to-start-browser-sessions-again-when-they-fail-in-acceptance-tests Try to start browser sessions again when they fail in acceptance tests
| * Add option to acceptance test runners to set a custom timeout multiplierDaniel Calviño Sánchez2017-05-032-1/+48
| | | | | | | | Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
| * Try again to start browser sessions when they failDaniel Calviño Sánchez2017-05-031-1/+27
| | | | | | | | | | | | | | | | | | Starting a session for an Actor can fail, typically, due to a timeout connecting with the web browser. Now if the session fails to start it will be tried again up to "actorTimeoutMultiplier" times in total before giving up. Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>