Created
January 23, 2017 09:16
-
-
Save VasilyStrelyaev/0fd685a6d0f8adf83661a98aa158a803 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Selector } from 'testcafe'; | |
const label = Selector('label'); | |
class Feature { | |
constructor (text) { | |
this.label = label.withText(text); | |
this.checkbox = this.label.find('input[type=checkbox]'); | |
} | |
} | |
class OperatingSystem { | |
constructor (text) { | |
this.label = label.withText(text); | |
this.radioButton = this.label.find('input[type=radio]'); | |
} | |
} | |
export default class Page { | |
constructor () { | |
this.nameInput = Selector('#developer-name'); | |
this.triedTestCafeCheckbox = Selector('#tried-test-cafe'); | |
this.populateButton = Selector('#populate'); | |
this.submitButton = Selector('#submit-button'); | |
this.results = Selector('.result-content'); | |
this.commentsTextArea = Selector('#comments'); | |
this.featureList = [ | |
new Feature('Support for testing on remote devices'), | |
new Feature('Re-using existing JavaScript code for testing'), | |
new Feature('Running tests in background and/or in parallel in multiple browsers'), | |
new Feature('Easy embedding into a Continuous integration system'), | |
new Feature('Advanced traffic and markup analysis') | |
]; | |
this.osList = [ | |
new OperatingSystem('Windows'), | |
new OperatingSystem('MacOS'), | |
new OperatingSystem('Linux') | |
]; | |
this.slider = { | |
handle: Selector('.ui-slider-handle'), | |
tick: Selector('.slider-value') | |
}; | |
this.interfaceSelect = Selector('#preferred-interface'); | |
this.interfaceSelectOption = this.interfaceSelect.find('option'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment