added upgrade test, changed apk name on sauce
Signed-off-by: Anton Danchenko <ant.danchenko@gmail.com>
This commit is contained in:
parent
e878af8458
commit
69209107ca
|
@ -40,7 +40,8 @@ def uploadToSauceLabs() {
|
|||
if (changeId != null) {
|
||||
env.SAUCE_LABS_NAME = "${changeId}.apk"
|
||||
} 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([
|
||||
string(credentialsId: 'SAUCE_ACCESS_KEY', variable: 'SAUCE_ACCESS_KEY'),
|
||||
|
|
|
@ -338,3 +338,45 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
|
|||
chat_2.chat_message_input.send_keys(message_1)
|
||||
chat_2.send_message_button.click()
|
||||
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()
|
||||
|
|
|
@ -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
|
|
@ -72,6 +72,7 @@ class AbstractTestCase:
|
|||
desired_caps['setWebContentDebuggingEnabled'] = True
|
||||
desired_caps['ignoreUnimportantViews'] = False
|
||||
desired_caps['enableNotificationListener'] = True
|
||||
desired_caps['maxDuration'] = 1800
|
||||
return desired_caps
|
||||
|
||||
def update_capabilities_sauce_lab(self, new_capabilities: dict):
|
||||
|
@ -157,14 +158,15 @@ class Driver(webdriver.Remote):
|
|||
|
||||
class SingleDeviceTestCase(AbstractTestCase):
|
||||
|
||||
def setup_method(self, method, max_duration=1800):
|
||||
def setup_method(self, method, **kwargs):
|
||||
if pytest.config.getoption('docker'):
|
||||
appium_container.start_appium_container(pytest.config.getoption('docker_shared_volume'))
|
||||
appium_container.connect_device(pytest.config.getoption('device_ip'))
|
||||
|
||||
(executor, capabilities) = (self.executor_sauce_lab, self.capabilities_sauce_lab) if \
|
||||
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)
|
||||
test_suite_data.current_test.testruns[-1].jobs[self.driver.session_id] = 1
|
||||
self.driver.implicitly_wait(self.implicitly_wait)
|
||||
|
@ -252,18 +254,3 @@ environment = LocalMultipleDeviceTestCase if pytest.config.getoption('env') == '
|
|||
|
||||
class MultipleDeviceTestCase(environment):
|
||||
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)
|
||||
|
|
|
@ -9,8 +9,9 @@ medium = pytest.mark.medium
|
|||
low = pytest.mark.low
|
||||
|
||||
account = pytest.mark.account
|
||||
all = pytest.mark.all
|
||||
upgrade = pytest.mark.upgrade
|
||||
api = pytest.mark.api
|
||||
all = pytest.mark.all
|
||||
chat = pytest.mark.chat
|
||||
chat_management = pytest.mark.chat_management
|
||||
dapps = pytest.mark.dapps
|
||||
|
@ -22,4 +23,5 @@ sign_in = pytest.mark.sign_in
|
|||
skip = pytest.mark.skip
|
||||
logcat = pytest.mark.logcat
|
||||
|
||||
|
||||
battery_consumption = pytest.mark.battery_consumption
|
||||
|
|
|
@ -15,8 +15,8 @@ repeats = 24 / len(public_keys) if public_keys else 0
|
|||
@pytest.mark.chatbot
|
||||
class TestChatBot(SingleDeviceTestCase):
|
||||
|
||||
def setup_method(self, method, max_duration=10800):
|
||||
super(TestChatBot, self).setup_method(method, max_duration=10800)
|
||||
def setup_method(self, method, **kwargs):
|
||||
super(TestChatBot, self).setup_method(method, maxDuration=10800)
|
||||
|
||||
@pytest.mark.parametrize('key', numpy.repeat(public_keys, repeats))
|
||||
def test_one_to_one_chatbot(self, key):
|
||||
|
|
|
@ -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()
|
|
@ -13,9 +13,9 @@ class PrivacyPolicyButton(BaseButton):
|
|||
return BaseWebView(self.driver)
|
||||
|
||||
|
||||
class VersionInfo(BaseText):
|
||||
class VersionText(BaseText):
|
||||
def __init__(self, driver):
|
||||
super(VersionInfo, self).__init__(driver)
|
||||
super(VersionText, self).__init__(driver)
|
||||
self.locator = self.Locator.xpath_selector(
|
||||
'//*[@content-desc="version"]//android.widget.TextView')
|
||||
|
||||
|
@ -25,4 +25,4 @@ class AboutView(BaseView):
|
|||
super(AboutView, self).__init__(driver)
|
||||
|
||||
self.privacy_policy_button = PrivacyPolicyButton(self.driver)
|
||||
self.version_info = VersionInfo(self.driver)
|
||||
self.version = VersionText(self.driver)
|
||||
|
|
Loading…
Reference in New Issue