angular/aio/content/examples/dynamic-form/e2e/src/app.e2e-spec.ts
dario-piotrowicz 835987b78b refactor(docs-infra): use eslint in aio's example-lint script (#43218)
Instead of the deprecated tslint use eslint in the aio's example-lint
script

PR Close #43218
2021-12-15 12:28:46 -05:00

21 lines
815 B
TypeScript

import { browser, element, by } from 'protractor';
describe('Dynamic Form', () => {
beforeAll(() => browser.get(''));
it('should submit form', async () => {
const firstNameElement = element.all(by.css('input[id=firstName]')).get(0);
expect(await firstNameElement.getAttribute('value')).toEqual('Bombasto');
const emailElement = element.all(by.css('input[id=emailAddress]')).get(0);
const email = 'test@test.com';
await emailElement.sendKeys(email);
expect(await emailElement.getAttribute('value')).toEqual(email);
await element(by.css('select option[value="solid"]')).click();
await element.all(by.css('button')).get(0).click();
expect(await element(by.cssContainingText('strong', 'Saved the following values')).isPresent()).toBe(true);
});
});