upgrade e2e
Signed-off-by: Churikova Tetiana <churikova.tm@gmail.com>
This commit is contained in:
parent
eb194acce6
commit
d9862e2cef
|
@ -48,6 +48,7 @@ pipeline {
|
||||||
dir('test/appium/tests') {
|
dir('test/appium/tests') {
|
||||||
sh """
|
sh """
|
||||||
python3 -m pytest -m testrail_id \
|
python3 -m pytest -m testrail_id \
|
||||||
|
-m "not upgrade" \
|
||||||
-n24 --rerun_count=2 \
|
-n24 --rerun_count=2 \
|
||||||
--testrail_report=True \
|
--testrail_report=True \
|
||||||
--network=${params.NETWORK} \
|
--network=${params.NETWORK} \
|
||||||
|
|
|
@ -0,0 +1,84 @@
|
||||||
|
pipeline {
|
||||||
|
|
||||||
|
agent { label 'linux' }
|
||||||
|
|
||||||
|
parameters {
|
||||||
|
string(
|
||||||
|
name: 'NETWORK',
|
||||||
|
description: 'Name of test network to use',
|
||||||
|
defaultValue: 'ropsten',
|
||||||
|
)
|
||||||
|
string(
|
||||||
|
name: 'APK_NAME',
|
||||||
|
description: 'Filename of APK uploaded to SauceLabs (base for upgrade, usually release build)',
|
||||||
|
)
|
||||||
|
string(
|
||||||
|
name: 'APK_NAME_UPGRADE',
|
||||||
|
description: 'Filename of APK of upgraded application (installed on top of base)',
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
options {
|
||||||
|
disableConcurrentBuilds()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Setup') {
|
||||||
|
steps { script {
|
||||||
|
dir('test/appium') {
|
||||||
|
sh 'pip3 install --user -r requirements.txt'
|
||||||
|
}
|
||||||
|
} }
|
||||||
|
}
|
||||||
|
stage('Test') {
|
||||||
|
steps {
|
||||||
|
withCredentials([
|
||||||
|
usernamePassword(
|
||||||
|
credentialsId: 'test-rail-api',
|
||||||
|
usernameVariable: 'TESTRAIL_USER',
|
||||||
|
passwordVariable: 'TESTRAIL_PASS'
|
||||||
|
),
|
||||||
|
usernamePassword(
|
||||||
|
credentialsId: 'sauce-labs-api',
|
||||||
|
usernameVariable: 'SAUCE_USERNAME',
|
||||||
|
passwordVariable: 'SAUCE_ACCESS_KEY'
|
||||||
|
),
|
||||||
|
string(
|
||||||
|
credentialsId: 'etherscan-api-key',
|
||||||
|
variable: 'ETHERSCAN_API_KEY'
|
||||||
|
),
|
||||||
|
]) {
|
||||||
|
dir('test/appium/tests') {
|
||||||
|
sh """
|
||||||
|
python3 -m pytest -m upgrade \
|
||||||
|
-n24 --rerun_count=2 \
|
||||||
|
--testrail_report=True \
|
||||||
|
--network=${params.NETWORK} \
|
||||||
|
--apk=${params.APK_NAME} \
|
||||||
|
--apk_upgrade=${params.APK_NAME_UPGRADE}
|
||||||
|
"""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
script {
|
||||||
|
sauce('sauce-labs-cred') {
|
||||||
|
saucePublisher()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
success {
|
||||||
|
script {
|
||||||
|
junit(
|
||||||
|
testDataPublishers: [[$class: 'SauceOnDemandReportPublisher', jobVisibility: 'public']],
|
||||||
|
testResults: 'test/appium/tests/*.xml'
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,33 +1,25 @@
|
||||||
import pytest
|
from tests import marks
|
||||||
from tests import marks, pytest_config_global
|
|
||||||
from tests.base_test_case import SingleDeviceTestCase
|
from tests.base_test_case import SingleDeviceTestCase
|
||||||
from views.sign_in_view import SignInView
|
from views.sign_in_view import SignInView
|
||||||
|
|
||||||
|
@marks.all
|
||||||
|
@marks.upgrade
|
||||||
class TestUpgradeApplication(SingleDeviceTestCase):
|
class TestUpgradeApplication(SingleDeviceTestCase):
|
||||||
|
|
||||||
def setup_method(self, method, **kwargs):
|
@marks.testrail_id(6284)
|
||||||
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_global['apk'].split('/') if '.apk' in i]])[0]
|
|
||||||
|
|
||||||
@marks.testrail_id(5713)
|
|
||||||
@marks.upgrade
|
|
||||||
@marks.skip
|
|
||||||
# skipped as no support for upgrade now
|
|
||||||
def test_apk_upgrade(self):
|
def test_apk_upgrade(self):
|
||||||
sign_in = SignInView(self.driver)
|
sign_in = SignInView(self.driver)
|
||||||
home = sign_in.create_user()
|
home = sign_in.create_user()
|
||||||
profile = home.profile_button.click()
|
profile = home.profile_button.click()
|
||||||
about = profile.about_button.click()
|
profile.about_button.click()
|
||||||
old_version = about.version.text
|
old_version = profile.app_version_text.text
|
||||||
|
profile.upgrade_app()
|
||||||
|
|
||||||
profile.driver.install_app('https://status-im.ams3.digitaloceanspaces.com/' +
|
|
||||||
self.apk_name, replace=True)
|
|
||||||
sign_in.driver.launch_app()
|
sign_in.driver.launch_app()
|
||||||
home = sign_in.sign_in()
|
home = sign_in.sign_in()
|
||||||
|
|
||||||
profile = home.profile_button.click()
|
profile = home.profile_button.click()
|
||||||
about = profile.about_button.click()
|
profile.about_button.click()
|
||||||
new_version = about.version.text
|
new_version = profile.app_version_text.text
|
||||||
print(new_version, old_version)
|
print('Upgraded app version is %s vs base version is %s ' % (new_version, old_version))
|
||||||
assert new_version != old_version
|
assert new_version != old_version
|
||||||
|
|
|
@ -67,6 +67,11 @@ def pytest_addoption(parser):
|
||||||
metavar="NAME",
|
metavar="NAME",
|
||||||
default=None,
|
default=None,
|
||||||
help="only run tests matching the environment NAME.")
|
help="only run tests matching the environment NAME.")
|
||||||
|
parser.addoption("--apk_upgrade",
|
||||||
|
action="store",
|
||||||
|
metavar="NAME",
|
||||||
|
default=None,
|
||||||
|
help='Url or local path to apk for upgrade')
|
||||||
|
|
||||||
# chat bot
|
# chat bot
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import base64
|
import base64
|
||||||
import pytest
|
|
||||||
import random
|
import random
|
||||||
import re
|
import re
|
||||||
import string
|
import string
|
||||||
|
@ -14,7 +13,7 @@ from io import BytesIO
|
||||||
from selenium.common.exceptions import NoSuchElementException, TimeoutException, StaleElementReferenceException
|
from selenium.common.exceptions import NoSuchElementException, TimeoutException, StaleElementReferenceException
|
||||||
|
|
||||||
from support.device_apps import start_web_browser
|
from support.device_apps import start_web_browser
|
||||||
from tests import common_password
|
from tests import common_password, pytest_config_global
|
||||||
from views.base_element import BaseButton, BaseElement, BaseEditBox, BaseText
|
from views.base_element import BaseButton, BaseElement, BaseEditBox, BaseText
|
||||||
|
|
||||||
|
|
||||||
|
@ -688,6 +687,10 @@ class BaseView(object):
|
||||||
start_web_browser(self.driver)
|
start_web_browser(self.driver)
|
||||||
self.driver.get(deep_link)
|
self.driver.get(deep_link)
|
||||||
|
|
||||||
|
def upgrade_app(self):
|
||||||
|
self.driver.install_app(pytest_config_global['apk_upgrade'], replace=True)
|
||||||
|
self.driver.info('Upgrading apk to apk_upgrade')
|
||||||
|
|
||||||
# Method-helper
|
# Method-helper
|
||||||
def write_page_source_to_file(self, full_path_to_file):
|
def write_page_source_to_file(self, full_path_to_file):
|
||||||
string_source = self.driver.page_source
|
string_source = self.driver.page_source
|
||||||
|
|
Loading…
Reference in New Issue