Skip to content

Instantly share code, notes, and snippets.

View luizaguerra's full-sized avatar

Luiza Guerra luizaguerra

View GitHub Profile
suites: {
login: 'tests/e2e/login/**/*Spec.js',
transacoes: [
'tests/e2e/transacao_boleto/**/*Spec.js',
'tests/e2e/transacao_cartao/**/*Spec.js'
]
},
var ApiPage = require('./page-object/apiPage.po.js');
var NgBindPage = require('./page-object/ngBindPage.po.js');
var TextAreaPage = require('./page-object/textareaPage.po.js');
describe('Protractor Demo App', function() {
var apiPage = new ApiPage();
var ngBindPage = new NgBindPage();
var textAreaPage = new TextAreaPage();
beforeEach(function() {
var TextAreaPage = function(){
this.title = 'AngularJS: API: textarea';
this.searchTextArea = element(by.linkText('textarea'));
}
module.exports = TextAreaPage;
var NgBindPage = function(){
this.title = 'AngularJS: API: ngBind';
}
module.exports = NgBindPage;
var ApiPage = function(){
this.title = 'AngularJS: API: API Reference'
this.dirNgBind = element(by.linkText('ngBind'));
this.searchField = element(by.name('as_q'));
};
ApiPage.prototype.visit = function(){
browser.get('https://docs.angularjs.org/api');
};
@luizaguerra
luizaguerra / first_spec.js
Created October 27, 2017 15:32
first_spec.js
describe('Protractor Demo App', function() {
beforeEach(function() {
browser.get('https://docs.angularjs.org/api');
browser.driver.manage().window().maximize();
});
it('Deve conter um título', function() {
expect(browser.getTitle()).toEqual('AngularJS: API: API Reference');
});
@luizaguerra
luizaguerra / locators_spec.js
Last active October 23, 2017 19:34
locators_spec.js
describe('Locators', function(){
beforeEach(function() {
browser.get('http://juliemr.github.io/protractor-demo/');
browser.driver.manage().window().maximize();
});
it('should locate an element by model', function() {
var firstField = element(by.model('first'));
expect(firstField.isPresent()).toBe(true);
});
@luizaguerra
luizaguerra / ngRepeater.js
Created October 23, 2017 18:14
ngRepeater
it('should locate an element by repeater', function() {
var history = element.all(by.repeater('result in memory'));
var firstField = element(by.model('first'));
var secondField = element.all(by.css('.input-small.ng-pristine.ng-untouched.ng-valid')).get(0);
var goButton = element(by.id('gobutton'));
firstField.sendKeys(2);
secondField.sendKeys(3);
goButton.click();
expect(history.count()).toEqual(1);
@luizaguerra
luizaguerra / ngModel.js
Created October 23, 2017 18:13
ngModel
it('should locate an element by model', function() {
var firstField = element(by.model('first'));
expect(firstField.isPresent()).toBe(true);
});
@luizaguerra
luizaguerra / ngBind.js
Created October 23, 2017 18:09
ngBind
it('should locate an element by binding', function() {
var latestResult = element(by.binding('latest'));
expect(latestResult.isPresent()).toBe(true);
});