Skip to content

Commit

Permalink
Added ESlint
Browse files Browse the repository at this point in the history
  • Loading branch information
VadimNastoyashchy committed Nov 30, 2022
1 parent 945f6e2 commit 9007bc5
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 19 deletions.
41 changes: 41 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
},
plugins: [
"@typescript-eslint",
"wdio"
],
rules: {
"quotes": [
"error",
"double",
{
"allowTemplateLiterals": true
}
],
"no-trailing-spaces": "error",
"@typescript-eslint/typedef": [
"error",
{
"parameter": true
}
],
"@typescript-eslint/semi": [
"error"
],
"@typescript-eslint/explicit-function-return-type": ["error"]
},
extends: [
"plugin:wdio/recommended",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
],
};
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@

> Before you follow the steps below, make sure you have the
[Node.js](https://nodejs.org/en/download/) installed _globally_ only your system
>
[Android Studio](https://developer.android.com/studio)

[Appium Server](https://appium.io/)

[Appium Inspector](https://github.com/appium/appium-inspector)

Install all the necessary dependency using npm :
Expand Down
21 changes: 10 additions & 11 deletions config/wdio-android.conf.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {join} from 'path';
import {join} from "path";

exports.config = {

autoCompileOpts: {
autoCompile: true,
tsNodeOpts: {
transpileOnly: true,
project: 'test/tsconfig.json'
project: "test/tsconfig.json"
}
},
//
Expand All @@ -26,16 +26,15 @@ exports.config = {
maxInstances: 1,
capabilities: [
{
platformName: 'Android',
platformName: "Android",
maxInstances: 1,
'appium:deviceName': 'Pixel_3_10.0',
'appium:platformVersion': '10.0',
'appium:orientation': 'PORTRAIT',
'appium:automationName': 'UiAutomator2',
'appium:app': join(process.cwd(), './app/Android.SauceLabs.Mobile.Sample.app.2.7.1.apk'),
// @ts-ignore
'appium:appWaitActivity': 'com.swaglabsmobileapp.MainActivity',
'appium:newCommandTimeout': 240,
"appium:deviceName": "Pixel_3_10.0",
"appium:platformVersion": "10.0",
"appium:orientation": "PORTRAIT",
"appium:automationName": "UiAutomator2",
"appium:app": join(process.cwd(), "./app/Android.SauceLabs.Mobile.Sample.app.2.7.1.apk"),
"appium:appWaitActivity": "com.swaglabsmobileapp.MainActivity",
"appium:newCommandTimeout": 240,
},
],
//
Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
"chromedriver": "^106.0.1",
"wdio-chromedriver-service": "^8.0.0",
"ts-node": "^10.8.0",
"typescript": "^4.6.4"
"typescript": "^4.6.4",
"@typescript-eslint/eslint-plugin": "5.38.1",
"@typescript-eslint/parser": "5.38.1",
"eslint": "8.24.0",
"eslint-plugin-wdio": "7.21.0"
},
"scripts": {
"wdioAndroid": "wdio run config/wdio-android.conf.ts"
Expand Down
14 changes: 7 additions & 7 deletions test/specs/android/logIn.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
describe("My Login Demo", () => {
beforeEach(async () => {
await $("~open menu").click();
await $('//*[@text="Log In"]').click();
});

it("should not login with invalid credentials", async () => {
describe("Log in tests", () => {
// beforeEach(async () => {
// await $("~open menu").click();
// await $('//*[@text="Log In"]').click();
// });

it("", async () => {
await $("~test-Username")
});
});

0 comments on commit 9007bc5

Please sign in to comment.