Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
Churikova Tetiana 2020-02-24 12:30:45 +01:00
parent 81c4d16f9f
commit b8c7e44326
No known key found for this signature in database
GPG Key ID: 0D4EA7B33B47E6D8
15 changed files with 111 additions and 70 deletions

View File

@ -40,6 +40,10 @@ pipeline {
usernameVariable: 'SAUCE_USERNAME', usernameVariable: 'SAUCE_USERNAME',
passwordVariable: 'SAUCE_ACCESS_KEY' passwordVariable: 'SAUCE_ACCESS_KEY'
), ),
string(
credentialsId: 'etherscan-api-key',
variable: 'ETHERSCAN_API_KEY'
),
]) { ]) {
dir('test/appium/tests') { dir('test/appium/tests') {
sh """ sh """

View File

@ -75,6 +75,10 @@ pipeline {
usernameVariable: 'SAUCE_USERNAME', usernameVariable: 'SAUCE_USERNAME',
passwordVariable: 'SAUCE_ACCESS_KEY' passwordVariable: 'SAUCE_ACCESS_KEY'
), ),
string(
credentialsId: 'etherscan-api-key',
variable: 'ETHERSCAN_API_KEY'
),
]) { ]) {
dir('test/appium/tests') { dir('test/appium/tests') {
sh """ sh """

View File

@ -1,12 +0,0 @@
node ('linux1'){sauce('12e007ad-48cf-4c20-92f3-b923bb5641bd'){
checkout([$class: 'GitSCM', branches: [[name: 'tests/align-with-start-chat-redesign-#3195']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'CleanBeforeCheckout']], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/status-im/status-react.git']]])
currentBuild.displayName = "PR-$pr_id"
try {withCredentials([string(credentialsId: 'GIT_HUB_TOKEN', variable: 'GIT_HUB_TOKEN'), string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'SAUCE_ACCESS_KEY'), string(credentialsId: 'SAUCE_USERNAME', variable: 'SAUCE_USERNAME')]){
sh 'cd test/appium/tests && python3 -m pytest -m all --pr_number=$pr_id --build=PR-$pr_id -n12 $apk'
}
}
finally {
saucePublisher()
junit testDataPublishers: [[$class: 'SauceOnDemandReportPublisher', jobVisibility: 'public']], testResults: 'test/appium/tests/*.xml' }
}
}

View File

@ -1,3 +1,29 @@
[pytest] [pytest]
norecursedirs = .git views norecursedirs = .git views
addopts = -s -v --tb=line --junitxml=result.xml addopts = -s -v --tb=line --junitxml=result.xml
junit_family=legacy
markers =
critical: TCs by priority
high: TCs by priority
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

View File

@ -6,6 +6,7 @@ import requests
import time import time
from json import JSONDecodeError from json import JSONDecodeError
from decimal import Decimal from decimal import Decimal
from os import environ
import tests import tests
@ -21,12 +22,18 @@ class NetworkApi(object):
self.chat_bot_url = 'http://offsite.chat:8099' self.chat_bot_url = 'http://offsite.chat:8099'
def get_transactions(self, address: str) -> List[dict]: def get_transactions(self, address: str) -> List[dict]:
method = self.network_url + 'module=account&action=txlist&address=0x%s&sort=desc' % address method = self.network_url + 'module=account&action=txlist&address=0x%s&sort=desc&apikey=%s' % (address, environ.get('ETHERSCAN_API_KEY'))
try:
return requests.request('GET', url=method, headers=self.headers).json()['result'] return requests.request('GET', url=method, headers=self.headers).json()['result']
except TypeError:
print('Check response from etherscan API. Returned values don\'t match expected')
def get_token_transactions(self, address: str) -> List[dict]: def get_token_transactions(self, address: str) -> List[dict]:
method = self.network_url + 'module=account&action=tokentx&address=0x%s&sort=desc' % address method = self.network_url + 'module=account&action=tokentx&address=0x%s&sort=desc&apikey=%s' % (address, environ.get('ETHERSCAN_API_KEY'))
try:
return requests.request('GET', url=method, headers=self.headers).json()['result'] return requests.request('GET', url=method, headers=self.headers).json()['result']
except TypeError:
print('Check response from etherscan API. Returned values don\'t match expected')
def is_transaction_successful(self, transaction_hash: str) -> int: def is_transaction_successful(self, transaction_hash: str) -> int:
method = self.network_url + 'module=transaction&action=getstatus&txhash=%s' % transaction_hash method = self.network_url + 'module=transaction&action=getstatus&txhash=%s' % transaction_hash

View File

@ -30,12 +30,15 @@ appium_container = AppiumContainer()
common_password = 'qwerty' common_password = 'qwerty'
unique_password = 'unique' + get_current_time() unique_password = 'unique' + get_current_time()
bootnode_address = "enode://436cc6f674928fdc9a9f7990f2944002b685d1c37f025c1be425185b5b1f0900feaf1ccc2a6130268f9901be4a7d252f37302c8335a2c1a62736e9232691cc3a@178.128.138.128:443" bootnode_address = "enode://a8a97f126f5e3a340cb4db28a1187c325290ec08b2c9a6b1f19845ac86c46f9fac2ba13328822590" \
mailserver_address = "enode://ee2b53b0ace9692167a410514bca3024695dbf0e1a68e1dff9716da620efb195f04a4b9e873fb9b74ac84de801106c465b8e2b6c4f0d93b8749d1578bfcaf03e@104.197.238.144:443" "fd3de3acb09cc38b5a05272e583a2365ad1fa67f66c55b34@167.99.210.203:30404"
# referred to https://github.com/status-im/status-react/blob/1ea49a80fc915aa3174ecfd9649c3bab6480d30d/src/status_im/constants.cljs#L40
mailserver_address = "enode://ee2b53b0ace9692167a410514bca3024695dbf0e1a68e1dff9716da620efb195f04a4b9e873fb9b74ac84de80" \
"1106c465b8e2b6c4f0d93b8749d1578bfcaf03e:status-offline-inbox@104.197.238.144:443"
staging_fleet = 'eth.staging' staging_fleet = 'eth.staging'
prod_fleet = 'eth.prod' prod_fleet = 'eth.prod'
mailserver_ams = 'mail-01.do-ams3' mailserver_ams = 'mail-01.do-ams3'
mailserver_hk = 'mail-01.ac-cn-hongkong-c' mailserver_hk = 'mail-02.ac-cn-hongkong-c'
mailserver_gc = 'mail-01.gc-us-central1-a' mailserver_gc = 'mail-01.gc-us-central1-a'
mailserver_ams_01 = 'mail-01.do-ams3.eth.prod' mailserver_ams_01 = 'mail-01.do-ams3.eth.prod'
camera_access_error_text = "To grant the required camera permission, please go to your system settings " \ camera_access_error_text = "To grant the required camera permission, please go to your system settings " \

View File

@ -746,43 +746,43 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
profile_1.mail_server_by_name(server_name).click() profile_1.mail_server_by_name(server_name).click()
profile_1.mail_server_connect_button.click() profile_1.mail_server_connect_button.click()
profile_1.confirm_button.click() profile_1.confirm_button.click()
profile_1.home_button.click()
if not profile_1.element_by_text_part('Error connecting').is_element_displayed(30): if not profile_1.element_by_text_part('Error connecting').is_element_displayed(30):
sign_in_1.driver.fail("No popup with 'Error connecting' is shown") sign_in_1.driver.fail("No popup with 'Error connecting' is shown")
profile_1.element_by_text('CANCEL').click() profile_1.element_by_text('CANCEL').click()
home_2.just_fyi('send several messages to public channel') # TODO: blocked by 10065
public_chat_name = home_2.get_public_chat_name() # profile_1.home_button.click()
message = 'test_message' # home_2.just_fyi('send several messages to public channel')
public_chat_2 = home_2.join_public_chat(public_chat_name) # public_chat_name = home_2.get_public_chat_name()
public_chat_2.chat_message_input.send_keys(message) # message = 'test_message'
public_chat_2.send_message_button.click() # public_chat_2 = home_2.join_public_chat(public_chat_name)
public_chat_2.back_button.click() # public_chat_2.chat_message_input.send_keys(message)
# public_chat_2.send_message_button.click()
# public_chat_2.back_button.click()
#
# profile_1.just_fyi('join same public chat and try to reconnect via "Tap to reconnect" and check "Connecting"')
# profile_1.home_button.click()
# home_1.join_public_chat(public_chat_name)
# public_chat_1 = home_1.get_chat_view()
# chat_state = 'Could not connect to mailserver. Tap to reconnect'
# public_chat_1.element_by_text(chat_state).click()
# if not public_chat_1.element_by_text_part('Connecting').is_element_displayed():
# self.errors.append("Indicator doesn't show 'Connecting'")
profile_1.just_fyi('join same public chat and try to reconnect via "Tap to reconnect" and check "Connecting"') # profile_1.just_fyi('check that can RETRY to connect')
profile_1.home_button.click() # for _ in range(2):
home_1.join_public_chat(public_chat_name) # public_chat_1.element_by_text('RETRY').wait_for_element(30)
public_chat_1 = home_1.get_chat_view() # public_chat_1.element_by_text('RETRY').click()
chat_state = 'Could not connect to mailserver. Tap to reconnect' #
public_chat_1.element_by_text(chat_state).click() # profile_1.just_fyi('check that can pick another mailserver and receive messages')
if not public_chat_1.element_by_text_part('Connecting').is_element_displayed(): # public_chat_1.element_by_text('PICK ANOTHER').is_element_displayed(30)
self.errors.append("Indicator doesn't show 'Connecting'") # public_chat_1.element_by_text_part('PICK ANOTHER').click()
# mailserver = profile_1.return_mailserver_name(mailserver_ams, prod_fleet)
profile_1.just_fyi('check that can RETRY to connect') # profile_1.element_by_text(mailserver).click()
for _ in range(2): # profile_1.confirm_button.click()
public_chat_1.element_by_text('RETRY').wait_for_element(30) # profile_1.home_button.click()
public_chat_1.element_by_text('RETRY').click() # if not public_chat_1.chat_element_by_text(message).is_element_displayed(30):
# self.errors.append("Chat history wasn't fetched")
profile_1.just_fyi('check that can pick another mailserver and receive messages')
public_chat_1.element_by_text('PICK ANOTHER').is_element_displayed(30)
public_chat_1.element_by_text_part('PICK ANOTHER').click()
mailserver = profile_1.return_mailserver_name(mailserver_ams, prod_fleet)
profile_1.element_by_text(mailserver).click()
profile_1.confirm_button.click()
profile_1.home_button.click()
if not public_chat_1.chat_element_by_text(message).is_element_displayed(30):
self.errors.append("Chat history wasn't fetched")
self.errors.verify_no_errors() self.errors.verify_no_errors()
@ -851,7 +851,7 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
@marks.testrail_id(5680) @marks.testrail_id(5680)
@marks.high @marks.high
@marks.skip @marks.skip
# skip until edit userpic is enabled back # TODO: skip until edit userpic is enabled back
def test_pair_devices_sync_name_photo_public_group_chats(self): def test_pair_devices_sync_name_photo_public_group_chats(self):
self.create_drivers(2) self.create_drivers(2)
device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1]) device_1, device_2 = SignInView(self.drivers[0]), SignInView(self.drivers[1])

View File

@ -119,6 +119,7 @@ class TestWalletManagement(SingleDeviceTestCase):
address = wallet.get_wallet_address() address = wallet.get_wallet_address()
self.network_api.get_donate(address[2:]) self.network_api.get_donate(address[2:])
wallet.back_button.click() wallet.back_button.click()
wallet.wait_balance_is_changed()
if not wallet.backup_recovery_phrase_warning_text.is_element_present(30): if not wallet.backup_recovery_phrase_warning_text.is_element_present(30):
self.driver.fail("'Back up your seed phrase' warning is not shown on Wallet with funds") self.driver.fail("'Back up your seed phrase' warning is not shown on Wallet with funds")
wallet.backup_recovery_phrase_warning_text.click() wallet.backup_recovery_phrase_warning_text.click()

View File

@ -224,6 +224,8 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
@marks.testrail_id(4001) @marks.testrail_id(4001)
@marks.high @marks.high
@marks.skip
# TODO:should be retested after fix 10054
def test_remove_member_from_group_chat(self): def test_remove_member_from_group_chat(self):
self.create_drivers(2) self.create_drivers(2)
message_for_device_2 = 'This message should not be visible for device 2' message_for_device_2 = 'This message should not be visible for device 2'

View File

@ -25,20 +25,22 @@ class TestBrowsing(SingleDeviceTestCase):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
home_view = sign_in.create_user() home_view = sign_in.create_user()
dapp_view = home_view.dapp_tab_button.click() dapp_view = home_view.dapp_tab_button.click()
ru_url = 'https://status.im/ru/' ru_url = 'https://ru.m.wikipedia.org'
browsing_view = dapp_view.open_url(ru_url) browsing_view = dapp_view.open_url(ru_url)
browsing_view.find_text_part('Частная, безопасная связь') browsing_view.find_text_part('Добро пожаловать')
browsing_view.just_fyi('Navigate to get-involved and back') browsing_view.just_fyi('Navigate to next page and back')
browsing_view.element_by_text_part('Участвовать').click() browsing_view.element_by_text_part('свободную энциклопедию').click()
browsing_view.element_by_text_part('Свободный контент')
browsing_view.browser_previous_page_button.click() browsing_view.browser_previous_page_button.click()
browsing_view.just_fyi('Relogin and check that tap on "Next" navigates to get-involved') browsing_view.just_fyi('Relogin and check that tap on "Next" navigates to next page')
browsing_view.relogin() browsing_view.relogin()
home_view.dapp_tab_button.click() home_view.dapp_tab_button.click()
dapp_view.element_by_text_part(ru_url).click() dapp_view.element_by_text_part(ru_url).click()
browsing_view.browser_next_page_button.click() browsing_view.browser_next_page_button.click()
browsing_view.find_text_part('Сообщество с открытым исходным кодом') if not browsing_view.element_by_text_part('Свободный контент').is_element_displayed(20):
self.driver.fail("Browser history is not kept after relogin")
@marks.testrail_id(5438) @marks.testrail_id(5438)
@marks.medium @marks.medium
@ -137,14 +139,14 @@ class TestBrowsing(SingleDeviceTestCase):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
home = sign_in.create_user() home = sign_in.create_user()
daap_view = home.dapp_tab_button.click() daap_view = home.dapp_tab_button.click()
browsing_view = daap_view.open_url('status.im') browsing_view = daap_view.open_url('dap.ps')
browsing_view.element_by_text_part('Get Involved', 'button').click() browsing_view.element_by_text_part('View all', 'button').click()
browsing_view.find_text_part('An Open Source Community') if browsing_view.element_by_text_part('View all').is_element_displayed(20):
self.driver.fail("Failed to access Categories using ''View all'")
browsing_view.browser_previous_page_button.click() browsing_view.browser_previous_page_button.click()
browsing_view.find_text_part('Get Status', 15) browsing_view.find_text_part('Categories', 15)
browsing_view.browser_next_page_button.click() browsing_view.browser_next_page_button.click()
browsing_view.find_text_part('An Open Source Community') browsing_view.find_text_part('Exchanges', 15)
browsing_view.back_to_home_button.click() browsing_view.back_to_home_button.click()
@marks.testrail_id(5354) @marks.testrail_id(5354)
@ -160,6 +162,9 @@ class TestBrowsing(SingleDeviceTestCase):
@marks.testrail_id(5785) @marks.testrail_id(5785)
@marks.critical @marks.critical
@marks.skip
#TODO: needs to be updated; skipped due to changing DApps in Discover, also not possible to use search
# (no suggestions on emulators)
def test_can_open_dapp_from_dapp_store(self): def test_can_open_dapp_from_dapp_store(self):
sign_in = SignInView(self.driver) sign_in = SignInView(self.driver)
home = sign_in.create_user() home = sign_in.create_user()

View File

@ -25,6 +25,8 @@ class TestDeepLinks(SingleDeviceTestCase):
@marks.testrail_id(5441) @marks.testrail_id(5441)
@marks.medium @marks.medium
@marks.skip
# TODO: uncomment after https://github.com/status-im/universal-links-handler/pull/29 will be implemented in app
def test_open_user_profile_using_deep_link(self): def test_open_user_profile_using_deep_link(self):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.create_user() sign_in_view.create_user()
@ -39,6 +41,8 @@ class TestDeepLinks(SingleDeviceTestCase):
@marks.testrail_id(5442) @marks.testrail_id(5442)
@marks.medium @marks.medium
@marks.skip
# TODO: uncomment after https://github.com/status-im/universal-links-handler/pull/29 will be implemented in app
def test_open_dapp_using_deep_link(self): def test_open_dapp_using_deep_link(self):
sign_in_view = SignInView(self.driver) sign_in_view = SignInView(self.driver)
sign_in_view.create_user() sign_in_view.create_user()

View File

@ -128,7 +128,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
sign_in_view.just_fyi('Restore account with funds offline') sign_in_view.just_fyi('Restore account with funds offline')
sign_in_view.toggle_airplane_mode() sign_in_view.toggle_airplane_mode()
sign_in_view.access_key_button.click()
sign_in_view.recover_access(sender['passphrase']) sign_in_view.recover_access(sender['passphrase'])
home_view = sign_in_view.get_home_view() home_view = sign_in_view.get_home_view()
wallet_view = home_view.wallet_button.click() wallet_view = home_view.wallet_button.click()

View File

@ -14,7 +14,6 @@ from selenium.common.exceptions import WebDriverException
from support.api.network_api import NetworkApi from support.api.network_api import NetworkApi
from support.github_report import GithubHtmlReport from support.github_report import GithubHtmlReport
from support.message_reliability_report import create_one_to_one_chat_report, create_public_chat_report
from tests import test_suite_data, start_threads, appium_container, pytest_config_global from tests import test_suite_data, start_threads, appium_container, pytest_config_global
class AbstractTestCase: class AbstractTestCase:

View File

@ -1,6 +1,5 @@
import pytest import pytest
pr = pytest.mark.pr
testrail_case_id = pytest.mark.testrail_case_id testrail_case_id = pytest.mark.testrail_case_id
testrail_id = pytest.mark.testrail_id # atomic tests testrail_id = pytest.mark.testrail_id # atomic tests
critical = pytest.mark.critical critical = pytest.mark.critical

View File

@ -179,11 +179,11 @@ class BaseElement(object):
width, height = size['width'], size['height'] width, height = size['width'], size['height']
self.driver.swipe(start_x=x + width * 0.75, start_y=y + height / 2, end_x=x, end_y=y + height / 2) self.driver.swipe(start_x=x + width * 0.75, start_y=y + height / 2, end_x=x, end_y=y + height / 2)
def swipe_to_web_element(self): def swipe_to_web_element(self, depth=400):
element = self.find_element() element = self.find_element()
location = element.location location = element.location
x, y = location['x'], location['y'] x, y = location['x'], location['y']
self.driver.swipe(start_x=x, start_y=y, end_x=x, end_y=400) self.driver.swipe(start_x=x, start_y=y, end_x=x, end_y=depth)
def long_press_element(self): def long_press_element(self):
element = self.find_element() element = self.find_element()