Skip to content

Commit

Permalink
spec cleanup (unsure if valid js though)
Browse files Browse the repository at this point in the history
  • Loading branch information
coilysiren committed Mar 9, 2018
1 parent 461b296 commit a7a6fd7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions protractor/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,15 @@ describe('Valkyrie Demo', () => {
expect(article(1).isPresent()).toBeTruthy();
expect(article(2).isPresent()).toBeFalsy();
// we click the "next" button in the 1st article
article(1).$('button:contains("next")').click();
article(1).next();
// and now a second article is visible
expect(article(2).isPresent()).toBeTruthy();
})

function article(index) {
return $(`step-root > *:nth-child(0n+${index})`)
this = $(`step-root > *:nth-child(${index}) article`);
this.next = () => { this.$('button:contains("next")').click(); }
return this
}

});

0 comments on commit a7a6fd7

Please sign in to comment.