Skip to content

Commit

Permalink
added test to check for incremented number in bracket while adding ne…
Browse files Browse the repository at this point in the history
…w account and folder in ocis
  • Loading branch information
PrajwolAmatya committed Jun 20, 2024
1 parent 1212281 commit 9a8e626
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def isVFSOptionChecked():
)

@staticmethod
def get_local_download_foldername():
def get_local_sync_path():
return str(
squish.waitForObjectExists(
AccountConnectionWizard.SELECT_LOCAL_FOLDER
Expand Down
9 changes: 7 additions & 2 deletions test/gui/shared/scripts/pageObjects/SyncConnectionWizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,11 @@ def syncSpace(spaceName):
)
SyncConnectionWizard.addSyncConnection()

@staticmethod
def select_space_to_sync(space_name):
SyncConnectionWizard.selectSpaceToSync(space_name)
SyncConnectionWizard.nextStep()

@staticmethod
def create_folder_in_remote_destination(folder_name):
squish.clickButton(
Expand Down Expand Up @@ -358,13 +363,13 @@ def is_remote_folder_selected(folder_selector):
return squish.waitForObjectExists(folder_selector).selected

@staticmethod
def click_on_add_button_to_sync():
def open_sync_connection_wizard():
squish.clickButton(
squish.waitForObject(SyncConnectionWizard.ADD_FOLDER_SYNC_BUTTON)
)

@staticmethod
def get_default_local_sync_folder():
def get_local_sync_path():
return str(
squish.waitForObjectExists(
SyncConnectionWizard.CHOOSE_LOCAL_SYNC_FOLDER
Expand Down
25 changes: 12 additions & 13 deletions test/gui/shared/steps/account_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,7 @@ def step(context, accountType):
waitForInitialSyncToComplete(getResourcePath('/', account_details["user"], space))


@When('the user adds the following wrong user credentials:')
def step(context):
account_details = getClientDetails(context)
AccountConnectionWizard.addUserCreds(
account_details['user'], account_details['password']
)


@When('the user adds the following user credentials:')
@When(r'the user adds the following(?: wrong)? user credentials:', regexp=True)
def step(context):
account_details = getClientDetails(context)
AccountConnectionWizard.addUserCreds(
Expand Down Expand Up @@ -295,10 +287,17 @@ def step(context):
Toolbar.quit_owncloud()


@Then('the default local download directory should be "|any|"')
def step(context, local_directory):
@Then(
r'the default local sync path should be "([^"]*)" in the (configuration|sync connection) wizard',
regexp=True,
)
def step(context, sync_path, wizard):
test.compare(
local_directory,
AccountConnectionWizard.get_local_download_foldername(),
sync_path,
(
AccountConnectionWizard.get_local_sync_path()
if wizard == 'configuration'
else SyncConnectionWizard.get_local_sync_path()
),
"Default local download directory should have bracket with incremented number",
)
2 changes: 1 addition & 1 deletion test/gui/shared/steps/file_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ def step(context, username, source):
shutil.copy2(source_dir, destination_dir)


@Given('folder "|any|" has been created in local system')
@Given('folder "|any|" has been created in the local sync path')
def step(context, folder_name):
folder_path = join(get_config('clientRootSyncPath'), folder_name)
os.makedirs(prefix_path_namespace(folder_path))
18 changes: 7 additions & 11 deletions test/gui/shared/steps/sync_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ def step(context, spaceName):
SyncConnectionWizard.syncSpace(spaceName)


@When('the user selects the "|any|" space to sync')
def step(context, space_name):
SyncConnectionWizard.select_space_to_sync(space_name)


@Then('the settings tab should have the following options in the general section:')
def step(context):
for item in context.table:
Expand Down Expand Up @@ -273,15 +278,6 @@ def step(context, folder_name, selected):
)


@When("the user selects the add folder to sync button")
@When("the user opens the sync connection wizard")
def step(context):
SyncConnectionWizard.click_on_add_button_to_sync()


@Then('the default local sync folder should be "|any|"')
def step(context, sync_directory):
test.compare(
sync_directory,
SyncConnectionWizard.get_default_local_sync_folder(),
"Default sync directory should have bracket with incremented number",
)
SyncConnectionWizard.open_sync_connection_wizard()
26 changes: 21 additions & 5 deletions test/gui/tst_addAccount/test.feature
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,33 @@ Feature: adding accounts
And the user syncs the "Personal" space
Then the folder "simple-folder" should exist on the file system

@skipOnOCIS
Scenario: Check for incremented number in bracket while adding new account and folder (OC10)
Given folder "ownCloud" has been created in the local sync path
And the user has started the client
And the user has entered the following account information:
| server | %local_server% |
When the user adds the following user credentials:
| user | Alice |
| password | 1234 |
And the user opens the advanced configuration
Then the default local sync path should be "/tmp/owncloudtest/ownCloud (2)" in the configuration wizard
When the user selects download everything option in advanced section
And the user opens the sync connection wizard
Then the default local sync path should be "/tmp/owncloudtest/ownCloud (2) (2)" in the sync connection wizard

Scenario: Check for incremented number in bracket while adding new account and folder
Given folder "ownCloud" has been created in local system
@skipOnOC10
Scenario: Check for incremented number in bracket while adding new account and folder (oCIS)
Given folder "ownCloud" has been created in the local sync path
And the user has started the client
And the user has entered the following account information:
| server | %local_server% |
When the user adds the following user credentials:
| user | Alice |
| password | 1234 |
And the user opens the advanced configuration
Then the default local download directory should be "/tmp/owncloudtest/ownCloud (2)"
Then the default local sync path should be "/tmp/owncloudtest/ownCloud (2)" in the configuration wizard
When the user selects download everything option in advanced section
And the user selects the add folder to sync button
Then the default local sync folder should be "/tmp/owncloudtest/ownCloud (2) (2)"
And the user opens the sync connection wizard
And the user selects the "Personal" space to sync
Then the default local sync path should be "/tmp/owncloudtest/ownCloud (2)/Personal (2)" in the sync connection wizard

0 comments on commit 9a8e626

Please sign in to comment.