Skip to content

Commit

Permalink
Added entities for capusle syncing
Browse files Browse the repository at this point in the history
  • Loading branch information
LadislavVasina1 committed Dec 5, 2023
1 parent 9031136 commit 365521b
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions airgun/entities/capsule.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,48 @@ def delete(self, capsule_name):

return self.get_operation_status(view)

def sync(self, capsule_name, sync_type):
"""
General function for syncing capsule
Args:
capsule_name (str): Name of capsule to be synced
sync_type (str): Type of sync to be performed
"""

view = self.navigate_to(self, 'Capsules')
view.searchbox.search(f'name="{capsule_name}"')
view.table.row(name=capsule_name)['Name'].click()
view = CapsuleDetailsView(self.browser)
if sync_type == 'Optimized Sync':
view.overview.synchronize_action_drop.fill(
view.overview.synchronize_action_drop.items[0]
)
elif sync_type == 'Complete Sync':
view.overview.synchronize_action_drop.fill(
view.overview.synchronize_action_drop.items[1]
)

def optimized_sync(self, capsule_name):
"""
Function that performs optimized sync of given capsule
Args:
capsule_name (str): Name of capsule to be synced
"""

self.sync(capsule_name, 'Optimized Sync')

def complete_sync(self, capsule_name):
"""
Function that performs complete sync of given capsule
Args:
capsule_name (str): Name of capsule to be synced
"""

self.sync(capsule_name, 'Complete Sync')


@navigator.register(CapsuleEntity, 'Capsules')
class OpenAcsPage(NavigateStep):
Expand Down

0 comments on commit 365521b

Please sign in to comment.