Skip to content

Commit 457dbd1

Browse files
Zdravko BranzovZdravko Branzov
Zdravko Branzov
authored and
Zdravko Branzov
committed
chore: update tests in the repo to be runnable in saucelabs
1 parent 720a6a6 commit 457dbd1

35 files changed

+56
-19
lines changed

Diff for: e2e/animation-examples/e2e/pages/animation-with-options-page.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export class AnimationWithOptionsPage extends BasePage {
2020
}
2121

2222
async animatedBtn() {
23-
await this._driver.findElementsByAccessibilityId("animatedBtn", 10000);
2423
return await this._driver.findElementByAccessibilityIdIfExists("animatedBtn");
2524
}
2625

@@ -30,7 +29,8 @@ export class AnimationWithOptionsPage extends BasePage {
3029
}
3130

3231
async waitElementToHide() {
33-
return await this.waitElementTo(() => this.animatedBtn(), false, 10000);
32+
await this._driver.wait(2000);
33+
return await this._driver.findElementByAccessibilityIdIfExists("animatedBtn");
3434
}
3535

3636
async assertPositionOfToggleAnimationBtn() {
Loading
Loading
Loading
Loading

Diff for: e2e/animation-examples/e2e/smoke.e2e-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe("smoke-tests", async function () {
8787
await animationWithOptionsPage.enterExample();
8888
await animationWithOptionsPage.toggleAnimation();
8989
const result = await animationWithOptionsPage.waitElementToHide();
90-
assert.isFalse(result.isVisible, "The button should disappear!");
90+
assert.isUndefined(result, "The button should disappear!");
9191

9292
await animationWithOptionsPage.assertPositionOfToggleAnimationBtn();
9393
});

Diff for: e2e/config/appium.capabilities.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@
5656
"fullReset": false,
5757
"app": "",
5858
"idleTimeout": 120,
59-
"automationName": "Appium"
59+
"automationName": "Appium",
60+
"density":3.2,
61+
"offsetPixels":51
6062
},
6163
"android23": {
6264
"platformName": "Android",

Diff for: e2e/config/mocha.opts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--timeout 60000
1+
--timeout 120000
22
--recursive e2e
33
--reporter mochawesome
4-
--reporter-options quiet=true,html=true,inline=true,autoOpen=true
4+
--reporter-options quiet=true,html=true,inline=true
55
--exit

Diff for: e2e/renderer/e2e/ngfor.e2e-spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe("ngFor scenario", async function () {
5353
});
5454

5555
it("should place new elements in the right places", async function () {
56-
for (let i = 0; i < 5; i += 1) {
56+
for (let i = 0; i < 3; i += 1) {
5757
await addElement();
5858
await checkAppendedCorrectly();
5959
}
@@ -67,7 +67,7 @@ describe("ngFor scenario", async function () {
6767
});
6868

6969
it("should render new elements correctly after all old ones are removed", async function () {
70-
for (let i = 0; i < 5; i += 1) {
70+
for (let i = 0; i < 3; i += 1) {
7171
await addElement();
7272
await checkCorrectOrderAll();
7373
}

Diff for: e2e/renderer/e2e/ngforof.e2e-spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ describe("ngForOf scenario", function () {
7575
});
7676

7777
it("should render new elements correctly after all old ones are removed", async function () {
78-
for (let i = 0; i < 5; i += 1) {
78+
for (let i = 0; i < 3; i += 1) {
7979
await addElement();
8080
await checkCorrectOrderAll();
8181
}
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

Diff for: e2e/renderer/e2e/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
"experimentalDecorators": true,
66
"emitDecoratorMetadata": true,
77
"importHelpers": false,
8+
"sourceMap": true,
89
"types": [
910
"node",
1011
"mocha",
1112
"chai"
1213
],
1314
"lib": [
14-
"es6",
15+
"es2015",
1516
"dom"
1617
]
1718
}

Diff for: e2e/renderer/package.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
"readme": "NativeScript Application",
55
"repository": "<fill-your-repository-here>",
66
"nativescript": {
7-
"id": "org.nativescript.renderer",
8-
"tns-android": {
9-
"version": "6.0.1"
10-
}
7+
"id": "org.nativescript.renderer"
118
},
129
"dependencies": {
1310
"@angular/animations": "~8.2.0",

Diff for: e2e/routable-animations/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ test-results.xml
1414
tsconfig.esm.json
1515
webpack.config.js
1616

17+
# Tests
18+
/**/mochawesome-report
19+
Loading
Loading

Diff for: e2e/routable-animations/e2e/setup.ts

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
import { startServer, stopServer } from "nativescript-dev-appium";
1+
import { startServer, stopServer, ITestReporter, nsCapabilities, LogImageType } from "nativescript-dev-appium";
2+
const addContext = require('mochawesome/addContext');
3+
4+
const testReporterContext = <ITestReporter>{};
5+
testReporterContext.name = "mochawesome";
6+
testReporterContext.reportDir = "mochawesome-report";
7+
testReporterContext.log = addContext;
8+
testReporterContext.logImageTypes = [LogImageType.screenshots];
9+
nsCapabilities.testReporter = testReporterContext;
210

311
before("start server", async function () {
12+
nsCapabilities.testReporter.context = this;
413
await startServer();
514
});
615

716
after("stop server", async function () {
17+
nsCapabilities.testReporter.context = this;
818
await stopServer();
919
});

Diff for: e2e/routable-animations/e2e/tests.e2e.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
import { AppiumDriver, createDriver, SearchOptions } from "nativescript-dev-appium";
1+
import { AppiumDriver, createDriver, SearchOptions, nsCapabilities } from "nativescript-dev-appium";
22
import { assert } from "chai";
33

44
describe("sample scenario", () => {
55
const defaultWaitTime = 5000;
66
let driver: AppiumDriver;
77

88
before(async function () {
9+
nsCapabilities.testReporter.context = this;
910
driver = await createDriver();
1011
});
1112

Diff for: e2e/routable-animations/package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,10 @@
3333
"babylon": "6.17.4",
3434
"colors": "^1.1.2",
3535
"lazy": "1.0.11",
36+
"mocha": "~5.2.0",
37+
"mochawesome": "~3.1.2",
3638
"nativescript-css-loader": "~0.26.0",
37-
"nativescript-dev-appium": "^5.3.0",
39+
"nativescript-dev-appium": "next",
3840
"nativescript-dev-webpack": "next",
3941
"typescript": "~3.5.3"
4042
},

Diff for: e2e/routable-animations/tsconfig.json

+7
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@
2222
]
2323
}
2424
},
25+
"include": [
26+
"../../nativescript-angular",
27+
"**/*"
28+
],
2529
"exclude": [
30+
"../../nativescript-angular/node_modules",
31+
"../../nativescript-angular/**/*.d.ts",
2632
"node_modules",
2733
"platforms",
34+
"**/*.aot",
2835
"e2e"
2936
]
3037
}

Diff for: e2e/router/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"lazy": "1.0.11",
3737
"mocha": "~5.2.0",
3838
"mochawesome": "~3.1.2",
39-
"nativescript-dev-appium": "^5.3.0",
39+
"nativescript-dev-appium": "next",
4040
"nativescript-dev-webpack": "next",
4141
"tslib": "^1.7.1",
4242
"typescript": "~3.5.3"

Diff for: e2e/router/tsconfig.json

+7
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@
2222
]
2323
}
2424
},
25+
"include": [
26+
"../../nativescript-angular",
27+
"**/*"
28+
],
2529
"exclude": [
30+
"../../nativescript-angular/node_modules",
31+
"../../nativescript-angular/**/*.d.ts",
2632
"node_modules",
2733
"platforms",
34+
"**/*.aot",
2835
"e2e"
2936
]
3037
}

Diff for: e2e/single-page/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"lazy": "1.0.11",
3737
"mocha": "~5.2.0",
3838
"mochawesome": "~3.1.2",
39-
"nativescript-dev-appium": "^5.3.0",
39+
"nativescript-dev-appium": "next",
4040
"nativescript-dev-webpack": "next",
4141
"tslib": "^1.7.1",
4242
"typescript": "~3.5.3"

Diff for: e2e/single-page/tsconfig.json

+7
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@
2222
]
2323
}
2424
},
25+
"include": [
26+
"../../nativescript-angular",
27+
"**/*"
28+
],
2529
"exclude": [
30+
"../../nativescript-angular/node_modules",
31+
"../../nativescript-angular/**/*.d.ts",
2632
"node_modules",
2733
"platforms",
34+
"**/*.aot",
2835
"e2e"
2936
]
3037
}

0 commit comments

Comments
 (0)