Skip to content

Commit

Permalink
using sendKeys workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
lathonez committed Mar 16, 2016
1 parent 85d5110 commit 642973d
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions app/pages/clickerList/clickerList.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { ElementFinder } from 'protractor';
let clickerField: ElementFinder = element(by.css('.text-input'));
let clickerButton: ElementFinder = element.all(by.className('button')).first();
let removeButton: ElementFinder = element.all(by.css('.button-outline-danger')).first();
let clickerList: ElementFinder = element.all(by.className('clickerList')).first();
let firstClicker: ElementFinder = element.all(by.className('clickerList')).first();

describe('ClickerList', () => {
describe('firstClicker', () => {

beforeEach(() => {
browser.get('');
Expand All @@ -21,19 +21,20 @@ describe('ClickerList', () => {
expect(element(by.css('.text-input')).isPresent()).toEqual(true);
});

it('should add a new Clicker to the page', () => {
clickerField.sendKeys('deal with protractor');
it('should add a Clicker', () => {
'test clicker one'.split('').forEach((c) => clickerField.sendKeys(c))
clickerButton.click();
browser.sleep(1000)
.then(() => {
expect(clickerList.getText()).toContain('deal with protractor');
});
expect(firstClicker.getText()).toEqual('test clicker one (0)');
});

it('should delete a Clicker from the page when delete button selected', () => {
clickerField.sendKeys('master angular');
clickerButton.click();
removeButton.click();
expect(clickerList.getText()).not.toContain('master angular');
it('should click a Clicker', () => {
firstClicker.click()
expect(firstClicker.getText()).toEqual('test clicker one (1)')
});

it('should delete a Clicker', () => {
removeButton.click()
element.all(by.className('clickerList')).count()
.then((count) => expect(count).toEqual(0));
});
});

0 comments on commit 642973d

Please sign in to comment.