Skip to content

Commit

Permalink
Added Screens and config folders
Browse files Browse the repository at this point in the history
  • Loading branch information
Damjan Smickovski authored and Damjan Smickovski committed Jun 27, 2023
1 parent 9d7bef9 commit fbcb033
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 2 deletions.
File renamed without changes.
1 change: 1 addition & 0 deletions src/config/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './appium-conf'
23 changes: 23 additions & 0 deletions src/screens/Settings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@



export default class SettingsScreen {
public batteryButton = '//*[@text="Battery"]';

constructor() {
// Configuration
}

// Some example methods
public async openBatterySettings() {
throw new Error("Not implemented");
};

public async getBatteryLevel() {
throw new Error("Not implemented");
};
}



export const settingsScreen = new SettingsScreen();
1 change: 1 addition & 0 deletions src/screens/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Settings'
6 changes: 4 additions & 2 deletions src/tests/settingsTest.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@

const { remote } = require('webdriverio');
import { getConfig } from '../../appium-conf';
import SettingsScreen from '@screens/Settings';
import { getConfig } from '@config/appium-conf';

describe("Settings suite", async () => {
const config = getConfig('android');
const settingsScreen = new SettingsScreen();

it("Should open settings -> Battery", async () => {
const driver = await remote(config);
try {
const batteryItem = await driver.$('//*[@text="Battery"]');
const batteryItem = await driver.$(settingsScreen.batteryButton);
await batteryItem.click();
} finally {
await driver.pause(1000);
Expand Down
6 changes: 6 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@
"outDir": "dist",
"baseUrl": "./src",
"paths": {
"@config/*": [
"config/*"
],
"@tests/*": [
"tests/*"
],
"@screens/*": [
"screens/*"
]
},
"strict": true
},
Expand Down

0 comments on commit fbcb033

Please sign in to comment.