diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-08-10 19:39:08 +0200 |
---|---|---|
committer | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-08-10 23:47:56 +0200 |
commit | 376f46e4755202da15ed7b1721d2bff618c6564d (patch) | |
tree | 58ba92eb92601895da3b9c38cb6302771de65bf3 /tests/acceptance | |
parent | 631a1f917bdae6f5a79116a1fa2220a24a2fbfd4 (diff) | |
download | nextcloud-server-376f46e4755202da15ed7b1721d2bff618c6564d.tar.gz nextcloud-server-376f46e4755202da15ed7b1721d2bff618c6564d.zip |
fix: Move broken filepicker selenium tests to cypress
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'tests/acceptance')
-rw-r--r-- | tests/acceptance/features/app-files.feature | 64 | ||||
-rw-r--r-- | tests/acceptance/features/bootstrap/FilePickerContext.php | 10 |
2 files changed, 37 insertions, 37 deletions
diff --git a/tests/acceptance/features/app-files.feature b/tests/acceptance/features/app-files.feature index 793504443da..f9db7cc8465 100644 --- a/tests/acceptance/features/app-files.feature +++ b/tests/acceptance/features/app-files.feature @@ -204,38 +204,38 @@ Feature: app-files # And I see that the file list contains a file named "Folder" # And I see that the file list contains a file named "Not selected folder" - Scenario: copy a file in its same folder - Given I am logged in - When I start the move or copy operation for "welcome.txt" - # No folder was explicitly selected, so the last selected folder is the - # current folder. - And I copy to the last selected folder in the file picker - Then I see that the file list contains a file named "welcome.txt" - And I see that the file list contains a file named "welcome (copy).txt" - - Scenario: copy a file twice in its same folder - Given I am logged in - And I start the move or copy operation for "welcome.txt" - # No folder was explicitly selected, so the last selected folder is the - # current folder. - And I copy to the last selected folder in the file picker - When I start the move or copy operation for "welcome.txt" - And I copy to the last selected folder in the file picker - Then I see that the file list contains a file named "welcome.txt" - And I see that the file list contains a file named "welcome (copy).txt" - And I see that the file list contains a file named "welcome (copy 2).txt" - - Scenario: copy a copy of a file in its same folder - Given I am logged in - And I start the move or copy operation for "welcome.txt" - # No folder was explicitly selected, so the last selected folder is the - # current folder. - And I copy to the last selected folder in the file picker - When I start the move or copy operation for "welcome (copy).txt" - And I copy to the last selected folder in the file picker - Then I see that the file list contains a file named "welcome.txt" - And I see that the file list contains a file named "welcome (copy).txt" - And I see that the file list contains a file named "welcome (copy 2).txt" +# Scenario: copy a file in its same folder +# Given I am logged in +# When I start the move or copy operation for "welcome.txt" +# # No folder was explicitly selected, so the last selected folder is the +# # current folder. +# And I copy to the last selected folder in the file picker +# Then I see that the file list contains a file named "welcome.txt" +# And I see that the file list contains a file named "welcome (copy).txt" +# +# Scenario: copy a file twice in its same folder +# Given I am logged in +# And I start the move or copy operation for "welcome.txt" +# # No folder was explicitly selected, so the last selected folder is the +# # current folder. +# And I copy to the last selected folder in the file picker +# When I start the move or copy operation for "welcome.txt" +# And I copy to the last selected folder in the file picker +# Then I see that the file list contains a file named "welcome.txt" +# And I see that the file list contains a file named "welcome (copy).txt" +# And I see that the file list contains a file named "welcome (copy 2).txt" +# +# Scenario: copy a copy of a file in its same folder +# Given I am logged in +# And I start the move or copy operation for "welcome.txt" +# # No folder was explicitly selected, so the last selected folder is the +# # current folder. +# And I copy to the last selected folder in the file picker +# When I start the move or copy operation for "welcome (copy).txt" +# And I copy to the last selected folder in the file picker +# Then I see that the file list contains a file named "welcome.txt" +# And I see that the file list contains a file named "welcome (copy).txt" +# And I see that the file list contains a file named "welcome (copy 2).txt" # Scenario: rename a file with the details view open # Given I am logged in diff --git a/tests/acceptance/features/bootstrap/FilePickerContext.php b/tests/acceptance/features/bootstrap/FilePickerContext.php index b9d82090eaa..bed0ee9e566 100644 --- a/tests/acceptance/features/bootstrap/FilePickerContext.php +++ b/tests/acceptance/features/bootstrap/FilePickerContext.php @@ -30,7 +30,7 @@ class FilePickerContext implements Context, ActorAwareInterface { * @return Locator */ public static function dialog() { - return Locator::forThe()->css(".oc-dialog")-> + return Locator::forThe()->css(".modal-container")-> describedAs("File picker dialog"); } @@ -38,7 +38,7 @@ class FilePickerContext implements Context, ActorAwareInterface { * @return Locator */ public static function fileListContainer() { - return Locator::forThe()->css("#oc-dialog-filepicker-content")-> + return Locator::forThe()->css(".file-picker__files")-> descendantOf(self::dialog())-> describedAs("File list container in the file picker dialog"); } @@ -49,7 +49,7 @@ class FilePickerContext implements Context, ActorAwareInterface { public static function rowForFile($fileName) { // File names in the file picker are split in two span elements, so // their texts need to be concatenated to get the full file name. - return Locator::forThe()->xpath("//*[@id = 'picker-filestable']//*[contains(concat(' ', normalize-space(@class), ' '), ' filename-parts ') and concat(span[1], span[2]) = '$fileName']/ancestor::tr")-> + return Locator::forThe()->xpath("//*[concat(span[1], span[2]) = '$fileName']/ancestor::tr")-> descendantOf(self::fileListContainer())-> describedAs("Row for file $fileName in the file picker dialog"); } @@ -58,7 +58,7 @@ class FilePickerContext implements Context, ActorAwareInterface { * @return Locator */ public static function buttonRow() { - return Locator::forThe()->css(".oc-dialog-buttonrow")-> + return Locator::forThe()->css(".dialog__actions")-> descendantOf(self::dialog())-> describedAs("Button row in the file picker dialog"); } @@ -69,7 +69,7 @@ class FilePickerContext implements Context, ActorAwareInterface { private static function buttonFor($buttonText) { // "Copy" and "Move" buttons text is set to "Copy to XXX" and "Move to // XXX" when a folder is selected. - return Locator::forThe()->xpath("//button[starts-with(normalize-space(), '$buttonText')]")-> + return Locator::forThe()->xpath("//button[contains(normalize-space(), '$buttonText')]")-> descendantOf(self::buttonRow())-> describedAs($buttonText . " button in the file picker dialog"); } |