Skip to content

Instantly share code, notes, and snippets.

@aposiker
Created January 13, 2021 08:49
export default class Page{
url: string
constructor (url:string) {
this.url = url
}
open(path: string){
browser.url(path)
}
}
import Page from './basePage'
class OffersPage extends Page {
constructor (){
super('/our-offers/')
}
open() {
super.open(this.url)
}
method1 (){
//somecode
}
method2 () {
//somecode
}
}
export {OffersPage}
import {OffersPage} from '../pages/offers'
const Offers = new OffersPage()
describe('Scenario 1', () => {
it('should check TC#1', () => {
Offers.open()
//some other method calls and checks
})
})
{
"compilerOptions": {
"sourceMap": true,
"module": "commonjs",
"target": "ES2017",
"resolveJsonModule": true,
"types": [
"node",
"@wdio/sync",
"@wdio/mocha-framework",
"@wdio/selenium-standalone-service"
]
},
"exclude": [
"node_modules"
],
"include": [
"./test/**/*"
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment