Skip to content

Commit

Permalink
chore: change option naming
Browse files Browse the repository at this point in the history
  • Loading branch information
sebbi08 committed Jan 15, 2024
1 parent 39584ed commit 3308eb2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions client-side-js/injectXHRPatch.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ async function clientSide_injectXHRPatch(config, browserInstance) {
return await browserInstance.executeAsync((config, done) => {
const originalFetch = window.fetch

const autoWaitUrlIgnoreRegex = config.wdi5.autoWaitUrlIgnoreRegex
const ignoreAutoWaitUrls = config.wdi5.ignoreAutoWaitUrls
function checkURL(url) {
return autoWaitUrlIgnoreRegex?.map((regex) => new RegExp(regex))?.some((regex) => url.match(regex)) || false
return ignoreAutoWaitUrls?.map((regex) => new RegExp(regex))?.some((regex) => url.match(regex)) || false
}
const imports = ["sap/ui/thirdparty/sinon", "sap/ui/test/autowaiter/_XHRWaiter"]
if (window.compareVersions.compare(sap.ui.version, "1.114.0", ">")) {
Expand Down
4 changes: 2 additions & 2 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exports.config = {
skipInjectUI5OnStart: false, // [optional] {boolean}, default: false; true when UI5 is not on the start page, you need to later call <wdioUI5service>.injectUI5() manually
waitForUI5Timeout: 15000, // [optional] {number}, default: 15000; maximum waiting time in milliseconds while checking for UI5 availability
btpWorkZoneEnablement: false, // [optional] {boolean}, default: false; whether to instruct wdi5 to inject itself in both the SAP Build Workzone, standard edition, shell and app
autoWaitUrlIgnoreRegex: [] // [optional] {string[]}, default: []; Array of regex to ignore certain XHR/Fetch calls wile autowaiting
ignoreAutoWaitUrls: [] // [optional] {string[]}, default: []; Array of regex to ignore certain XHR/Fetch calls wile autowaiting
}
// ...
}
Expand Down Expand Up @@ -134,7 +134,7 @@ Number in milliseconds (default: `15000`) to wait for UI5-related operations wit
Boolean setting to trigger injecting `wdi5` into both the shell and the app when used with the SAP Build Workzone, standard edition.
Recommended complement is to also [configure IAS Authentication](authentication?id=sap-cloud-identity-services-identity-authentication): as SAP Build requires its own Identity Provider (most likely provided by using an IAS tenant), you'll have to configure authentication against that as well in `wdi5`.

### `autoWaitUrlIgnoreRegex`
### `ignoreAutoWaitUrls`

Ignore list in form of regex. Those will be used to ignore certain XHR/Fetch call from beeing waited for by the OPA5 Waiters. This can be used in combination with longpolling requests to continusly update your app.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const _config = {
specs: [join("..", "webapp", "test", "e2e", "basic.test.js"), join("webapp", "test", "e2e", "hash-nav.test.js")],
baseUrl: "http://localhost:8080/index.html?isui5toolingTest=true",
wdi5: {
autoWaitUrlIgnoreRegex: [".*/Categories.*"]
ignoreAutoWaitUrls: [".*/Categories.*"]
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/types/wdi5.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export interface wdi5Config extends WebdriverIO.Config {
* Regex for XHR/Fetch requests to be ignored by the auto waiter
* Ideal for long polling as this would result in the waiter waiting forever
*/
autoWaitUrlIgnoreRegex?: string[]
ignoreAutoWaitUrls?: string[]
}
capabilities: wdi5Capabilities[] | wdi5MultiRemoteCapability
}
Expand Down

0 comments on commit 3308eb2

Please sign in to comment.