From 779000eb139fb103d1cc3871115739d7f1beb5f7 Mon Sep 17 00:00:00 2001 From: Daniel Calviño Sánchez Date: Fri, 19 Oct 2018 20:34:19 +0200 Subject: Add acceptance tests for opening a section in the Files app MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Calviño Sánchez --- tests/acceptance/features/app-files.feature | 72 ++++++++++++++++++++++ .../features/bootstrap/FileListContext.php | 16 +++++ 2 files changed, 88 insertions(+) (limited to 'tests/acceptance') diff --git a/tests/acceptance/features/app-files.feature b/tests/acceptance/features/app-files.feature index 00f09900d3e..3bded3fef11 100644 --- a/tests/acceptance/features/app-files.feature +++ b/tests/acceptance/features/app-files.feature @@ -31,6 +31,78 @@ Feature: app-files When I open the details view for "welcome.txt" Then I see that the details view 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 "Shares" section + Then I see that the current section is "Shares" + 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 "Shares" section + And I see that the current section is "Shares" + 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 "Shares" section + Then I see that the current section is "Shares" + 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 @@ -254,6 +254,13 @@ class FileListContext implements Context, ActorAwareInterface { return self::fileActionsMenuItemFor("View in folder"); } + /** + * @return Locator + */ + public static function deleteMenuItem() { + return self::fileActionsMenuItemFor("Delete"); + } + /** * @Given I create a new folder named :folderName */ @@ -322,6 +329,15 @@ class FileListContext implements Context, ActorAwareInterface { $this->actor->find(self::viewFileInFolderMenuItem(), 2)->click(); } + /** + * @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 */ -- cgit v1.2.3