Check version format

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2019-08-08 13:41:06 +02:00
parent a79544d043
commit fc999c2462
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
2 changed files with 22 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import pytest
import re
from tests import marks, bootnode_address, mailserver_address, camera_access_error_text, \
photos_access_error_text
@ -353,6 +354,16 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
self.errors.append('Profile permission is not asked')
self.verify_no_errors()
@marks.testrail_id(5428)
@marks.low
def test_version_format(self):
sign_in_view = SignInView(self.driver)
sign_in_view.create_user()
profile_view = sign_in_view.profile_button.click()
profile_view.about_button.click()
version = profile_view.version_text.text
if not re.search("\d{1}[.]\d{1,2}[.]\d{1,2}\s[(]\d*[)]", version):
self.driver.fail("Version %s didn't match expected format" % version)
@marks.all
@marks.account

View File

@ -316,6 +316,15 @@ class FaqButton(BaseButton):
from views.web_views.base_web_view import BaseWebView
return BaseWebView(self.driver)
class AboutButton(BaseButton):
def __init__(self, driver):
super(AboutButton, self).__init__(driver)
self.locator = self.Locator.accessibility_id("about-button")
class VersionText(BaseText):
def __init__(self, driver):
super(VersionText, self).__init__(driver)
self.locator = self.Locator.xpath_selector("//*[@content-desc='version'][1]")
class BootnodesButton(BaseButton):
@ -492,6 +501,7 @@ class ProfileView(BaseView):
self.public_key_text = PublicKeyText(self.driver)
self.profile_address_text = ProfileAddressText(self.driver)
self.about_button = AboutButton(self.driver)
self.version_text = VersionText(self.driver)
self.network_settings_button = NetworkSettingsButton(self.driver)
self.active_network_name = ActiveNetworkName(self.driver)
@ -536,6 +546,7 @@ class ProfileView(BaseView):
self.help_button = HelpButton(self.driver)
self.submit_bug_button = SubmitBugButton(self.driver)
self.faq_button = FaqButton(self.driver)
self.about_button = AboutButton(self.driver)
# Bootnodes
self.bootnodes_button = BootnodesButton(self.driver)