diff --git a/test/pageobjects/login.page.ts b/test/pageobjects/login.page.ts deleted file mode 100644 index b117fb0d69a4010dbbc099cd0204de107beb12a4..0000000000000000000000000000000000000000 --- a/test/pageobjects/login.page.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { ChainablePromiseElement } from 'webdriverio'; - -import Page from './page'; - -/** - * sub page containing specific selectors and methods for a specific page - */ -class LoginPage extends Page { - /** - * define selectors using getter methods - */ - public get inputUsername () { - return $('#username'); - } - - public get inputPassword () { - return $('#password'); - } - - public get btnSubmit () { - return $('button[type="submit"]'); - } - - /** - * a method to encapsule automation code to interact with the page - * e.g. to login using username and password - */ - public async login (username: string, password: string) { - await this.inputUsername.setValue(username); - await this.inputPassword.setValue(password); - await this.btnSubmit.click(); - } - - /** - * overwrite specific options to adapt it to page object - */ - public open () { - return super.open('login'); - } -} - -export default new LoginPage(); diff --git a/test/pageobjects/page.ts b/test/pageobjects/page.ts deleted file mode 100644 index fc8be33390079922c9d7db87a7f64785577008ec..0000000000000000000000000000000000000000 --- a/test/pageobjects/page.ts +++ /dev/null @@ -1,13 +0,0 @@ -/** -* main page object containing all methods, selectors and functionality -* that is shared across all page objects -*/ -export default class Page { - /** - * Opens a sub page of the page - * @param path path of the sub page (e.g. /path/to/page.html) - */ - public open (path: string) { - return browser.url(`https://the-internet.herokuapp.com/${path}`) - } -} diff --git a/test/pageobjects/secure.page.ts b/test/pageobjects/secure.page.ts deleted file mode 100644 index 35b7dca152ee70c79a79062c842454b07d2c7cb5..0000000000000000000000000000000000000000 --- a/test/pageobjects/secure.page.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { ChainablePromiseElement } from 'webdriverio'; - -import Page from './page'; - -/** - * sub page containing specific selectors and methods for a specific page - */ -class SecurePage extends Page { - /** - * define selectors using getter methods - */ - public get flashAlert () { - return $('#flash'); - } -} - -export default new SecurePage(); diff --git a/test/specs/example.e2e.ts b/test/specs/example.e2e.ts deleted file mode 100644 index 4f6453e7d1ee509011ed34c63e599d4bdd6e4a8e..0000000000000000000000000000000000000000 --- a/test/specs/example.e2e.ts +++ /dev/null @@ -1,15 +0,0 @@ -import LoginPage from '../pageobjects/login.page'; -import SecurePage from '../pageobjects/secure.page'; - -describe('My Login application', () => { - it('should login with valid credentials', async () => { - await LoginPage.open(); - - await LoginPage.login('tomsmith', 'SuperSecretPassword!'); - await expect(SecurePage.flashAlert).toBeExisting(); - await expect(SecurePage.flashAlert).toHaveTextContaining( - 'You logged into a secure area!'); - }); -}); - -