Skip to content

Instantly share code, notes, and snippets.

@uLucasFraga
Last active July 4, 2018 12:55
Show Gist options
  • Save uLucasFraga/d82a6809d1bae5abbb71037cb61c3072 to your computer and use it in GitHub Desktop.
Save uLucasFraga/d82a6809d1bae5abbb71037cb61c3072 to your computer and use it in GitHub Desktop.
ARQUIVO PAGE-OBJECTS
'use strict'
// protractor/features/pages/calculator_po.js
class CalculadoraPage {
constructor() {
this.firstField = element(by.model('first')),
this.secondField = element(by.model('second')),
this.goButton = element(by.id('gobutton')),
this.colResult = element(by.cssContainingText('.table', 'Result')),
this.result = element(by.binding('latest')),
this.table = element(by.css('.table th')),
this.sub = element(by.cssContainingText('option', '-'))
}
visit() {
return browser.get('')
}
adicionar(one, two) {
this.firstField.clear();
this.firstField.sendKeys(one);
this.secondField.clear();
this.secondField.sendKeys(two);
return this.goButton.click();
}
subtrair(one, two) {
this.firstField.clear();
this.firstField.sendKeys(one);
this.secondField.clear();
this.secondField.sendKeys(two);
this.sub.click();
return this.goButton.click();
}
};
module.exports = CalculadoraPage;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment