marks and new checks in e2e

Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2020-09-04 17:34:58 +02:00
parent 1a98219690
commit fea916590a
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
26 changed files with 33 additions and 101 deletions

View File

@ -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
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

View File

@ -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&section_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):

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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):

View File

@ -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):

View File

@ -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')

View File

@ -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)

View File

@ -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):

View File

@ -5,7 +5,6 @@ from views.sign_in_view import SignInView
from time import sleep
@marks.chat
class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
@marks.testrail_id(3994)

View File

@ -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):

View File

@ -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()

View File

@ -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)

View File

@ -6,7 +6,6 @@ from views.dapps_view import DappsView
import time
@pytest.mark.all
class TestBrowsing(SingleDeviceTestCase):
@marks.testrail_id(5424)

View File

@ -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)

View File

@ -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)

View File

@ -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()

View File

@ -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)

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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):

View File

@ -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):

View File

@ -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):

View File

@ -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: