-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #19: introduce intention revealing UI element specific helper f…
…unctions: - page component helper methods
- Loading branch information
1 parent
fe3299b
commit 5fc43e6
Showing
3 changed files
with
53 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,31 @@ | ||
//textField(page, SEL.FORM_FIELD_ADDRESS).enter(testData.address) | ||
|
||
//await waitClickAndType(page, SEL.FORM_FIELD_ADDRESS, testData.address); | ||
//await waitForTimeout(page, 10); | ||
import { waitClickAndType, waitForSelector, waitForSelectorAndClick } from '../puppeteerExtensions'; | ||
import { cssSel } from '../../src/shared/e2e'; | ||
|
||
export const textField = (page, sel) => { | ||
return { | ||
enter(text) { | ||
return waitClickAndType(page, sel, text); | ||
}, | ||
ensurePresent() { | ||
return waitForSelector(page, sel); | ||
}, | ||
}; | ||
} | ||
|
||
export const element = (page, sel) => { | ||
return { | ||
ensurePresent() { | ||
return waitForSelector(page, sel); | ||
}, | ||
click() { | ||
return waitForSelectorAndClick(page, sel); | ||
}, | ||
expectDisabled() { | ||
return waitForSelector(page, cssSel(sel).mod('[disabled]')) | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
//await addressField(page).enter(testData.address); | ||
|
||
import { element, textField } from '../helpers'; | ||
import { SEL } from '../selectors'; | ||
|
||
export const addressField = page => textField(page, SEL.FORM_FIELD_ADDRESS); | ||
export const timeField = page => textField(page, SEL.FORM_FIELD_TIME); | ||
export const addressAndTimeForm = page => element(page, SEL.FORM_PICK_ADDRESS_TIME) | ||
export const addressAndTimeFormSubmitButton = page => element(page, SEL.BTN_SUBMIT_FORM_PICK_ADDRESS_TIME); | ||
export const spinIcon = page => element(page, SEL.ICON_SPIN); |