From 036692f8ba7b1fabaa217f482e683bae401c494d Mon Sep 17 00:00:00 2001 From: Serhy Date: Tue, 19 Mar 2019 11:02:41 +0200 Subject: [PATCH] Fix autotests for new welcome screen Signed-off-by: Andrey Shovkoplyas --- .../account_management/test_create_account.py | 29 ++++++++++++++----- test/appium/views/base_view.py | 8 +++++ test/appium/views/sign_in_view.py | 1 + 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/test/appium/tests/atomic/account_management/test_create_account.py b/test/appium/tests/atomic/account_management/test_create_account.py index ca623989e3..410c53e598 100644 --- a/test/appium/tests/atomic/account_management/test_create_account.py +++ b/test/appium/tests/atomic/account_management/test_create_account.py @@ -49,18 +49,31 @@ class TestCreateAccount(SingleDeviceTestCase): @marks.high def test_home_view(self): sign_in = SignInView(self.driver) - home = sign_in.create_user() - if not home.welcome_image.is_element_displayed(): + sign_in.accept_agreements() + sign_in.create_account_button.click() + sign_in.password_input.set_value(common_password) + sign_in.next_button.click() + sign_in.confirm_password_input.set_value(common_password) + sign_in.next_button.click() + + sign_in.element_by_text_part('Display name').wait_for_element(30) + sign_in.name_input.send_keys('user_%s' % get_current_time()) + sign_in.next_button.click() + + welcome_screen = sign_in.get_home_view() + + if not welcome_screen.welcome_image.is_element_displayed(): self.errors.append('Welcome image is not shown') for text in ['Welcome to Status', - 'Tap the plus (+) button to get started']: - if not home.element_by_text(text).is_element_displayed(): + 'Here you can chat with people in a secure private chat, browse and interact with DApps.']: + if not welcome_screen.element_by_text(text).is_element_displayed(): self.errors.append("'%s' text is not shown" % text) - home.profile_button.click() - home.home_button.click() - text = 'Your Home screen will house your recent chats and DApp history. Tap the plus (+) button to get started.' - if not home.element_by_text(text).is_element_displayed(): + + welcome_screen.get_started_button.click() + text = 'There are no recent chats here yet. \nUse the (+) button to discover people \nto chat with' + if not welcome_screen.element_by_text(text).is_element_displayed(): self.errors.append("'%s' text is not shown" % text) + self.verify_no_errors() @marks.testrail_id(5460) diff --git a/test/appium/views/base_view.py b/test/appium/views/base_view.py index 9e8d9c8cc9..0b49f6c002 100644 --- a/test/appium/views/base_view.py +++ b/test/appium/views/base_view.py @@ -261,6 +261,13 @@ class ShowRoots(BaseButton): self.locator = self.Locator.accessibility_id('Show roots') +class GetStartedButton(BaseButton): + + def __init__(self, driver): + super(GetStartedButton, self).__init__(driver) + self.locator = self.Locator.xpath_selector("//*[@text='GET STARTED']") + + class AssetButton(BaseButton): def __init__(self, driver, asset_name): super(AssetButton, self).__init__(driver) @@ -303,6 +310,7 @@ class BaseView(object): self.connection_status = ConnectionStatusText(self.driver) self.cross_icon = CrossIcon(self.driver) self.show_roots_button = ShowRoots(self.driver) + self.get_started_button = GetStartedButton(self.driver) self.apps_button = AppsButton(self.driver) self.status_app_icon = StatusAppIcon(self.driver) diff --git a/test/appium/views/sign_in_view.py b/test/appium/views/sign_in_view.py index 4f82f9998a..701df11ebd 100644 --- a/test/appium/views/sign_in_view.py +++ b/test/appium/views/sign_in_view.py @@ -125,6 +125,7 @@ class SignInView(BaseView): self.name_input.set_value(username) self.next_button.click() + self.get_started_button.click() return self.get_home_view() def recover_access(self, passphrase: str, password: str = common_password):