From c2e2723441fc2a98b63924a2e4deeeadda4f9013 Mon Sep 17 00:00:00 2001 From: Asmitapaudel Date: Tue, 2 Jun 2026 14:35:50 +0545 Subject: [PATCH] test(delete): Delete multiple files --- .../delete-files-folders/delete.feature | 6 ++--- test/gui/steps/file_context.py | 3 +-- test/gui/steps/server_context.py | 22 +++++++++---------- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/test/gui/features/delete-files-folders/delete.feature b/test/gui/features/delete-files-folders/delete.feature index f2f3dbffc..79cb1e3aa 100644 --- a/test/gui/features/delete-files-folders/delete.feature +++ b/test/gui/features/delete-files-folders/delete.feature @@ -17,7 +17,7 @@ Feature: deleting files and folders | fileName | | textfile0.txt | | textfile0-with-name-more-than-20-characters | - | ~`!@#$^&()-_=+{[}];',textfile.txt | + | ~`!@#$^&()-_=+{[}];',textfile.txt | @issue-9439 @smoke Scenario Outline: Delete a folder @@ -46,7 +46,7 @@ Feature: deleting files and folders And as "Alice" file "textfile2.txt" should exist in the server And as "Alice" folder "test-folder2" should exist in the server - @skip + Scenario: Delete multiple files Given user "Alice" has uploaded the following files to the server | file | content | @@ -65,7 +65,7 @@ Feature: deleting files and folders | textfile1.txt | And as "Alice" file "textfile2.txt" should exist in the server - @skip + Scenario Outline: Create and delete a file with special characters Given user "Alice" has set up a client with default settings When user "Alice" creates a file "" with the following content inside the sync folder diff --git a/test/gui/steps/file_context.py b/test/gui/steps/file_context.py index e99f38130..7de6b18bb 100644 --- a/test/gui/steps/file_context.py +++ b/test/gui/steps/file_context.py @@ -447,8 +447,7 @@ def step(context, resource_name, destination): @When('the user deletes the following files') def step(context): wait_for_client_to_be_ready() - - for row in context.table[1:]: + for row in context.table: filename = row[0] deleteResource(filename, 'file') diff --git a/test/gui/steps/server_context.py b/test/gui/steps/server_context.py index ef21698a6..1b22d5d05 100644 --- a/test/gui/steps/server_context.py +++ b/test/gui/steps/server_context.py @@ -115,23 +115,21 @@ def step(context, user_name, server_file_name, local_file_name): ) -@Then( - r'as "([^"].*)" following files should not exist in the server', - regexp=True, -) +@Then('as "{user_name}" following files should not exist in the server',) def step(context, user_name): - for row in context.table[1:]: + for row in context.table: resource_name = row[0] - test.compare( - webdav.resource_exists(user_name, resource_name), - False, - f"Resource '{resource_name}' should not exist, but does", - ) + resource_exists = webdav.resource_exists(user_name, resource_name) + with ensure( + f"Resource '{resource_name}' should not exist, but it does", + ): + resource_exists.should.be.false + -@Given('user "|any|" has uploaded the following files to the server') +@Given('user "{user}" has uploaded the following files to the server') def step(context, user): - for row in context.table[1:]: + for row in context.table: file_name = row[0] file_content = row[1] webdav.create_file(user, file_name, file_content)