Skip to content

Commit

Permalink
Merge pull request #318 from NativeScript/svetoslavtsenov/fix-tslint-…
Browse files Browse the repository at this point in the history
…error

fix: tslint error
  • Loading branch information
SvetoslavTsenov committed Aug 9, 2018
2 parents 51b0787 + 687d4b1 commit 0486e08
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 20 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -47,7 +47,7 @@ matrix:
os: linux
node_js: "8"
script:
- npm i -g appium@1.8.0
# - npm i -g appium@1.8.0
- npm i
- travis_retry npm run e2e -- --runType android23 --sauceLab --appPath $ANDROID_PACKAGE
- os: linux
Expand All @@ -56,7 +56,7 @@ matrix:
language: node_js
node_js: "8"
script:
- npm i -g appium@1.8.0
# - npm i -g appium@1.8.0
- npm i
- travis_wait travis_retry npm run e2e -- --runType sim.iPhone8 --sauceLab --appPath $IOS_PACKAGE
android:
Expand Down
2 changes: 1 addition & 1 deletion app/login/login.component.ts
Expand Up @@ -96,7 +96,7 @@ export class LoginComponent implements OnInit {
this.toggleDisplay();
},
(errorDetails) => {
if (errorDetails.error && errorDetails.error.error == "UserAlreadyExists") {
if (errorDetails.error && errorDetails.error.error === "UserAlreadyExists") {
alert("This email address is already in use.");
} else {
alert("Unfortunately we were unable to create your account.");
Expand Down
21 changes: 8 additions & 13 deletions e2e/groceries.e2e.ts
@@ -1,10 +1,5 @@
import { AppiumDriver, createDriver, SearchOptions } from "nativescript-dev-appium";
import { isSauceLab, runType, capabilitiesName } from "nativescript-dev-appium/lib/parser";
import { expect } from "chai";
import { ImageOptions } from "nativescript-dev-appium/lib/image-options";

const isSauceRun = isSauceLab;
const isAndroid: string = runType.includes("android");

describe("Groceries", async function () {
let driver: AppiumDriver;
Expand All @@ -26,7 +21,7 @@ describe("Groceries", async function () {
const forgotPasswordFormText = "reset";

const clickOnCrossOrCheckboxBtn = async () => {
if (isAndroid) {
if (driver.isAndroid) {
// First image is the menu, second is the cross button. The rest are pairs checkbox/bin per list item.
const allImages = await driver.findElementsByClassName(driver.locators.image);
await allImages[2].click(); // Checkbox button
Expand All @@ -36,7 +31,7 @@ describe("Groceries", async function () {
};

const clickOnBinButton = async () => {
if (isAndroid) {
if (driver.isAndroid) {
// First image is the menu, second is the cross button. The rest are pairs checkbox/bin per list item.
const allImages = await driver.findElementsByClassName(driver.locators.image);
for (let i = 3; i < allImages.length; i = i + 2) {
Expand All @@ -56,7 +51,7 @@ describe("Groceries", async function () {
});

after(async () => {
if (isSauceRun) {
if (driver.nsCapabilities.isSauceLab) {
driver.sessionId().then(function (sessionId) {
console.log("Report: https://saucelabs.com/beta/tests/" + sessionId);
});
Expand All @@ -68,11 +63,11 @@ describe("Groceries", async function () {
it("should log in", async () => {
const loginButton = await driver.findElementByText(loginButtonText, SearchOptions.exact);
await loginButton.click();
if (isAndroid) {
if (driver.isAndroid) {
const allFields = await driver.findElementsByClassName(driver.locators.getElementByName("textfield"));
await allFields[0].sendKeys(email);
await allFields[1].sendKeys(password);
if (isSauceLab) {
if (driver.nsCapabilities.isSauceLab) {
await driver.driver.hideDeviceKeyboard("Done");
}
} else {
Expand Down Expand Up @@ -141,7 +136,7 @@ describe("Groceries", async function () {

it("should log off", async () => {
// First image is the menu, second is the clock/cross button. The rest are pairs checkbox/bin per list item.
await driver.driver.sleep(2000);
await driver.sleep(2000);
const allImages = await driver.findElementsByClassName(driver.locators.image);
await allImages[0].click(); // Menu button
const logOffButton = await driver.findElementByText(logOffButtonText);
Expand All @@ -155,8 +150,8 @@ describe("Groceries", async function () {
await loginButton.click();
const usernameField = await driver.findElementByClassName(driver.locators.getElementByName("textfield"));
await usernameField.sendKeys(invalidEmail);
if (isAndroid) {
if (isSauceLab) {
if (driver.isAndroid) {
if (driver.nsCapabilities.isSauceLab) {
await driver.driver.hideDeviceKeyboard("Done");
}
} else {
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -34,7 +34,7 @@
"publish-ios-bundle": "npm run ns-bundle --ios --publish-app",
"generate-android-snapshot": "generate-android-snapshot --targetArchs arm,arm64,ia32 --install",
"e2e": "tsc -p e2e && mocha --opts ./e2e/config/mocha.opts",
"compile-tests": "tsc -p e2e --watch"
"watch-tests": "tsc -p e2e --watch"
},
"dependencies": {
"@angular/common": "~6.0.6",
Expand Down Expand Up @@ -72,10 +72,10 @@
"karma-nativescript-launcher": "^0.4.0",
"lazy": "1.0.11",
"nativescript-css-loader": "~0.26.0",
"nativescript-dev-appium": "4.0.0",
"nativescript-dev-appium": "~4.0.6",
"nativescript-dev-typescript": "^0.6.0",
"nativescript-dev-webpack": "^0.14.0",
"tslint": "^5.4.2",
"typescript": "~2.7.2"
}
}
}
3 changes: 2 additions & 1 deletion tsconfig.json
Expand Up @@ -21,6 +21,7 @@
},
"exclude": [
"node_modules",
"platforms"
"platforms",
"e2e"
]
}

0 comments on commit 0486e08

Please sign in to comment.