Skip to content

Commit

Permalink
[email protected] - updated load function (#1900)
Browse files Browse the repository at this point in the history
* new load function added

* reverted chromedriver change

* updated date in changelog

Co-authored-by: Lizzie Turney <[email protected]>
  • Loading branch information
LTurns and Lizzie Turney authored Jun 6, 2022
1 parent 82b468c commit 9c33d91
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
8 changes: 8 additions & 0 deletions packages/services/f-wdio-utils/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

v0.10.0
------------------------------
*June 1, 2022*

### Changed
- load function to take in storybook args as objects


v0.9.0
------------------------------
*May 24, 2022*
Expand Down
2 changes: 1 addition & 1 deletion packages/services/f-wdio-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@justeat/f-wdio-utils",
"description": "Fozzie Wdio Utils - webdriverIO page object",
"version": "0.9.0",
"version": "0.10.0",
"files": [
"src/"
],
Expand Down
13 changes: 8 additions & 5 deletions packages/services/f-wdio-utils/src/page.object.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ class Page {
this.path = '';
}

load (component) {
const pageUrl = buildUrl(this.componentType, this.componentName, this.path);
load (component, queries) {
const pageUrl = buildUrl(this.componentType, this.componentName, this.composePath(queries));
this.open(pageUrl);
this.waitForComponent(component);
}
Expand All @@ -26,9 +26,12 @@ class Page {
component.waitForExist({ timeout: timeoutMs });
}

withQuery (name, value) {
this.path += `&${name}=${value}`;
return this;
composePath (queries) {
if (!queries) { return ''; }

return `&args=${Object.keys(queries)
.map(name => `${name}:${queries[name]}`)
.join(';')}`;
}

/**
Expand Down

0 comments on commit 9c33d91

Please sign in to comment.