From 751c8ce21295fbcf63bfdaeb47d62eb48ed51016 Mon Sep 17 00:00:00 2001 From: prashant-gurung899 Date: Wed, 3 Jun 2026 11:50:39 +0545 Subject: [PATCH] enable edit and remove acc connection tests Signed-off-by: prashant-gurung899 --- test/gui/features/edit-files/edit.feature | 4 +--- .../removeAccountConnection.feature | 2 +- test/gui/steps/file_context.py | 4 ++-- test/gui/steps/server_context.py | 15 +++++++++------ 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/test/gui/features/edit-files/edit.feature b/test/gui/features/edit-files/edit.feature index 1de413b6f..cba497ac2 100644 --- a/test/gui/features/edit-files/edit.feature +++ b/test/gui/features/edit-files/edit.feature @@ -26,14 +26,12 @@ Feature: edit files And the user waits for file "testfile.txt" to be synced Then as "Alice" the file "testfile.txt" should have the content "overwrite openCloud test text file" in the server - @skip + Scenario Outline: Replace and modify the content of a file multiple times Given user "Alice" has set up a client with default settings And the user has copied file "" from outside the sync folder to "/" in the sync folder When the user copies file "" from outside the sync folder to "/" in the sync folder - And the user waits for the files to sync And the user copies file "" from outside the sync folder to "/" in the sync folder - And the user waits for the files to sync And the user copies file "" from outside the sync folder to "/" in the sync folder And the user waits for the files to sync Then as "Alice" the content of file "" in the server should match the content of local file "" diff --git a/test/gui/features/remove-account-connection/removeAccountConnection.feature b/test/gui/features/remove-account-connection/removeAccountConnection.feature index 39dd3d89e..3003bf68f 100644 --- a/test/gui/features/remove-account-connection/removeAccountConnection.feature +++ b/test/gui/features/remove-account-connection/removeAccountConnection.feature @@ -15,7 +15,7 @@ Feature: remove account connection Then "Brian" account should not be displayed But "Alice" account should be added - @skip + Scenario: remove the only account connection Given user "Alice" has been created in the server with default attributes And user "Alice" has created folder "large-folder" in the server diff --git a/test/gui/steps/file_context.py b/test/gui/steps/file_context.py index dc983f1b5..b80ceab28 100644 --- a/test/gui/steps/file_context.py +++ b/test/gui/steps/file_context.py @@ -429,7 +429,7 @@ def step(context, folder_name): @Given( - r'the user has copied file "([^"]*)" from outside the sync folder to "([^"]*)" in the sync folder', + 'the user has copied file "{resource_name}" from outside the sync folder to "{destination}" in the sync folder', regexp=True, ) def step(context, resource_name, destination): @@ -437,7 +437,7 @@ def step(context, resource_name, destination): @When( - r'the user copies file "([^"]*)" from outside the sync folder to "([^"]*)" in the sync folder', + 'the user copies file "{resource_name}" from outside the sync folder to "{destination}" in the sync folder', regexp=True, ) def step(context, resource_name, destination): diff --git a/test/gui/steps/server_context.py b/test/gui/steps/server_context.py index ef21698a6..8f5b60fa7 100644 --- a/test/gui/steps/server_context.py +++ b/test/gui/steps/server_context.py @@ -1,8 +1,12 @@ +import tempfile +from pathlib import Path + from behave import given as Given, then as Then from sure import ensure from helpers.api import provisioning, webdav_helper as webdav from helpers.TableParser import table_rows_hash +from helpers.FilesHelper import get_file_for_upload, get_document_content @Given('user "{user}" has been created in the server with default attributes') @@ -96,7 +100,7 @@ def step(context, user, file_name, destination): @Then( - 'as "|any|" the content of file "|any|" in the server should match the content of local file "|any|"' + 'as "{user_name}" the content of file "{server_file_name}" in the server should match the content of local file "{local_file_name}"' ) def step(context, user_name, server_file_name, local_file_name): raw_server_content = webdav.get_file_content(user_name, server_file_name) @@ -108,11 +112,10 @@ def step(context, user_name, server_file_name, local_file_name): server_content = get_document_content(tmp_file.name) local_content = get_document_content(get_file_for_upload(local_file_name)) - test.compare( - server_content, - local_content, - f"Server file '{server_file_name}' differs from local file '{local_file_name}'", - ) + with ensure( + f"Server file '{server_file_name}' differs from local file '{local_file_name}'", + ): + assert server_content == local_content @Then(