summaryrefslogtreecommitdiffstats
path: root/tests/acceptance/features
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2018-10-19 20:34:19 +0200
committerDaniel Calviño Sánchez <danxuliu@gmail.com>2018-10-23 17:31:01 +0200
commit3fbb6e70344116ef3b11c1f8114e8613f3172539 (patch)
tree7ac98424beffbb557f38a5f77fca8edd5c64c1f3 /tests/acceptance/features
parentbc7e8cb362e7bff43bc77689b8c040c38015c189 (diff)
downloadnextcloud-server-3fbb6e70344116ef3b11c1f8114e8613f3172539.tar.gz
nextcloud-server-3fbb6e70344116ef3b11c1f8114e8613f3172539.zip
Add acceptance tests for opening a section in the Files app
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests/acceptance/features')
-rw-r--r--tests/acceptance/features/app-files.feature72
-rw-r--r--tests/acceptance/features/bootstrap/FileListContext.php16
2 files changed, 88 insertions, 0 deletions
diff --git a/tests/acceptance/features/app-files.feature b/tests/acceptance/features/app-files.feature
index 7ca7a42e9e6..7446376751c 100644
--- a/tests/acceptance/features/app-files.feature
+++ b/tests/acceptance/features/app-files.feature
@@ -23,6 +23,78 @@ Feature: app-files
When I open the details view for "welcome.txt"
Then I see that the details view for "All files" section is open
+ Scenario: show recent files
+ Given I am logged in
+ And I create a new folder named "Folder just created"
+ When I open the "Recent" section
+ Then I see that the current section is "Recent"
+ Then I see that the file list contains a file named "Folder just created"
+
+ Scenario: show recent files for a second time
+ Given I am logged in
+ And I open the "Recent" section
+ And I see that the current section is "Recent"
+ And I open the "All files" section
+ And I see that the current section is "All files"
+ And I create a new folder named "Folder just created"
+ When I open the "Recent" section
+ Then I see that the current section is "Recent"
+ Then I see that the file list contains a file named "Folder just created"
+
+ Scenario: show favorites
+ Given I am logged in
+ And I mark "welcome.txt" as favorite
+ When I open the "Favorites" section
+ Then I see that the current section is "Favorites"
+ Then I see that the file list contains a file named "welcome.txt"
+
+ Scenario: show favorites for a second time
+ Given I am logged in
+ And I open the "Favorites" section
+ And I see that the current section is "Favorites"
+ And I open the "All files" section
+ And I see that the current section is "All files"
+ And I mark "welcome.txt" as favorite
+ When I open the "Favorites" section
+ Then I see that the current section is "Favorites"
+ Then I see that the file list contains a file named "welcome.txt"
+
+ Scenario: show shares
+ Given I am logged in
+ And I share the link for "welcome.txt"
+ When I open the "Shared by link" section
+ Then I see that the current section is "Shared by link"
+ Then I see that the file list contains a file named "welcome.txt"
+
+ Scenario: show shares for a second time
+ Given I am logged in
+ And I open the "Shared by link" section
+ And I see that the current section is "Shared by link"
+ And I open the "All files" section
+ And I see that the current section is "All files"
+ And I share the link for "welcome.txt"
+ When I open the "Shared by link" section
+ Then I see that the current section is "Shared by link"
+ Then I see that the file list contains a file named "welcome.txt"
+
+ Scenario: show deleted files
+ Given I am logged in
+ And I delete "welcome.txt"
+ When I open the "Deleted files" section
+ Then I see that the current section is "Deleted files"
+ Then I see that the file list contains a file named "welcome.txt"
+
+ Scenario: show deleted files for a second time
+ Given I am logged in
+ And I open the "Deleted files" section
+ And I see that the current section is "Deleted files"
+ And I open the "All files" section
+ And I see that the current section is "All files"
+ And I delete "welcome.txt"
+ When I open the "Deleted files" section
+ Then I see that the current section is "Deleted files"
+ Then I see that the file list contains a file named "welcome.txt"
+
Scenario: rename a file with the details view open
Given I am logged in
And I open the details view for "welcome.txt"
diff --git a/tests/acceptance/features/bootstrap/FileListContext.php b/tests/acceptance/features/bootstrap/FileListContext.php
index bc225e3f9b1..6a39d7a999f 100644
--- a/tests/acceptance/features/bootstrap/FileListContext.php
+++ b/tests/acceptance/features/bootstrap/FileListContext.php
@@ -255,6 +255,13 @@ class FileListContext implements Context, ActorAwareInterface {
}
/**
+ * @return Locator
+ */
+ public static function deleteMenuItem() {
+ return self::fileActionsMenuItemFor("Delete");
+ }
+
+ /**
* @Given I create a new folder named :folderName
*/
public function iCreateANewFolderNamed($folderName) {
@@ -323,6 +330,15 @@ class FileListContext implements Context, ActorAwareInterface {
}
/**
+ * @When I delete :fileName
+ */
+ public function iDelete($fileName) {
+ $this->actor->find(self::fileActionsMenuButtonForFile($this->fileListAncestor, $fileName), 10)->click();
+
+ $this->actor->find(self::deleteMenuItem(), 2)->click();
+ }
+
+ /**
* @Then I see that the file list is eventually loaded
*/
public function iSeeThatTheFileListIsEventuallyLoaded() {