added upgrade test, changed apk name on sauce

Signed-off-by: Anton Danchenko <ant.danchenko@gmail.com>
This commit is contained in:
Anton Danchenko 2019-01-15 16:53:05 +02:00
parent e878af8458
commit 69209107ca
No known key found for this signature in database
GPG Key ID: C2D4819B698627E4
8 changed files with 87 additions and 72 deletions

View File

@ -40,7 +40,8 @@ def uploadToSauceLabs() {
if (changeId != null) { if (changeId != null) {
env.SAUCE_LABS_NAME = "${changeId}.apk" env.SAUCE_LABS_NAME = "${changeId}.apk"
} else { } else {
env.SAUCE_LABS_NAME = "im.status.ethereum-e2e-${GIT_COMMIT.take(6)}.apk" def pkg = cmn.pkgFilename(type, 'apk')
env.SAUCE_LABS_NAME = "${pkg}"
} }
withCredentials([ withCredentials([
string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'SAUCE_ACCESS_KEY'), string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'SAUCE_ACCESS_KEY'),

View File

@ -338,3 +338,45 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
chat_2.chat_message_input.send_keys(message_1) chat_2.chat_message_input.send_keys(message_1)
chat_2.send_message_button.click() chat_2.send_message_button.click()
chat_1.chat_element_by_text(message_1).wait_for_visibility_of_element() chat_1.chat_element_by_text(message_1).wait_for_visibility_of_element()
@marks.testrail_id(5453)
@marks.medium
def test_privacy_policy_is_accessible(self):
signin_view = SignInView(self.driver)
no_link_found_error_msg = 'Could not find privacy policy link at'
no_link_open_error_msg = 'Could not open our privacy policy from'
if not signin_view.privacy_policy_link.is_element_displayed():
self.driver.fail('{} Sign in view!'.format(no_link_found_error_msg))
base_web_view = signin_view.privacy_policy_link.click()
base_web_view.open_in_webview()
if not base_web_view.policy_summary.is_element_displayed():
self.errors.append('{} Sign in view!'.format(no_link_open_error_msg))
base_web_view.click_system_back_button()
signin_view = SignInView(self.driver)
home_view = signin_view.create_user()
profile = home_view.profile_button.click()
about_view = profile.about_button.click()
base_web_view = about_view.privacy_policy_button.click()
if not base_web_view.policy_summary.is_element_displayed():
self.errors.append('{} Profile about view!'.format(no_link_open_error_msg))
base_web_view.click_system_back_button()
if about_view.privacy_policy_button.is_element_displayed():
base_web_view.click_system_back_button()
signin_view = profile.logout()
if signin_view.ok_button.is_element_displayed():
signin_view.ok_button.click()
signin_view.other_accounts_button.click()
if not signin_view.privacy_policy_link.is_element_displayed():
self.driver.fail('{} Sign in view!'.format(no_link_found_error_msg))
base_web_view = signin_view.privacy_policy_link.click()
if not base_web_view.policy_summary.is_element_displayed():
self.errors.append('{} Sign in view!'.format(no_link_open_error_msg))
self.verify_no_errors()

View File

@ -0,0 +1,31 @@
import pytest
from tests import marks
from tests.base_test_case import SingleDeviceTestCase
from views.sign_in_view import SignInView
class TestUpgradeApplication(SingleDeviceTestCase):
def setup_method(self, method, **kwargs):
super(TestUpgradeApplication, self).setup_method(method, app='sauce-storage:app-release.apk')
self.apk_name = ([i for i in [i for i in pytest.config.getoption('apk').split('/') if '.apk' in i]])[0]
@marks.testrail_id(5713)
@marks.upgrade
def test_apk_upgrade(self):
sign_in = SignInView(self.driver)
home = sign_in.create_user()
profile = home.profile_button.click()
about = profile.about_button.click()
old_version = about.version.text
profile.driver.install_app('https://status-im.ams3.digitaloceanspaces.com/' +
self.apk_name, replace=True)
sign_in.driver.launch_app()
home = sign_in.sign_in()
profile = home.profile_button.click()
about = profile.about_button.click()
new_version = about.version.text
print(new_version, old_version)
assert new_version != old_version

View File

@ -72,6 +72,7 @@ class AbstractTestCase:
desired_caps['setWebContentDebuggingEnabled'] = True desired_caps['setWebContentDebuggingEnabled'] = True
desired_caps['ignoreUnimportantViews'] = False desired_caps['ignoreUnimportantViews'] = False
desired_caps['enableNotificationListener'] = True desired_caps['enableNotificationListener'] = True
desired_caps['maxDuration'] = 1800
return desired_caps return desired_caps
def update_capabilities_sauce_lab(self, new_capabilities: dict): def update_capabilities_sauce_lab(self, new_capabilities: dict):
@ -157,14 +158,15 @@ class Driver(webdriver.Remote):
class SingleDeviceTestCase(AbstractTestCase): class SingleDeviceTestCase(AbstractTestCase):
def setup_method(self, method, max_duration=1800): def setup_method(self, method, **kwargs):
if pytest.config.getoption('docker'): if pytest.config.getoption('docker'):
appium_container.start_appium_container(pytest.config.getoption('docker_shared_volume')) appium_container.start_appium_container(pytest.config.getoption('docker_shared_volume'))
appium_container.connect_device(pytest.config.getoption('device_ip')) appium_container.connect_device(pytest.config.getoption('device_ip'))
(executor, capabilities) = (self.executor_sauce_lab, self.capabilities_sauce_lab) if \ (executor, capabilities) = (self.executor_sauce_lab, self.capabilities_sauce_lab) if \
self.environment == 'sauce' else (self.executor_local, self.capabilities_local) self.environment == 'sauce' else (self.executor_local, self.capabilities_local)
capabilities['maxDuration'] = max_duration for key, value in kwargs.items():
capabilities[key] = value
self.driver = Driver(executor, capabilities) self.driver = Driver(executor, capabilities)
test_suite_data.current_test.testruns[-1].jobs[self.driver.session_id] = 1 test_suite_data.current_test.testruns[-1].jobs[self.driver.session_id] = 1
self.driver.implicitly_wait(self.implicitly_wait) self.driver.implicitly_wait(self.implicitly_wait)
@ -252,18 +254,3 @@ environment = LocalMultipleDeviceTestCase if pytest.config.getoption('env') == '
class MultipleDeviceTestCase(environment): class MultipleDeviceTestCase(environment):
pass pass
class MessageReliabilityTestCase(MultipleDeviceTestCase):
def setup_method(self, method):
super(MessageReliabilityTestCase, self).setup_method(method)
self.one_to_one_chat_data = dict()
self.public_chat_data = dict()
def teardown_method(self, method):
if self.one_to_one_chat_data:
create_one_to_one_chat_report(self.one_to_one_chat_data)
if self.public_chat_data:
create_public_chat_report(self.public_chat_data)
super(MultipleDeviceTestCase, self).teardown_method(method)

View File

@ -9,8 +9,9 @@ medium = pytest.mark.medium
low = pytest.mark.low low = pytest.mark.low
account = pytest.mark.account account = pytest.mark.account
all = pytest.mark.all upgrade = pytest.mark.upgrade
api = pytest.mark.api api = pytest.mark.api
all = pytest.mark.all
chat = pytest.mark.chat chat = pytest.mark.chat
chat_management = pytest.mark.chat_management chat_management = pytest.mark.chat_management
dapps = pytest.mark.dapps dapps = pytest.mark.dapps
@ -22,4 +23,5 @@ sign_in = pytest.mark.sign_in
skip = pytest.mark.skip skip = pytest.mark.skip
logcat = pytest.mark.logcat logcat = pytest.mark.logcat
battery_consumption = pytest.mark.battery_consumption battery_consumption = pytest.mark.battery_consumption

View File

@ -15,8 +15,8 @@ repeats = 24 / len(public_keys) if public_keys else 0
@pytest.mark.chatbot @pytest.mark.chatbot
class TestChatBot(SingleDeviceTestCase): class TestChatBot(SingleDeviceTestCase):
def setup_method(self, method, max_duration=10800): def setup_method(self, method, **kwargs):
super(TestChatBot, self).setup_method(method, max_duration=10800) super(TestChatBot, self).setup_method(method, maxDuration=10800)
@pytest.mark.parametrize('key', numpy.repeat(public_keys, repeats)) @pytest.mark.parametrize('key', numpy.repeat(public_keys, repeats))
def test_one_to_one_chatbot(self, key): def test_one_to_one_chatbot(self, key):

View File

@ -1,48 +0,0 @@
from tests import marks
from tests.base_test_case import SingleDeviceTestCase
from views.sign_in_view import SignInView
class TestLinksVerifications(SingleDeviceTestCase):
@marks.testrail_id(5453)
@marks.medium
def test_privacy_policy_is_accessible(self):
signin_view = SignInView(self.driver)
no_link_found_error_msg = 'Could not find privacy policy link at'
no_link_open_error_msg = 'Could not open our privacy policy from'
if not signin_view.privacy_policy_link.is_element_displayed():
self.driver.fail('{} Sign in view!'.format(no_link_found_error_msg))
base_web_view = signin_view.privacy_policy_link.click()
base_web_view.open_in_webview()
if not base_web_view.policy_summary.is_element_displayed():
self.errors.append('{} Sign in view!'.format(no_link_open_error_msg))
base_web_view.click_system_back_button()
signin_view = SignInView(self.driver)
home_view = signin_view.create_user()
profile = home_view.profile_button.click()
about_view = profile.about_button.click()
base_web_view = about_view.privacy_policy_button.click()
if not base_web_view.policy_summary.is_element_displayed():
self.errors.append('{} Profile about view!'.format(no_link_open_error_msg))
base_web_view.click_system_back_button()
if about_view.privacy_policy_button.is_element_displayed():
base_web_view.click_system_back_button()
signin_view = profile.logout()
if signin_view.ok_button.is_element_displayed():
signin_view.ok_button.click()
signin_view.other_accounts_button.click()
if not signin_view.privacy_policy_link.is_element_displayed():
self.driver.fail('{} Sign in view!'.format(no_link_found_error_msg))
base_web_view = signin_view.privacy_policy_link.click()
if not base_web_view.policy_summary.is_element_displayed():
self.errors.append('{} Sign in view!'.format(no_link_open_error_msg))
self.verify_no_errors()

View File

@ -13,9 +13,9 @@ class PrivacyPolicyButton(BaseButton):
return BaseWebView(self.driver) return BaseWebView(self.driver)
class VersionInfo(BaseText): class VersionText(BaseText):
def __init__(self, driver): def __init__(self, driver):
super(VersionInfo, self).__init__(driver) super(VersionText, self).__init__(driver)
self.locator = self.Locator.xpath_selector( self.locator = self.Locator.xpath_selector(
'//*[@content-desc="version"]//android.widget.TextView') '//*[@content-desc="version"]//android.widget.TextView')
@ -25,4 +25,4 @@ class AboutView(BaseView):
super(AboutView, self).__init__(driver) super(AboutView, self).__init__(driver)
self.privacy_policy_button = PrivacyPolicyButton(self.driver) self.privacy_policy_button = PrivacyPolicyButton(self.driver)
self.version_info = VersionInfo(self.driver) self.version = VersionText(self.driver)