| 
									
										
										
										
											2016-10-06 23:25:52 +01:00
										 |  |  | 'use strict'; // necessary for es6 output in node 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import { browser, element, by } from 'protractor'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-30 11:05:09 -07: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 11:05:09 -07: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 11:05:09 -07: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 11:05:09 -07:00
										 |  |  |       expect(emailElement.getAttribute('value')).toEqual(email); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-06-08 01:06:25 +02:00
										 |  |  |       element(by.css('select option[value="solid"]')).click(); | 
					
						
							| 
									
										
										
										
											2016-05-30 11:05:09 -07: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); | 
					
						
							|  |  |  |       }); | 
					
						
							|  |  |  |   }); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | }); |