Skip to content

Commit 4589bc4

Browse files
authored
[CI] Run functional tests nightly (appium#463)
* [CI] Run functional tests nightly * Extend timeout to wait for 2nd session created * Skip flaky test_all_sessions
1 parent 7f55187 commit 4589bc4

7 files changed

Lines changed: 30 additions & 12 deletions

File tree

azure-pipelines.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,12 @@
44
# https://docs.microsoft.com/azure/devops/pipelines/languages/xcode
55
jobs:
66
- template: ./ci-jobs/functional_test.yml
7+
8+
# Runs tests nightly to make sure they works against appium@beta
9+
schedules:
10+
- cron: "0 0 * * *"
11+
displayName: Daily Nightly build (UTC)
12+
branches:
13+
include:
14+
- master
15+
always: true

test/functional/android/find_by_accessibility_id_tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616

1717
from appium.webdriver.common.mobileby import MobileBy
1818

19-
from .helper.test_helper import BaseTestCase, is_ci, wait_for_element
19+
from ..test_helper import is_ci
20+
from .helper.test_helper import BaseTestCase, wait_for_element
2021

2122

2223
class FindByAccessibilityIDTests(BaseTestCase):

test/functional/android/helper/test_helper.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from selenium.webdriver.support.ui import WebDriverWait
2121

2222
from appium import webdriver
23+
from test.functional.test_helper import is_ci
2324

2425
from . import desired_capabilities
2526

@@ -48,15 +49,6 @@ def wait_for_element(driver, locator, value, timeout=SLEEPY_TIME):
4849
)
4950

5051

51-
def is_ci():
52-
"""Returns if current execution is running on CI
53-
54-
Returns:
55-
bool: `True` if current executions is on CI
56-
"""
57-
return os.getenv('CI', 'false') == 'true'
58-
59-
6052
class BaseTestCase(unittest.TestCase):
6153

6254
def setUp(self):

test/functional/android/network_connection_tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
from appium.webdriver.connectiontype import ConnectionType
1919

20-
from .helper.test_helper import BaseTestCase, is_ci
20+
from ..test_helper import is_ci
21+
from .helper.test_helper import BaseTestCase
2122

2223

2324
class NetworkConnectionTests(BaseTestCase):

test/functional/android/webdriver_tests.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020

2121
from appium.webdriver.common.mobileby import MobileBy
2222

23-
from .helper.test_helper import BaseTestCase, is_ci, wait_for_element
23+
from ..test_helper import is_ci
24+
from .helper.test_helper import BaseTestCase, wait_for_element
2425

2526

2627
class WebdriverTests(BaseTestCase):

test/functional/ios/webdriver_tests.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from appium.webdriver.applicationstate import ApplicationState
2121
from test.functional.test_helper import get_available_from_port_range
2222

23+
from ..test_helper import is_ci
2324
from .helper import desired_capabilities
2425

2526

@@ -32,6 +33,9 @@ def tearDown(self):
3233
self.driver.quit()
3334

3435
def test_all_sessions(self):
36+
if is_ci():
37+
# TODO Due to not created 2nd session somehow
38+
self.skipTest('Need to fix flaky test during running on CI.')
3539
port = get_available_from_port_range(8200, 8300)
3640
desired_caps = desired_capabilities.get_desired_capabilities('UICatalog.app.zip')
3741
desired_caps['deviceName'] = 'iPhone Xs Max'

test/functional/test_helper.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import os
12
import socket
23

34

@@ -21,3 +22,12 @@ def get_available_from_port_range(from_port, to_port):
2122

2223
raise NoAvailablePortError('No available port between {} and {}'.format(
2324
from_port, to_port))
25+
26+
27+
def is_ci():
28+
"""Returns if current execution is running on CI
29+
30+
Returns:
31+
bool: `True` if current executions is on CI
32+
"""
33+
return os.getenv('CI', 'false') == 'true'

0 commit comments

Comments
 (0)