mirror of
https://github.com/status-im/status-react.git
synced 2025-01-11 19:44:47 +00:00
Fixed e2e tests
Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
parent
a74089f857
commit
758cdf6cc2
@ -239,7 +239,7 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
|
|||||||
chat_view = home_view.get_chat_view()
|
chat_view = home_view.get_chat_view()
|
||||||
chat_view.chat_options.click_until_presence_of_element(chat_view.view_profile_button)
|
chat_view.chat_options.click_until_presence_of_element(chat_view.view_profile_button)
|
||||||
chat_view.view_profile_button.click()
|
chat_view.view_profile_button.click()
|
||||||
for text in basic_user['username'], 'In contacts', 'Send message', 'Contact code':
|
for text in basic_user['username'], 'In contacts', 'Send message', 'Chat key':
|
||||||
if not chat_view.element_by_text(text).scroll_to_element():
|
if not chat_view.element_by_text(text).scroll_to_element():
|
||||||
self.errors.append('%s is not visible' % text)
|
self.errors.append('%s is not visible' % text)
|
||||||
self.verify_no_errors()
|
self.verify_no_errors()
|
||||||
@ -319,13 +319,14 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
|
|||||||
sign_in_view = SignInView(self.driver)
|
sign_in_view = SignInView(self.driver)
|
||||||
home_view = sign_in_view.create_user()
|
home_view = sign_in_view.create_user()
|
||||||
home_view.open_status_test_dapp()
|
home_view.open_status_test_dapp()
|
||||||
home_view.back_button.click()
|
home_view.cross_icon.click()
|
||||||
profile_view = home_view.profile_button.click()
|
profile_view = home_view.profile_button.click()
|
||||||
|
profile_view.privacy_and_security_button.click()
|
||||||
profile_view.dapp_permissions_button.click()
|
profile_view.dapp_permissions_button.click()
|
||||||
profile_view.element_by_text('status-im.github.io').click()
|
profile_view.element_by_text('status-im.github.io').click()
|
||||||
if not profile_view.element_by_text('Wallet').is_element_displayed():
|
if not profile_view.element_by_text('Wallet').is_element_displayed():
|
||||||
self.errors.append('Wallet permission was not granted')
|
self.errors.append('Wallet permission was not granted')
|
||||||
if not profile_view.element_by_text('Contact code').is_element_displayed():
|
if not profile_view.element_by_text('Chat key').is_element_displayed():
|
||||||
self.errors.append('Contact code permission was not granted')
|
self.errors.append('Contact code permission was not granted')
|
||||||
profile_view.revoke_access_button.click()
|
profile_view.revoke_access_button.click()
|
||||||
profile_view.back_button.click()
|
profile_view.back_button.click()
|
||||||
@ -343,12 +344,22 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
|
|||||||
@marks.low
|
@marks.low
|
||||||
def test_version_format(self):
|
def test_version_format(self):
|
||||||
sign_in_view = SignInView(self.driver)
|
sign_in_view = SignInView(self.driver)
|
||||||
sign_in_view.create_user()
|
home_view = sign_in_view.create_user()
|
||||||
profile_view = sign_in_view.profile_button.click()
|
profile_view = home_view.profile_button.click()
|
||||||
profile_view.about_button.click()
|
profile_view.about_button.click()
|
||||||
version = profile_view.version_text.text
|
version_text = profile_view.version_text.text
|
||||||
if not re.search("\d{1}[.]\d{1,2}[.]\d{1,2}\s[(]\d*[)]", version):
|
if not re.search("\d{1}[.]\d{1,2}[.]\d{1,2}\s[(]\d*[)];\sStatusIM\/android-\d{3}\/go\d{1}[.]\d{1,2}[.]\d{1,2}",
|
||||||
self.driver.fail("Version %s didn't match expected format" % version)
|
version_text):
|
||||||
|
self.errors.append("Version %s didn't match expected format" % version_text)
|
||||||
|
profile_view.version_text.click()
|
||||||
|
profile_view.back_button.click()
|
||||||
|
profile_view.home_button.click()
|
||||||
|
chat = home_view.join_public_chat(home_view.get_public_chat_name())
|
||||||
|
message_input = chat.chat_message_input
|
||||||
|
message_input.paste_text_from_clipboard()
|
||||||
|
if message_input.text != version_text:
|
||||||
|
self.errors.append('Version number was not copied to clipboard')
|
||||||
|
self.verify_no_errors()
|
||||||
|
|
||||||
|
|
||||||
@marks.all
|
@marks.all
|
||||||
|
@ -133,7 +133,7 @@ class TestChatManagement(SingleDeviceTestCase):
|
|||||||
contacts_view = home.start_new_chat_button.click()
|
contacts_view = home.start_new_chat_button.click()
|
||||||
contacts_view.public_key_edit_box.set_value(basic_user['public_key'][:-1])
|
contacts_view.public_key_edit_box.set_value(basic_user['public_key'][:-1])
|
||||||
contacts_view.confirm()
|
contacts_view.confirm()
|
||||||
warning_text = contacts_view.element_by_text('Please enter or scan a valid contact code or username')
|
warning_text = contacts_view.element_by_text('Please enter or scan a valid chat key or username')
|
||||||
if not warning_text.is_element_displayed():
|
if not warning_text.is_element_displayed():
|
||||||
pytest.fail('Error is not shown for invalid public key')
|
pytest.fail('Error is not shown for invalid public key')
|
||||||
|
|
||||||
|
@ -1,10 +1,9 @@
|
|||||||
import pytest
|
|
||||||
from selenium.common.exceptions import NoSuchElementException
|
from selenium.common.exceptions import NoSuchElementException
|
||||||
|
|
||||||
from tests import marks
|
from tests import marks
|
||||||
from tests.base_test_case import SingleDeviceTestCase
|
from tests.base_test_case import SingleDeviceTestCase
|
||||||
from views.sign_in_view import SignInView
|
|
||||||
from tests.users import basic_user
|
from tests.users import basic_user
|
||||||
|
from views.sign_in_view import SignInView
|
||||||
|
|
||||||
|
|
||||||
class TestDeepLinks(SingleDeviceTestCase):
|
class TestDeepLinks(SingleDeviceTestCase):
|
||||||
@ -22,7 +21,7 @@ class TestDeepLinks(SingleDeviceTestCase):
|
|||||||
try:
|
try:
|
||||||
assert chat_view.user_name_text.text == '#' + chat_name
|
assert chat_view.user_name_text.text == '#' + chat_name
|
||||||
except (AssertionError, NoSuchElementException):
|
except (AssertionError, NoSuchElementException):
|
||||||
pytest.fail("Public chat '%s' is not opened" % chat_name)
|
self.driver.fail("Public chat '%s' is not opened" % chat_name)
|
||||||
|
|
||||||
@marks.testrail_id(5441)
|
@marks.testrail_id(5441)
|
||||||
@marks.medium
|
@marks.medium
|
||||||
@ -35,7 +34,7 @@ class TestDeepLinks(SingleDeviceTestCase):
|
|||||||
chat_view = sign_in_view.get_chat_view()
|
chat_view = sign_in_view.get_chat_view()
|
||||||
for text in basic_user['username'], 'Add to contacts':
|
for text in basic_user['username'], 'Add to contacts':
|
||||||
if not chat_view.element_by_text(text).scroll_to_element(10):
|
if not chat_view.element_by_text(text).scroll_to_element(10):
|
||||||
pytest.fail("User profile screen is not opened")
|
self.driver.fail("User profile screen is not opened")
|
||||||
|
|
||||||
@marks.testrail_id(5442)
|
@marks.testrail_id(5442)
|
||||||
@marks.medium
|
@marks.medium
|
||||||
@ -51,7 +50,7 @@ class TestDeepLinks(SingleDeviceTestCase):
|
|||||||
test_dapp_view = web_view.open_in_status_button.click()
|
test_dapp_view = web_view.open_in_status_button.click()
|
||||||
test_dapp_view.allow_button.is_element_present()
|
test_dapp_view.allow_button.is_element_present()
|
||||||
except NoSuchElementException:
|
except NoSuchElementException:
|
||||||
pytest.fail("DApp '%s' is not opened!" % dapp_name)
|
self.driver.fail("DApp '%s' is not opened!" % dapp_name)
|
||||||
|
|
||||||
@marks.testrail_id(5780)
|
@marks.testrail_id(5780)
|
||||||
@marks.medium
|
@marks.medium
|
||||||
@ -61,10 +60,11 @@ class TestDeepLinks(SingleDeviceTestCase):
|
|||||||
self.driver.close_app()
|
self.driver.close_app()
|
||||||
deep_link = 'https://get.status.im/user/%s' % basic_user['public_key']
|
deep_link = 'https://get.status.im/user/%s' % basic_user['public_key']
|
||||||
sign_in_view.open_weblink_and_login(deep_link)
|
sign_in_view.open_weblink_and_login(deep_link)
|
||||||
chat_view = sign_in_view.get_chat_view()
|
profile_view = sign_in_view.get_profile_view()
|
||||||
for text in basic_user['username'], 'Share my profile', 'Contacts':
|
if profile_view.default_username_text.text != basic_user['username'] \
|
||||||
if not chat_view.element_by_text(text).scroll_to_element(12):
|
or not profile_view.contacts_button.is_element_displayed() \
|
||||||
pytest.fail("Own profile screen is not opened!")
|
or profile_view.share_my_profile_button.is_element_displayed():
|
||||||
|
self.driver.fail("Own profile screen is not opened!")
|
||||||
|
|
||||||
@marks.testrail_id(5781)
|
@marks.testrail_id(5781)
|
||||||
@marks.medium
|
@marks.medium
|
||||||
@ -77,4 +77,4 @@ class TestDeepLinks(SingleDeviceTestCase):
|
|||||||
home_view = sign_in_view.get_home_view()
|
home_view = sign_in_view.get_home_view()
|
||||||
home_view.plus_button.click_until_presence_of_element(home_view.start_new_chat_button)
|
home_view.plus_button.click_until_presence_of_element(home_view.start_new_chat_button)
|
||||||
if not home_view.start_new_chat_button.is_element_present():
|
if not home_view.start_new_chat_button.is_element_present():
|
||||||
pytest.fail("Can't navigate to start new chat after app opened from deep link with invalid public key")
|
self.driver.fail("Can't navigate to start new chat after app opened from deep link with invalid public key")
|
||||||
|
@ -314,7 +314,7 @@ class FaqButton(BaseButton):
|
|||||||
class VersionText(BaseText):
|
class VersionText(BaseText):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(VersionText, self).__init__(driver)
|
super(VersionText, self).__init__(driver)
|
||||||
self.locator = self.Locator.xpath_selector("//*[@content-desc='version'][1]")
|
self.locator = self.Locator.xpath_selector("//*[@content-desc='version']//android.widget.TextView[2]")
|
||||||
|
|
||||||
|
|
||||||
class BootnodesButton(BaseButton):
|
class BootnodesButton(BaseButton):
|
||||||
@ -488,7 +488,7 @@ class RevokeAccessButton(BaseButton):
|
|||||||
class PrivacyAndSecurityButton(BaseButton):
|
class PrivacyAndSecurityButton(BaseButton):
|
||||||
def __init__(self, driver):
|
def __init__(self, driver):
|
||||||
super(PrivacyAndSecurityButton, self).__init__(driver)
|
super(PrivacyAndSecurityButton, self).__init__(driver)
|
||||||
self.locator = self.Locator.xpath_selector('//*[@content-desc="privacy-and-security-settings-button"]')
|
self.locator = self.Locator.accessibility_id('privacy-and-security-settings-button')
|
||||||
|
|
||||||
|
|
||||||
class ShowENSNameInChatsToggle(BaseButton):
|
class ShowENSNameInChatsToggle(BaseButton):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user