-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[email protected] - Introduced a new base page to reduce client code (
#1909) * Introduced a new base page to reduce client code * Updated ver. Co-authored-by: billy.oliver <[email protected]>
- Loading branch information
1 parent
c013731
commit f6d9263
Showing
4 changed files
with
37 additions
and
5 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
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,24 @@ | ||
const Page = require('./page.object'); | ||
const { buildUrl } = require('./storybook-extensions'); | ||
|
||
class BasePage extends Page { | ||
get component () { | ||
return $(`[${this.componentTag}='${this.componentName}']`); | ||
} | ||
|
||
async load (queries) { | ||
const pageUrl = buildUrl(this.componentType, this.componentName, this.composePath(queries)); | ||
this.open(pageUrl); | ||
await this.waitForComponent(); | ||
} | ||
|
||
async waitForComponent (timeoutMs = 500) { | ||
await this.component.waitForExist({ timeout: timeoutMs }); | ||
} | ||
|
||
isComponentDisplayed () { | ||
return this.component.isDisplayed(); | ||
} | ||
} | ||
|
||
module.exports = BasePage; |
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