Skip to content

Commit

Permalink
new onboarding tests changes
Browse files Browse the repository at this point in the history
  • Loading branch information
anastasiyaig committed Jan 22, 2025
1 parent 07675f3 commit 2f2eeea
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 31 deletions.
14 changes: 7 additions & 7 deletions test/e2e/gui/components/onboarding/share_usage_data_popup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
from gui.components.base_popup import BasePopup
from gui.elements.button import Button
from gui.elements.object import QObject
from gui.objects_map import names
from gui.objects_map import names, onboarding_names


class ShareUsageDataPopup(QObject):

def __init__(self):
super().__init__(names.share_usage_data_StatusButton)
self._not_now_button = Button(names.not_now_StatusButton )
self._share_usage_data_button = Button(names.share_usage_data_StatusButton)
super().__init__(onboarding_names.helpUsImproveStatusPage)
# TODO: Remove later
#self._not_now_button = Button(names.not_now_StatusButton )
#self._share_usage_data_button = Button(names.share_usage_data_StatusButton)

@allure.step('Click not now button')
def skip(self):
self._not_now_button.click()
self.share_usage_data_button = Button(onboarding_names.shareUsageDataButton)
self.not_now_button = Button(onboarding_names.notNowButton)
2 changes: 1 addition & 1 deletion test/e2e/gui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def prepare(self) -> 'Window':
def sign_up(self, user_account: UserAccount):
BeforeStartedPopUp().get_started()
welcome_screen = WelcomeToStatusView().wait_until_appears()
profile_view = welcome_screen.get_keys().generate_new_keys()
profile_view = welcome_screen.open_create_your_profile_view().generate_new_keys()
profile_view.set_display_name(user_account.name)
create_password_view = profile_view.next()
confirm_password_view = create_password_view.create_password(user_account.password)
Expand Down
22 changes: 22 additions & 0 deletions test/e2e/gui/objects_map/onboarding_names.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
from gui.objects_map.names import statusDesktop_mainWindow, statusDesktop_mainWindow_overlay

# New onboarding locators

startupOnboardingLayout = {"container": statusDesktop_mainWindow, "objectName": "startupOnboardingLayout", "type": "OnboardingLayout", "visible": True}
startupWelcomePage = {"container": startupOnboardingLayout, "type": "WelcomePage", "unnamed": 1, "visible": True}
startupNewsPage = {"container": startupOnboardingLayout, "id": "newsPage", "type": "ColumnLayout", "unnamed": 1, "visible": True}
startupCreateProfileButton = {"container": startupOnboardingLayout, "objectName": "btnCreateProfile", "type": "StatusButton", "visible": True}
startupLoginButton = {"container": startupOnboardingLayout, "objectName": "btnLogin", "type": "StatusButton", "visible": True}
startupApprovalLinks = {"container": startupOnboardingLayout, "objectName": "approvalLinks", "type": "StatusBaseText", "visible": True}

onboardingLayout = {"container": statusDesktop_mainWindow, "objectName": "OnboardingLayout", "type": "ContentItem", "visible": True}
helpUsImproveStatusPage = {"container": onboardingLayout, "type": "HelpUsImproveStatusPage", "unnamed": 1, "visible": True}
shareUsageDataButton = {"container": helpUsImproveStatusPage, "objectName": "btnShare", "type": "StatusButton", "visible": True}
notNowButton = {"container": statusDesktop_mainWindow, "objectName": "btnDontShare", "type": "StatusButton", "visible": True}


# CreateYourProfileView
onboardingFrame = {"container": onboardingLayout, "type": "OnboardingFrame", "unnamed": 1, "visible": True}
buttonFrame = {"container": onboardingLayout, "id": "buttonFrame", "type": "OnboardingButtonFrame", "unnamed": 1, "visible": True}
startFreshLetsGoButton = {"container": onboardingFrame, "objectName": "btnCreateWithPassword", "type": "StatusButton", "visible": True}
useRecoveryPhraseButton = {"container": buttonFrame, "objectName": "btnCreateWithSeedPhrase", "type": "ListItemButton", "visible": True}
useEmptyKeycardButton = {"container": statusDesktop_mainWindow, "objectName": "btnCreateWithEmptyKeycard", "type": "ListItemButton", "visible": True}

# Map for onboarding locators

mainWindow_onboardingBackButton_StatusRoundButton = {"container": statusDesktop_mainWindow, "objectName": "onboardingBackButton", "type": "StatusRoundButton", "visible": True}
Expand Down
33 changes: 22 additions & 11 deletions test/e2e/gui/screens/onboarding.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,25 +44,36 @@ def start_using_status(self):
class WelcomeToStatusView(QObject):

def __init__(self):
super(WelcomeToStatusView, self).__init__(onboarding_names.mainWindow_WelcomeView)
self._i_am_new_to_status_button = Button(onboarding_names.mainWindow_I_am_new_to_Status_StatusBaseText)
self._i_already_use_status_button = Button(onboarding_names.mainWindow_I_already_use_Status_StatusFlatButton)
super().__init__(onboarding_names.startupOnboardingLayout)
self.create_profile_button = Button(onboarding_names.startupCreateProfileButton)
self.log_in_button = Button(onboarding_names.startupLoginButton)
self.approval_links = QObject(onboarding_names.startupApprovalLinks)

@allure.step('Open Keys view')
def get_keys(self) -> 'KeysView':
self._i_am_new_to_status_button.click()
time.sleep(1)
ShareUsageDataPopup().skip()
return KeysView().wait_until_appears()
@allure.step('Open Create your profile view')
def open_create_your_profile_view(self) -> 'CreateYourProfileView':
self.create_profile_button.click()
ShareUsageDataPopup().not_now_button.click()
return CreateYourProfileView().wait_until_appears()

@allure.step('Open Sign by syncing form')
def sync_existing_user(self) -> 'SignBySyncingView':
self._i_already_use_status_button.click()
self.log_in_button.click()
time.sleep(1)
ShareUsageDataPopup().skip()
ShareUsageDataPopup().not_now_button.click()
return SignBySyncingView().wait_until_appears()


class CreateYourProfileView(WelcomeToStatusView):
def __init__(self):
super().__init__()
self.lets_go_button = Button(onboarding_names.startFreshLetsGoButton)
self.use_a_recovery_phrase_button = Button(onboarding_names.useRecoveryPhraseButton)
self.use_an_empty_keycard_button = Button(onboarding_names.useEmptyKeycardButton)

def open_password_view(self):
self.lets_go_button.click()
return CreatePasswordView()

class OnboardingView(QObject):

def __init__(self, object_name):
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/helpers/OnboardingHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
with step('Open Generate new keys view'):
def open_generate_new_keys_view():
BeforeStartedPopUp().get_started()
keys_screen = WelcomeToStatusView().wait_until_appears().get_keys()
keys_screen = WelcomeToStatusView().wait_until_appears().open_create_your_profile_view()
return keys_screen


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,11 @@
def test_generate_account_back_up_seed_sign_out(aut, main_window, user_account,
user_image: str, zoom: int, shift):
with step('Click generate new keys and open profile view'):
BeforeStartedPopUp().get_started()
keys_screen = WelcomeToStatusView().wait_until_appears().get_keys()
# BeforeStartedPopUp().get_started()
profile_view = WelcomeToStatusView().wait_until_appears().open_create_your_profile_view()
profile_view.open_password_view()


profile_view = keys_screen.generate_new_keys()
assert profile_view.is_next_button_enabled is False, \
f'Next button is enabled on profile screen when it should not'

with step('Type in the display name on the profile view'):
profile_view.set_display_name(user_account.name)
Expand Down
12 changes: 6 additions & 6 deletions test/ui-test/testSuites/suite_communities/config.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<testconfig version="1.0">
<information>
<summary/>
<description/>
</information>
<testsettings/>
<passwords/>
<information>
<summary/>
<description/>
</information>
<testsettings/>
<passwords/>
</testconfig>

0 comments on commit 2f2eeea

Please sign in to comment.