align e2e with accessibility-ids

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2019-11-18 10:38:34 +01:00
parent 7b14bbecde
commit 40ca4af6a6
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
3 changed files with 34 additions and 4 deletions

View File

@ -53,6 +53,7 @@ class TestCreateAccount(SingleDeviceTestCase):
sign_in.next_button.click()
sign_in.confirm_your_password_input.set_value(common_password)
sign_in.next_button.click()
sign_in.lets_go_button.click()
if sign_in.get_public_key() == public_key:
self.driver.fail('New account was not created')
@ -72,14 +73,27 @@ class TestCreateAccount(SingleDeviceTestCase):
sign_in.next_button.click()
sign_in.confirm_your_password_input.set_value(common_password)
sign_in.next_button.click()
sign_in.lets_go_button.click()
home_view = sign_in.get_home_view()
text = 'There are no recent chats here yet. \nUse the (+) button to discover people \nto chat with'
if not home_view.element_by_text(text).is_element_displayed():
self.errors.append("'%s' text is not shown" % text)
texts = ['Chat and transact privately with your friends.','Follow your interests in one of the many Public Chats.']
for text in texts:
if not home_view.element_by_text(text).is_element_displayed():
self.errors.append("'%s' text is not shown" % text)
profile_view = home_view.profile_button.click()
shown_username = profile_view.default_username_text.text
if shown_username != username:
self.errors.append("Default username '%s' doesn't match '%s'" % (shown_username, username))
profile_view.home_button.click()
profile_view.cross_icon_iside_welcome_screen_button.click()
if home_view.element_by_text(texts[0]).is_element_displayed():
self.errors.append("'%s' text is shown, but welcome view was closed" % texts[0])
home_view.relogin()
if home_view.element_by_text(texts[0]).is_element_displayed():
self.errors.append("'%s' text is shown after relogin, but welcome view was closed" % texts[0])
text_after_closing_welcome_screen = "Your chats will appear here. To start new chats press the ⊕ button"
if not home_view.element_by_text(text_after_closing_welcome_screen).is_element_displayed():
self.errors.append("'%s' text is not shown after welcome view was closed" % text_after_closing_welcome_screen)
self.errors.verify_no_errors()
@marks.testrail_id(5460)

View File

@ -242,6 +242,11 @@ class CrossIcon(BaseButton):
super(CrossIcon, self).__init__(driver)
self.locator = self.Locator.xpath_selector('(//android.view.ViewGroup[@content-desc="icon"])[1]')
class CrossIconInWelcomeScreen(BaseButton):
def __init__(self, driver):
super(CrossIconInWelcomeScreen, self).__init__(driver)
self.locator = self.Locator.accessibility_id('hide-home-button')
class ShowRoots(BaseButton):
@ -335,6 +340,7 @@ class BaseView(object):
self.get_started_button = GetStartedButton(self.driver)
self.ok_got_it_button = OkGotItButton(self.driver)
self.progress_bar = ProgressBar(self.driver)
self.cross_icon_iside_welcome_screen_button = CrossIconInWelcomeScreen(self.driver)
# external browser
self.open_in_status_button = OpenInStatusButton(self.driver)
@ -351,6 +357,7 @@ class BaseView(object):
'text': BaseText
}
def accept_agreements(self):
iterations = int()
while iterations <= 2 and (self.ok_button.is_element_displayed(2) or

View File

@ -55,6 +55,11 @@ class SignInButton(BaseButton):
from views.home_view import HomeView
return HomeView(self.driver)
class LetsGoButton(BaseEditBox):
def __init__(self, driver):
super(LetsGoButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id('lets-go-button')
class RecoverAccessButton(BaseButton):
@ -178,6 +183,7 @@ class SignInView(BaseView):
self.name_input = NameInput(self.driver)
self.other_multiaccounts_button = OtherMultiAccountsButton(self.driver)
self.privacy_policy_link = PrivacyPolicyLink(self.driver)
self.lets_go_button = LetsGoButton(self.driver)
def create_user(self, password=common_password):
self.get_started_button.click()
@ -188,6 +194,7 @@ class SignInView(BaseView):
self.next_button.click()
self.confirm_your_password_input.set_value(password)
self.next_button.click()
self.lets_go_button.click()
self.profile_button.wait_for_visibility_of_element(30)
return self.get_home_view()
@ -206,7 +213,9 @@ class SignInView(BaseView):
recover_access_view.create_password_input.set_value(password)
recover_access_view.next_button.click()
recover_access_view.confirm_your_password_input.set_value(password)
recover_access_view.next_button.click_until_presence_of_element(recover_access_view.home_button)
recover_access_view.next_button.click_until_presence_of_element(self.lets_go_button)
self.lets_go_button.click()
self.profile_button.wait_for_visibility_of_element(30)
return self.get_home_view()
def sign_in(self, password=common_password):