diff --git a/test/appium/pytest.ini b/test/appium/pytest.ini index f39564d322..6e6cacfefe 100644 --- a/test/appium/pytest.ini +++ b/test/appium/pytest.ini @@ -8,22 +8,6 @@ markers = medium: TCs by priority low: TCs by priority - upgrade: TCs by area - chat: TCs by area - chat_management: TCs by area - wallet: TCs by area - logcat: TCs by area - dapps: TCs by area - sign_in: TCs by area - transaction: TCs by area - - pr - account - testrail_case_id - api - all - message_reliability - performance - battery_consumption - translations - chatbot \ No newline at end of file + testrail_case_id: case ID in testrail + flaky: flaky tests for re-run if necessary + transaction: all cases that are related to transaction completion in Ropsten network \ No newline at end of file diff --git a/test/appium/support/testrail_report.py b/test/appium/support/testrail_report.py index 00758baef3..ff89a6c1f2 100644 --- a/test/appium/support/testrail_report.py +++ b/test/appium/support/testrail_report.py @@ -69,7 +69,7 @@ class TestrailReport(BaseTestReport): request_body = {'suite_id': self.suite_id, 'name': run_name, 'milestone_id': self.actual_milestone_id, - 'case_ids': self.get_regression_cases(is_pr='PR-' in run_name), + 'case_ids': self.get_regression_cases(), 'include_all': False} run = self.post('add_run/%s' % self.project_id, request_body) self.run_id = run['id'] @@ -80,19 +80,16 @@ class TestrailReport(BaseTestReport): test_cases.append(self.get('get_cases/%s&suite_id=%s§ion_id=%s' % (self.project_id, self.suite_id, section_id))) return itertools.chain.from_iterable(test_cases) - def get_regression_cases(self, is_pr=False): + def get_regression_cases(self): test_cases = dict() test_cases['critical'] = 734 test_cases['high'] = 735 test_cases['medium'] = 736 test_cases['low'] = 737 case_ids = list() - if is_pr: - case_ids = [case['id'] for case in self.get_cases([test_cases['critical'], test_cases['high']])] - else: - for phase in test_cases: - for case in self.get_cases([test_cases[phase]]): - case_ids.append(case['id']) + for phase in test_cases: + for case in self.get_cases([test_cases[phase]]): + case_ids.append(case['id']) return case_ids def add_results(self): 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 18d538e8a7..cfd63d7b6d 100644 --- a/test/appium/tests/atomic/account_management/test_create_account.py +++ b/test/appium/tests/atomic/account_management/test_create_account.py @@ -6,8 +6,6 @@ from views.sign_in_view import SignInView from tests.users import basic_user -@marks.all -@marks.account class TestCreateAccount(SingleDeviceTestCase): @marks.testrail_id(5356) @@ -122,7 +120,6 @@ class TestCreateAccount(SingleDeviceTestCase): @marks.testrail_id(5414) @marks.critical - @marks.logcat def test_password_in_logcat_creating_account(self): sign_in = SignInView(self.driver) sign_in.create_user(password=unique_password) diff --git a/test/appium/tests/atomic/account_management/test_keycard.py b/test/appium/tests/atomic/account_management/test_keycard.py index c492b487ab..3faf9229a4 100644 --- a/test/appium/tests/atomic/account_management/test_keycard.py +++ b/test/appium/tests/atomic/account_management/test_keycard.py @@ -5,8 +5,6 @@ from views.keycard_view import KeycardView from tests.users import basic_user, transaction_senders -@marks.all -@marks.account class TestCreateAccount(SingleDeviceTestCase): @marks.testrail_id(5689) diff --git a/test/appium/tests/atomic/account_management/test_profile.py b/test/appium/tests/atomic/account_management/test_profile.py index 4897158f84..1f44102ca4 100644 --- a/test/appium/tests/atomic/account_management/test_profile.py +++ b/test/appium/tests/atomic/account_management/test_profile.py @@ -8,8 +8,6 @@ from tests.users import transaction_senders, basic_user, ens_user, ens_user_rops from views.sign_in_view import SignInView -@marks.all -@marks.account class TestProfileSingleDevice(SingleDeviceTestCase): @marks.testrail_id(5302) @@ -449,7 +447,6 @@ class TestProfileSingleDevice(SingleDeviceTestCase): profile_view.network_settings_button.scroll_to_element(10, 'up') profile_view.find_text_part('custom_ropsten') - @marks.logcat @marks.critical @marks.testrail_id(5419) def test_logcat_backup_recovery_phrase(self): @@ -492,7 +489,6 @@ class TestProfileSingleDevice(SingleDeviceTestCase): @marks.testrail_id(5382) @marks.high - @marks.battery_consumption def test_contact_profile_view(self): sign_in_view = SignInView(self.driver) sign_in_view.create_user() @@ -717,8 +713,6 @@ class TestProfileSingleDevice(SingleDeviceTestCase): self.errors.verify_no_errors() -@marks.all -@marks.account class TestProfileMultipleDevice(MultipleDeviceTestCase): @marks.testrail_id(5432) diff --git a/test/appium/tests/atomic/account_management/test_recover.py b/test/appium/tests/atomic/account_management/test_recover.py index b6f1552c7c..b8d4dd73a3 100644 --- a/test/appium/tests/atomic/account_management/test_recover.py +++ b/test/appium/tests/atomic/account_management/test_recover.py @@ -8,8 +8,6 @@ from views.sign_in_view import SignInView from views.recover_access_view import RecoverAccessView -@marks.all -@marks.account class TestRecoverAccountSingleDevice(SingleDeviceTestCase): @marks.testrail_id(6231) @@ -27,7 +25,6 @@ class TestRecoverAccountSingleDevice(SingleDeviceTestCase): self.errors.append('Back up seed phrase option is active for recovered account!') self.errors.verify_no_errors() - @marks.logcat @marks.testrail_id(5366) @marks.critical def test_logcat_recovering_account(self): diff --git a/test/appium/tests/atomic/account_management/test_sign_in.py b/test/appium/tests/atomic/account_management/test_sign_in.py index 743ccae5af..e58852ddd1 100644 --- a/test/appium/tests/atomic/account_management/test_sign_in.py +++ b/test/appium/tests/atomic/account_management/test_sign_in.py @@ -5,8 +5,6 @@ from tests.base_test_case import MultipleDeviceTestCase, SingleDeviceTestCase from views.sign_in_view import SignInView -@marks.all -@marks.sign_in class TestSignIn(SingleDeviceTestCase): @marks.testrail_id(5312) @@ -39,7 +37,6 @@ class TestSignIn(SingleDeviceTestCase): sign_in.sign_in_button.click() sign_in.find_full_text("Wrong password") - @marks.logcat @marks.testrail_id(5415) @marks.critical def test_password_in_logcat_sign_in(self): diff --git a/test/appium/tests/atomic/account_management/test_wallet_management.py b/test/appium/tests/atomic/account_management/test_wallet_management.py index 3db2eee793..f96ca10296 100644 --- a/test/appium/tests/atomic/account_management/test_wallet_management.py +++ b/test/appium/tests/atomic/account_management/test_wallet_management.py @@ -8,8 +8,6 @@ from views.sign_in_view import SignInView import time -@marks.all -@marks.account class TestWalletManagement(SingleDeviceTestCase): @marks.testrail_id(5335) @@ -232,12 +230,11 @@ class TestWalletManagement(SingleDeviceTestCase): wallet_view.set_up_wallet() wallet_view.accounts_status_account.click() wallet_view.collectibles_button.click() - wallet_view.cryptokitties_in_collectibles_button.wait_for_element(60) - wallet_view.cryptokitties_in_collectibles_button.click() + wallet_view.cryptokitties_in_collectibles_button.wait_and_click(60) web_view = wallet_view.view_in_cryptokitties_button.click() - web_view.element_by_text('cryptokitties.co').click() + web_view.element_by_text('cryptokitties.co').wait_and_click() cryptokitty_link = 'https://www.cryptokitties.co/kitty/1338226' - if not web_view.element_by_text(cryptokitty_link).is_element_displayed(): + if not web_view.element_by_text(cryptokitty_link).is_element_displayed(60): self.driver.fail('Cryptokitty detail page not opened') diff --git a/test/appium/tests/atomic/chats/test_chats_management.py b/test/appium/tests/atomic/chats/test_chats_management.py index 36e254e704..789096de17 100644 --- a/test/appium/tests/atomic/chats/test_chats_management.py +++ b/test/appium/tests/atomic/chats/test_chats_management.py @@ -7,7 +7,6 @@ from views.sign_in_view import SignInView from views.chat_view import ChatView -@marks.chat class TestChatManagement(SingleDeviceTestCase): @marks.testrail_id(5426) @@ -520,7 +519,6 @@ class TestChatManagement(SingleDeviceTestCase): self.errors.verify_no_errors() -@marks.chat class TestChatManagementMultipleDevice(MultipleDeviceTestCase): @marks.testrail_id(5332) diff --git a/test/appium/tests/atomic/chats/test_commands.py b/test/appium/tests/atomic/chats/test_commands.py index c30c5220e2..8d13e39ada 100644 --- a/test/appium/tests/atomic/chats/test_commands.py +++ b/test/appium/tests/atomic/chats/test_commands.py @@ -7,7 +7,6 @@ from tests.base_test_case import MultipleDeviceTestCase, SingleDeviceTestCase from views.sign_in_view import SignInView -@marks.chat @marks.transaction class TestCommandsMultipleDevices(MultipleDeviceTestCase): @@ -214,12 +213,12 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase): @marks.testrail_id(6265) @marks.critical - def test_decline_transactions_in_1_1_chat(self): + def test_decline_transactions_in_1_1_chat_push_notification_changing_state(self): recipient = transaction_recipients['B'] sender = transaction_senders['B'] self.create_drivers(2) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) - home_1 = device_1.recover_access(passphrase=sender['passphrase']) + home_1 = device_1.recover_access(passphrase=sender['passphrase'], enable_notifications=True) home_2 = device_2.recover_access(passphrase=recipient['passphrase']) wallet_1, wallet_2 = home_1.wallet_button.click(), home_2.wallet_button.click() for wallet in wallet_1, wallet_2: @@ -236,9 +235,14 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase): send_transaction.confirm() send_transaction.sign_transaction_button.click() chat_1_sender_message = chat_1.chat_element_by_text('↑ Outgoing transaction') + home_1.click_system_home_button() + + chat_2 = home_2.get_chat(sender['username']).click() chat_2_receiver_message = chat_2.chat_element_by_text('↓ Incoming transaction') chat_2_receiver_message.decline_transaction.click() + home_1.open_notification_bar() + home_1.element_by_text_part('Request address for transaction declined').wait_and_click() for message in chat_1_sender_message, chat_2_receiver_message: if not message.contains_text('Transaction declined', 20): self.errors.append('Message status is not updated to "Transaction declined" for transaction before ' @@ -260,7 +264,6 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase): self.errors.verify_no_errors() -@marks.chat @marks.transaction class TestCommandsSingleDevices(SingleDeviceTestCase): diff --git a/test/appium/tests/atomic/chats/test_group_chat.py b/test/appium/tests/atomic/chats/test_group_chat.py index 19e984f983..02c48da02f 100644 --- a/test/appium/tests/atomic/chats/test_group_chat.py +++ b/test/appium/tests/atomic/chats/test_group_chat.py @@ -5,7 +5,6 @@ from views.sign_in_view import SignInView from time import sleep -@marks.chat class TestGroupChatMultipleDevice(MultipleDeviceTestCase): @marks.testrail_id(3994) diff --git a/test/appium/tests/atomic/chats/test_keycard_commands.py b/test/appium/tests/atomic/chats/test_keycard_commands.py index 84d88d98b5..6bdf08e8d9 100644 --- a/test/appium/tests/atomic/chats/test_keycard_commands.py +++ b/test/appium/tests/atomic/chats/test_keycard_commands.py @@ -6,8 +6,6 @@ from tests.users import transaction_senders, transaction_recipients, ens_user_ro from tests.base_test_case import MultipleDeviceTestCase, SingleDeviceTestCase from views.sign_in_view import SignInView - -@marks.chat @marks.transaction class TestCommandsMultipleDevices(MultipleDeviceTestCase): @@ -171,7 +169,6 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase): self.errors.verify_no_errors() -@marks.chat @marks.transaction class TestCommandsSingleDevices(SingleDeviceTestCase): diff --git a/test/appium/tests/atomic/chats/test_one_to_one.py b/test/appium/tests/atomic/chats/test_one_to_one.py index cb0e678cee..1092076b30 100644 --- a/test/appium/tests/atomic/chats/test_one_to_one.py +++ b/test/appium/tests/atomic/chats/test_one_to_one.py @@ -12,7 +12,6 @@ from views.sign_in_view import SignInView from views.send_transaction_view import SendTransactionView -@marks.chat class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase): @marks.testrail_id(5305) @@ -621,8 +620,6 @@ class TestMessagesOneToOneChatMultiple(MultipleDeviceTestCase): self.errors.verify_no_errors() -@marks.all -@marks.chat class TestMessagesOneToOneChatSingle(SingleDeviceTestCase): @marks.testrail_id(5317) @@ -683,7 +680,6 @@ class TestMessagesOneToOneChatSingle(SingleDeviceTestCase): @marks.testrail_id(5328) @marks.critical - @marks.battery_consumption def test_send_emoji(self): sign_in = SignInView(self.driver) home = sign_in.create_user() diff --git a/test/appium/tests/atomic/chats/test_public.py b/test/appium/tests/atomic/chats/test_public.py index ba33f7fad4..8b40693861 100644 --- a/test/appium/tests/atomic/chats/test_public.py +++ b/test/appium/tests/atomic/chats/test_public.py @@ -2,15 +2,12 @@ import emoji import random from dateutil import parser -from selenium.common.exceptions import TimeoutException -from support.utilities import generate_timestamp from tests import marks from tests.base_test_case import MultipleDeviceTestCase, SingleDeviceTestCase from views.sign_in_view import SignInView from datetime import datetime, timedelta -@marks.chat class TestPublicChatMultipleDevice(MultipleDeviceTestCase): @marks.testrail_id(5313) @@ -200,10 +197,9 @@ class TestPublicChatMultipleDevice(MultipleDeviceTestCase): if home_1.home_button.public_unread_messages.is_element_displayed(): device_1.home_button.click_until_absense_of_element(browser.enter_url_editbox) if not chat_1.chat_element_by_text(message).is_element_displayed(): - self.driver.fail("No message if it received while another tab opened") + self.drivers[0].fail("No message if it received while another tab opened") -@marks.chat class TestPublicChatSingleDevice(SingleDeviceTestCase): @marks.testrail_id(5675) @@ -221,7 +217,6 @@ class TestPublicChatSingleDevice(SingleDeviceTestCase): home_view = chat.get_back_to_home_view() if not home_view.element_by_text(tag_message).is_element_displayed(): self.driver.fail('Could not find the public chat in user chat list.') - #if not home_view.chat_name_text.text == tag_message: @marks.testrail_id(6205) diff --git a/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py b/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py index b4a6a9fcd9..d19f9c3eb8 100644 --- a/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py +++ b/test/appium/tests/atomic/dapps_and_browsing/test_browsing.py @@ -6,7 +6,6 @@ from views.dapps_view import DappsView import time -@pytest.mark.all class TestBrowsing(SingleDeviceTestCase): @marks.testrail_id(5424) diff --git a/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py b/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py index 5b8f48c59f..7a90c945cb 100644 --- a/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py +++ b/test/appium/tests/atomic/dapps_and_browsing/test_dapps.py @@ -5,7 +5,6 @@ from tests.users import basic_user from views.sign_in_view import SignInView -@pytest.mark.all class TestDApps(SingleDeviceTestCase): @marks.testrail_id(5353) diff --git a/test/appium/tests/atomic/test_translations.py b/test/appium/tests/atomic/test_translations.py index dbc13eb9a7..45dbea74b9 100644 --- a/test/appium/tests/atomic/test_translations.py +++ b/test/appium/tests/atomic/test_translations.py @@ -7,8 +7,6 @@ from tests import marks from tests.base_test_case import NoDeviceTestCase -@marks.all -@marks.translations class TestTranslations(NoDeviceTestCase): @marks.testrail_id(6223) diff --git a/test/appium/tests/atomic/test_upgrade.py b/test/appium/tests/atomic/test_upgrade.py index 68576c8643..6c69657b8a 100644 --- a/test/appium/tests/atomic/test_upgrade.py +++ b/test/appium/tests/atomic/test_upgrade.py @@ -2,8 +2,8 @@ from tests import marks from tests.base_test_case import SingleDeviceTestCase from views.sign_in_view import SignInView -@marks.all -@marks.upgrade + +@marks.skip class TestUpgradeApplication(SingleDeviceTestCase): @marks.testrail_id(6284) @@ -15,7 +15,7 @@ class TestUpgradeApplication(SingleDeviceTestCase): old_version = profile.app_version_text.text profile.upgrade_app() - sign_in.driver.launch_app() + self.app = sign_in.driver.launch_app() home = sign_in.sign_in() profile = home.profile_button.click() diff --git a/test/appium/tests/atomic/transactions/test_dapps_transactions.py b/test/appium/tests/atomic/transactions/test_dapps_transactions.py index 869180bae1..58855e9f87 100644 --- a/test/appium/tests/atomic/transactions/test_dapps_transactions.py +++ b/test/appium/tests/atomic/transactions/test_dapps_transactions.py @@ -1,12 +1,10 @@ - from tests import marks, unique_password, common_password from tests.base_test_case import SingleDeviceTestCase -from tests.users import transaction_senders, transaction_recipients, basic_user -from views.send_transaction_view import SendTransactionView +from tests.users import transaction_senders from views.sign_in_view import SignInView -from decimal import Decimal +@marks.transaction class TestTransactionDApp(SingleDeviceTestCase): @marks.testrail_id(5309) diff --git a/test/appium/tests/atomic/transactions/test_keycard_dapps_transactions.py b/test/appium/tests/atomic/transactions/test_keycard_dapps_transactions.py index fa3ff2bbcf..699c9e2e9c 100644 --- a/test/appium/tests/atomic/transactions/test_keycard_dapps_transactions.py +++ b/test/appium/tests/atomic/transactions/test_keycard_dapps_transactions.py @@ -4,6 +4,7 @@ from tests.users import transaction_senders from views.sign_in_view import SignInView +@marks.transaction class TestTransactionDApp(SingleDeviceTestCase): @marks.testrail_id(6249) diff --git a/test/appium/tests/atomic/transactions/test_wallet.py b/test/appium/tests/atomic/transactions/test_wallet.py index 8d7885544e..8764dd6664 100644 --- a/test/appium/tests/atomic/transactions/test_wallet.py +++ b/test/appium/tests/atomic/transactions/test_wallet.py @@ -2,7 +2,7 @@ import random import string from support.utilities import get_merged_txs_list -from tests import marks, unique_password, common_password +from tests import marks, unique_password from tests.base_test_case import SingleDeviceTestCase from tests.users import transaction_senders, basic_user, wallet_users, ens_user_ropsten from views.send_transaction_view import SendTransactionView diff --git a/test/appium/tests/marks.py b/test/appium/tests/marks.py index ae98a8c4e4..01ffa3a8a1 100644 --- a/test/appium/tests/marks.py +++ b/test/appium/tests/marks.py @@ -7,21 +7,6 @@ high = pytest.mark.high medium = pytest.mark.medium low = pytest.mark.low -account = pytest.mark.account -upgrade = pytest.mark.upgrade flaky = pytest.mark.flaky -api = pytest.mark.api -all = pytest.mark.all -chat = pytest.mark.chat -chat_management = pytest.mark.chat_management -dapps = pytest.mark.dapps -message_reliability = pytest.mark.message_reliability transaction = pytest.mark.transaction -wallet = pytest.mark.wallet -sign_in = pytest.mark.sign_in -skip = pytest.mark.skip -logcat = pytest.mark.logcat -performance = pytest.mark.performance - -battery_consumption = pytest.mark.battery_consumption -translations = pytest.mark.translations +skip = pytest.mark.skip \ No newline at end of file diff --git a/test/appium/tests/test_api.py b/test/appium/tests/test_api.py index 13ac8c9744..a8545287d4 100644 --- a/test/appium/tests/test_api.py +++ b/test/appium/tests/test_api.py @@ -19,7 +19,6 @@ def get_parameters(): class TestAPi(object): - @marks.api @pytest.mark.parametrize('symbol,name,address,decimals', get_parameters()) @pytest.mark.skip def test_tokens_verification(self, symbol, name, address, decimals): diff --git a/test/appium/tests/test_chatbot.py b/test/appium/tests/test_chatbot.py index 99ffccaad7..8b7d482cc8 100644 --- a/test/appium/tests/test_chatbot.py +++ b/test/appium/tests/test_chatbot.py @@ -13,7 +13,7 @@ public_keys = pytest_config_global['public_keys'].split() repeats = 24 / len(public_keys) if public_keys else 0 -@pytest.mark.chatbot +@pytest.mark.skip class TestChatBot(SingleDeviceTestCase): def setup_method(self, method, **kwargs): diff --git a/test/appium/tests/test_performance.py b/test/appium/tests/test_performance.py index a829327c0b..c4e0988bd1 100644 --- a/test/appium/tests/test_performance.py +++ b/test/appium/tests/test_performance.py @@ -20,7 +20,6 @@ class TestPerformance(SingleDeviceTestCase): @marks.testrail_id(6216) @marks.high - @marks.performance @marks.skip def test_time_to_load_sign_in_screen(self): diff --git a/test/appium/views/base_element.py b/test/appium/views/base_element.py index e9a11e9be0..a9c7c9a1cc 100644 --- a/test/appium/views/base_element.py +++ b/test/appium/views/base_element.py @@ -275,6 +275,11 @@ class BaseButton(BaseElement): self.driver.info('Tap on %s' % self.name) return self.navigate() + def wait_and_click(self, time=30): + self.driver.info('Waiting for element %s for max %s sec and click when it is available' % (self.name, time)) + self.wait_for_visibility_of_element(time) + self.click() + def click_until_presence_of_element(self, desired_element, attempts=4): counter = 0 while not desired_element.is_element_present(1) and counter <= attempts: