Skip to content

Commit 04cae3b

Browse files
Dimitar TodorovDimitar Todorov
authored andcommitted
fix: travis.yml for ios app
1 parent f19c6f1 commit 04cae3b

File tree

3 files changed

+22
-17
lines changed

3 files changed

+22
-17
lines changed

.travis.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ matrix:
4646
script:
4747
- cd src && npm run build.iosOnly
4848
- cd ../demo-vue && npm i && tns build ios --bundle --env.uglify
49+
- cd $IOS_PACKAGE_FOLDER_VUE && zip -r $IOS_PACKAGE_VUE demovue.app
50+
- "curl -u $SAUCE_USER:$SAUCE_KEY -X POST -H 'Content-Type: application/octet-stream' $IOS_SAUCE_STORAGE/$IOS_PACKAGE_VUE?overwrite=true --data-binary @$IOS_PACKAGE_FOLDER_VUE/$IOS_PACKAGE_VUE"
4951
- os: osx
5052
env:
5153
- WebpackiOS="12.0"
@@ -147,7 +149,7 @@ matrix:
147149
script:
148150
- npm i -g appium
149151
- cd demo && npm i
150-
- travis_retry npm run e2e -- --runType android24 --sauceLab --reuseDevice --appPath $ANDROID_PACKAGE_JS
152+
- travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_JS
151153
- os: linux
152154
env:
153155
- Android="24"
@@ -158,7 +160,7 @@ matrix:
158160
script:
159161
- npm i -g appium
160162
- cd demo-vue && npm i
161-
- travis_retry npm run e2e -- --runType android24 --sauceLab --reuseDevice --appPath $ANDROID_PACKAGE_VUE
163+
- travis_wait travis_retry npm run e2e -- --runType android24 --sauceLab --appPath $ANDROID_PACKAGE_VUE
162164
- os: linux
163165
env:
164166
- iOS="12.0"
@@ -168,7 +170,7 @@ matrix:
168170
script:
169171
- npm i -g appium
170172
- cd demo && npm i
171-
- travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --reuseDevice --appPath $IOS_PACKAGE_JS
173+
- travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --appPath $IOS_PACKAGE_JS
172174
- os: linux
173175
env:
174176
- iOS="12.0"
@@ -178,7 +180,7 @@ matrix:
178180
script:
179181
- npm i -g appium
180182
- cd demo-vue && npm i
181-
- travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --reuseDevice --appPath $IOS_PACKAGE_VUE
183+
- travis_wait travis_retry npm run e2e -- --runType sim12iPhoneX --sauceLab --appPath $IOS_PACKAGE_VUE
182184

183185
android:
184186
components:

demo-vue/e2e/test.e2e.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ describe("Facebook tests", async function () {
3535

3636
it("should log in via custom button", async function () {
3737
if (isAndroid) {
38-
var userNameLabelElement = "[@text='Nativescript User']";
38+
var userNameLabelElement = "Nativescript User";
3939
} else {
4040
var userNameLabelElement = "[@name='Nativescript User']";
4141
}
@@ -44,12 +44,14 @@ describe("Facebook tests", async function () {
4444
await facebookButton.click();
4545

4646
if (isAndroid) {
47-
const allFields = await driver.findElementsByClassName(driver.locators.getElementByName("textfield"));
47+
await driver.wait(1000);
48+
const allFields = await driver.findElementsByClassName("android.widget.EditText");
49+
// driver.locators.getElementByName("android.widget.EditText")
4850
const wd = driver.wd();
4951
const action = new wd.TouchAction(driver.driver);
5052
action
51-
.press({ x: 52, y: 499 })
52-
.moveTo({ x: -2, y: -294 })
53+
.press({ x: 380, y: 720 })
54+
.moveTo({ x: 380, y: 410 })
5355
.release();
5456
await action.perform();
5557
await driver.wait(1000);
@@ -73,19 +75,17 @@ describe("Facebook tests", async function () {
7375
if (isAndroid) {
7476
const logInButton = await driver.findElementByClassName(driver.locators.button);
7577
await logInButton.click();
76-
const continueButton = await driver.findElementByText("Continue");
78+
const continueButton = await driver.findElementByAccessibilityId("Continue");
7779
await continueButton.click();
7880
} else {
7981
const logInButton = await driver.findElementByText("Log In");
8082
await logInButton.click();
8183
const continueButton = await driver.findElementByText("Continue");
8284
await continueButton.click();
8385
}
84-
const userNameLabel = await driver.findElementByXPath(
85-
"//" + driver.locators.getElementByName("label") + userNameLabelElement
86-
);
87-
const userName = await userNameLabel.text();
88-
expect(userName).to.equal(USER_NAME, "Not logged with the same user");
86+
await driver.wait(1000);
87+
const userNameLabel = await driver.findElementByText("Nativescript User", SearchOptions.contains);
88+
expect(userNameLabel).to.exist;
8989
});
9090

9191
it("should log out via custom button", async function () {
@@ -102,6 +102,9 @@ describe("Facebook tests", async function () {
102102
const allFields = await driver.findElementsByClassName(driver.locators.getElementByName("textfield"));
103103
await allFields[1].sendKeys(PASSWORD);
104104
await allFields[0].sendKeys(USERNAME);
105+
try {
106+
await driver.driver.hideDeviceKeyboard("Done");
107+
} catch (error) { }
105108
const logInButton = await driver.findElementByClassName(driver.locators.button);
106109
await logInButton.click();
107110
} else {

demo-vue/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@
1818
"tns-core-modules": "~5.1.0"
1919
},
2020
"devDependencies": {
21+
"@babel/core": "~7.1.0",
22+
"@babel/preset-env": "~7.1.0",
2123
"@types/chai": "^4.1.3",
2224
"@types/mocha": "^5.2.0",
2325
"@types/node": "^10.1.2",
24-
"@babel/core": "~7.1.0",
25-
"@babel/preset-env": "~7.1.0",
26+
"babel-loader": "~8.0.0",
2627
"chai": "~4.1.2",
2728
"chai-as-promised": "~7.1.1",
2829
"karma": "^2.0.2",
2930
"karma-nativescript-launcher": "^0.4.0",
3031
"mocha": "~5.2.0",
31-
"babel-loader": "~8.0.0",
3232
"nativescript-dev-appium": "^4.0.9",
3333
"nativescript-dev-typescript": "~0.7.0",
3434
"nativescript-dev-webpack": "~0.19.0",

0 commit comments

Comments
 (0)