diff --git a/packages/services/f-wdio-utils/CHANGELOG.md b/packages/services/f-wdio-utils/CHANGELOG.md index b545571351..d171dbd1fe 100644 --- a/packages/services/f-wdio-utils/CHANGELOG.md +++ b/packages/services/f-wdio-utils/CHANGELOG.md @@ -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* diff --git a/packages/services/f-wdio-utils/package.json b/packages/services/f-wdio-utils/package.json index bd627df224..972c799f2f 100644 --- a/packages/services/f-wdio-utils/package.json +++ b/packages/services/f-wdio-utils/package.json @@ -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/" ], diff --git a/packages/services/f-wdio-utils/src/page.object.js b/packages/services/f-wdio-utils/src/page.object.js index c74df3dd28..511b97c4f0 100644 --- a/packages/services/f-wdio-utils/src/page.object.js +++ b/packages/services/f-wdio-utils/src/page.object.js @@ -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); } @@ -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(';')}`; } /**