Skip to content

Commit 9a8e626

Browse files
committed
added test to check for incremented number in bracket while adding new account and folder in ocis
1 parent 1212281 commit 9a8e626

File tree

6 files changed

+49
-33
lines changed

6 files changed

+49
-33
lines changed

test/gui/shared/scripts/pageObjects/AccountConnectionWizard.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ def isVFSOptionChecked():
352352
)
353353

354354
@staticmethod
355-
def get_local_download_foldername():
355+
def get_local_sync_path():
356356
return str(
357357
squish.waitForObjectExists(
358358
AccountConnectionWizard.SELECT_LOCAL_FOLDER

test/gui/shared/scripts/pageObjects/SyncConnectionWizard.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,11 @@ def syncSpace(spaceName):
300300
)
301301
SyncConnectionWizard.addSyncConnection()
302302

303+
@staticmethod
304+
def select_space_to_sync(space_name):
305+
SyncConnectionWizard.selectSpaceToSync(space_name)
306+
SyncConnectionWizard.nextStep()
307+
303308
@staticmethod
304309
def create_folder_in_remote_destination(folder_name):
305310
squish.clickButton(
@@ -358,13 +363,13 @@ def is_remote_folder_selected(folder_selector):
358363
return squish.waitForObjectExists(folder_selector).selected
359364

360365
@staticmethod
361-
def click_on_add_button_to_sync():
366+
def open_sync_connection_wizard():
362367
squish.clickButton(
363368
squish.waitForObject(SyncConnectionWizard.ADD_FOLDER_SYNC_BUTTON)
364369
)
365370

366371
@staticmethod
367-
def get_default_local_sync_folder():
372+
def get_local_sync_path():
368373
return str(
369374
squish.waitForObjectExists(
370375
SyncConnectionWizard.CHOOSE_LOCAL_SYNC_FOLDER

test/gui/shared/steps/account_context.py

+12-13
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,7 @@ def step(context, accountType):
2525
waitForInitialSyncToComplete(getResourcePath('/', account_details["user"], space))
2626

2727

28-
@When('the user adds the following wrong user credentials:')
29-
def step(context):
30-
account_details = getClientDetails(context)
31-
AccountConnectionWizard.addUserCreds(
32-
account_details['user'], account_details['password']
33-
)
34-
35-
36-
@When('the user adds the following user credentials:')
28+
@When(r'the user adds the following(?: wrong)? user credentials:', regexp=True)
3729
def step(context):
3830
account_details = getClientDetails(context)
3931
AccountConnectionWizard.addUserCreds(
@@ -295,10 +287,17 @@ def step(context):
295287
Toolbar.quit_owncloud()
296288

297289

298-
@Then('the default local download directory should be "|any|"')
299-
def step(context, local_directory):
290+
@Then(
291+
r'the default local sync path should be "([^"]*)" in the (configuration|sync connection) wizard',
292+
regexp=True,
293+
)
294+
def step(context, sync_path, wizard):
300295
test.compare(
301-
local_directory,
302-
AccountConnectionWizard.get_local_download_foldername(),
296+
sync_path,
297+
(
298+
AccountConnectionWizard.get_local_sync_path()
299+
if wizard == 'configuration'
300+
else SyncConnectionWizard.get_local_sync_path()
301+
),
303302
"Default local download directory should have bracket with incremented number",
304303
)

test/gui/shared/steps/file_context.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ def step(context, username, source):
380380
shutil.copy2(source_dir, destination_dir)
381381

382382

383-
@Given('folder "|any|" has been created in local system')
383+
@Given('folder "|any|" has been created in the local sync path')
384384
def step(context, folder_name):
385385
folder_path = join(get_config('clientRootSyncPath'), folder_name)
386386
os.makedirs(prefix_path_namespace(folder_path))

test/gui/shared/steps/sync_context.py

+7-11
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ def step(context, spaceName):
188188
SyncConnectionWizard.syncSpace(spaceName)
189189

190190

191+
@When('the user selects the "|any|" space to sync')
192+
def step(context, space_name):
193+
SyncConnectionWizard.select_space_to_sync(space_name)
194+
195+
191196
@Then('the settings tab should have the following options in the general section:')
192197
def step(context):
193198
for item in context.table:
@@ -273,15 +278,6 @@ def step(context, folder_name, selected):
273278
)
274279

275280

276-
@When("the user selects the add folder to sync button")
281+
@When("the user opens the sync connection wizard")
277282
def step(context):
278-
SyncConnectionWizard.click_on_add_button_to_sync()
279-
280-
281-
@Then('the default local sync folder should be "|any|"')
282-
def step(context, sync_directory):
283-
test.compare(
284-
sync_directory,
285-
SyncConnectionWizard.get_default_local_sync_folder(),
286-
"Default sync directory should have bracket with incremented number",
287-
)
283+
SyncConnectionWizard.open_sync_connection_wizard()

test/gui/tst_addAccount/test.feature

+21-5
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,33 @@ Feature: adding accounts
8080
And the user syncs the "Personal" space
8181
Then the folder "simple-folder" should exist on the file system
8282

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

84-
Scenario: Check for incremented number in bracket while adding new account and folder
85-
Given folder "ownCloud" has been created in local system
98+
@skipOnOC10
99+
Scenario: Check for incremented number in bracket while adding new account and folder (oCIS)
100+
Given folder "ownCloud" has been created in the local sync path
86101
And the user has started the client
87102
And the user has entered the following account information:
88103
| server | %local_server% |
89104
When the user adds the following user credentials:
90105
| user | Alice |
91106
| password | 1234 |
92107
And the user opens the advanced configuration
93-
Then the default local download directory should be "/tmp/owncloudtest/ownCloud (2)"
108+
Then the default local sync path should be "/tmp/owncloudtest/ownCloud (2)" in the configuration wizard
94109
When the user selects download everything option in advanced section
95-
And the user selects the add folder to sync button
96-
Then the default local sync folder should be "/tmp/owncloudtest/ownCloud (2) (2)"
110+
And the user opens the sync connection wizard
111+
And the user selects the "Personal" space to sync
112+
Then the default local sync path should be "/tmp/owncloudtest/ownCloud (2)/Personal (2)" in the sync connection wizard

0 commit comments

Comments
 (0)