Skip to content

Commit 7dd4b0e

Browse files
committed
Fix Appium tests by tweaking timeouts.
- Switch to Node 6.4.0 for Travis. - Add explicit timeouts in appium test initial waits. - Get rid of explicit platform add.
1 parent 4fa1649 commit 7dd4b0e

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

.travis.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
env:
22
global:
3-
- NODE_VERSION=4.4.7
3+
- NODE_VERSION=6.4.0
44
- DATE=$(date +%Y-%m-%d)
55
- PACKAGE_VERSION=$DATE-$TRAVIS_BUILD_NUMBER
66

@@ -22,7 +22,7 @@ before_cache:
2222

2323
cache:
2424
directories:
25-
- .nvm
25+
- $HOME/.nvm
2626
- $HOME/.gradle/caches/
2727
- $HOME/.gradle/wrapper/
2828

@@ -41,14 +41,14 @@ install:
4141

4242
before_script:
4343
- echo no | android create avd --force -n test -t android-19 -b armeabi-v7a
44-
- emulator -avd test -no-audio -no-window &
45-
- android-wait-for-emulator
44+
- emulator -memory 1024 -avd test -no-audio -no-window &
4645

4746
script:
48-
- tns platform add android
4947
- # DISABLE KARMA TESTS - hanging the build on Travis
5048
- # tns test android --emulator --justlaunch
51-
- npm run appium-android
49+
- tns build android
50+
- android-wait-for-emulator
51+
- npm run run-appium-android
5252

5353
before_deploy:
5454
- cd ../nativescript-angular

tests/e2e-tests/multi-page-routing.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
var nsAppium = require("nativescript-dev-appium");
33

44
describe("multi page routing", function () {
5-
this.timeout(120000);
5+
this.timeout(360000);
66
var driver;
77

88
before(function () {
@@ -19,6 +19,7 @@ describe("multi page routing", function () {
1919

2020
it("loads default path", function () {
2121
return driver
22+
.waitForElementByAccessibilityId("first-multi-page", 300000)
2223
.elementByAccessibilityId("first-multi-page")
2324
.should.eventually.exist
2425
.text().should.eventually.equal("First: multi-page")
@@ -31,6 +32,7 @@ describe("multi page routing", function () {
3132
"second.destroy"] // <-- back (first component is reused)
3233
.join(",");
3334
return driver
35+
.waitForElementByAccessibilityId("first-navigate-multi-page", 300000)
3436
.elementByAccessibilityId("first-navigate-multi-page")
3537
.should.eventually.exist
3638
.tap()

tests/e2e-tests/single-page-routing.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
var nsAppium = require("nativescript-dev-appium");
33

44
describe("single page routing", function () {
5-
this.timeout(120000);
5+
this.timeout(360000);
66
var driver;
77

88
before(function () {
@@ -19,6 +19,7 @@ describe("single page routing", function () {
1919

2020
it("loads default path", function () {
2121
return driver
22+
.waitForElementByAccessibilityId("first-single-page", 300000)
2223
.elementByAccessibilityId("first-single-page")
2324
.should.eventually.exist
2425
.text().should.eventually.equal("First: single-page")
@@ -33,6 +34,7 @@ describe("single page routing", function () {
3334
"first.init"].join(",");
3435

3536
return driver
37+
.waitForElementByAccessibilityId("first-single-page", 300000)
3638
.elementByAccessibilityId("first-navigate-single-page")
3739
.should.eventually.exist
3840
.tap()

tests/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@
6464
},
6565
"scripts": {
6666
"updateTests": "grunt updateTests",
67-
"appium-android": "tns build android && nativescript-dev-appium android",
67+
"appium-android": "tns build android && npm run run-appium-android",
68+
"run-appium-android": "nativescript-dev-appium android",
6869
"appium-ios-simulator": "tns build ios && nativescript-dev-appium ios-simulator"
6970
}
70-
}
71+
}

0 commit comments

Comments
 (0)