2016-10-06 18:25:52 -04:00
|
|
|
'use strict'; // necessary for es6 output in node
|
|
|
|
|
|
|
|
import { browser, element, by } from 'protractor';
|
|
|
|
|
2016-05-30 14:05:09 -04:00
|
|
|
/* tslint:disable:quotemark */
|
2016-03-05 17:53:34 -05:00
|
|
|
describe('Dynamic Form', function () {
|
|
|
|
|
|
|
|
beforeAll(function () {
|
|
|
|
browser.get('');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should submit form', function () {
|
2016-05-30 14:05:09 -04:00
|
|
|
let firstNameElement = element.all(by.css('input[id=firstName]')).get(0);
|
2016-03-05 17:53:34 -05:00
|
|
|
expect(firstNameElement.getAttribute('value')).toEqual('Bombasto');
|
2016-05-30 14:05:09 -04:00
|
|
|
|
|
|
|
let emailElement = element.all(by.css('input[id=emailAddress]')).get(0);
|
|
|
|
let email = 'test@test.com';
|
2016-03-05 17:53:34 -05:00
|
|
|
emailElement.sendKeys(email);
|
2016-05-30 14:05:09 -04:00
|
|
|
expect(emailElement.getAttribute('value')).toEqual(email);
|
|
|
|
|
2016-06-07 19:06:25 -04:00
|
|
|
element(by.css('select option[value="solid"]')).click();
|
2016-05-30 14:05:09 -04:00
|
|
|
|
|
|
|
let saveButton = element.all(by.css('button')).get(0);
|
2016-03-05 17:53:34 -05:00
|
|
|
saveButton.click().then(function(){
|
|
|
|
expect(element(by.xpath("//strong[contains(text(),'Saved the following values')]")).isPresent()).toBe(true);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|