Last active
April 14, 2017 17:31
-
-
Save cs3b/dd93b3e87cdf23f4f6598461421c561f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { clickable, create, fillable, visitable, collection } from 'ember-cli-page-object'; | |
| const newForm = '.card-header'; | |
| const rows = 'tbody > tr'; | |
| const expandedRow = `${rows}.lt-expanded-row`; | |
| function formObject(scope) { | |
| return create({ | |
| scope, | |
| fillExternalNumber: fillable('input', { at: 1 }), | |
| fillCompany: fillable('input', { at: 2 }), | |
| fillCategory: fillable('input', { at: 4 }), | |
| clickFirstSuggestion: clickable('.md-autocomplete-suggestions li', { resetScope: true }), | |
| selectCompany(company) { | |
| return this.fillCompany(company).clickFirstSuggestion(); | |
| }, | |
| selectCategory(category) { | |
| return this.fillCategory(category).clickFirstSuggestion(); | |
| }, | |
| submit: clickable('button') | |
| }); | |
| } | |
| export default create({ | |
| visit: visitable('/mail-logs'), | |
| formNew() { | |
| return formObject(newForm); | |
| }, | |
| mailLogs: collection({ | |
| itemScope: rows, | |
| item: { | |
| formEdit() { | |
| return formObject(expandedRow); | |
| } | |
| } | |
| }) | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment