@@ -6,6 +6,7 @@ import type { WdioElementMaybePromise } from './types.js'
66import { wrapExpectedWithArray } from './util/elementsUtil.js'
77import { executeCommand } from './util/executeCommand.js'
88import { enhanceError , enhanceErrorBe , numberError } from './util/formatMessage.js'
9+ import { toArray } from './util/multiRemoteUtil.js'
910
1011export type CompareResult < A = unknown , E = unknown > = {
1112 value : A // actual but sometimes modified (e.g. trimmed, lowercased, etc)
@@ -111,19 +112,17 @@ const waitUntilResult = async <A = unknown, E = unknown>(
111112
112113 return { pass, results : allResults }
113114}
115+
114116/**
115- * Wait for condition to succeed
116- * For multiple remotes, all conditions must be met
117- * When using negated condition (isNot=true), we wait for all conditions to be true first, then we negate the real value if it takes time to show up.
118- *
119- * @param condition function to that should return true when condition is met
117+ * wait for expectation to succeed
118+ * @param condition function
120119 * @param isNot https://jestjs.io/docs/expect#thisisnot
121120 * @param options wait, interval, etc
122121 */
123122const waitUntil = async (
124123 condition : ( ) => Promise < boolean > ,
125124 isNot = false ,
126- { wait = DEFAULT_OPTIONS . wait , interval = DEFAULT_OPTIONS . interval } = { } ,
125+ { wait = DEFAULT_OPTIONS . wait , interval = DEFAULT_OPTIONS . interval } = { }
127126) : Promise < boolean > => {
128127 // single attempt
129128 if ( wait === 0 ) {
0 commit comments