@@ -75,9 +75,12 @@ public function wait(float $time = 30.0): PromiseInterface;
7575 * A condition callback must return an instance of PromiseInterface. Whenever that promise becomes rejected, driver
7676 * will try to get a new promise from the callback, until it reaches a given timeout for retry attempts.
7777 *
78- * Note: waitUntil itself doesn't apply any timeouts for a single result promise (check iteration), the user-side
78+ * Note 1 : waitUntil itself doesn't apply any timeouts for a single result promise (check iteration), the user-side
7979 * MUST control any kind of promise timeouts for the condition callback, which is supplied to the method.
8080 *
81+ * Note 2: the resulting value for the waitUntil promise will be a value, which is forwarded by the condition
82+ * callback (see an example below).
83+ *
8184 * Usage example:
8285 *
8386 * ```
@@ -90,16 +93,21 @@ public function wait(float $time = 30.0): PromiseInterface;
9093 * if (!$isVisible) {
9194 * throw new RuntimeException("Not visible yet! Let's retry!");
9295 * }
96+ *
97+ * // this value will be forwarded as a "result value" for the waitUntil promise.
98+ * return 'it is visible now!';
9399 * }
94100 * );
95101 * },
96102 * 15.5
97103 * );
98104 *
99105 * $becomeVisiblePromise->then(
100- * function () use ($webDriver) {
106+ * function (string $forwardedValue ) use ($webDriver) {
101107 * // try-catch
102108 * $webDriver->clickElement(...); // sending a click command only if we are sure the target is visible.
109+ *
110+ * // $forwardedValue === 'it is visible now!'
103111 * }
104112 * // handle case when the element is not visible on the page
105113 * );
@@ -109,7 +117,7 @@ public function wait(float $time = 30.0): PromiseInterface;
109117 * @param float $time Time (in seconds) to wait for successfully resolved promise from the
110118 * condition callback (minimum: 0.5)
111119 *
112- * @return PromiseInterface<null >
120+ * @return PromiseInterface<mixed >
113121 */
114122 public function waitUntil (callable $ conditionMetCallback , float $ time = 30.0 ): PromiseInterface ;
115123
@@ -118,7 +126,7 @@ public function waitUntil(callable $conditionMetCallback, float $time = 30.0): P
118126 * {filePath}, rejection reason with error message will be provided otherwise.
119127 *
120128 * @param string $sessionIdentifier Session identifier for Selenium Grid server (hub)
121- * @param string $filePath Path where a screenshot image will be saved
129+ * @param string $filePath Path, where a screenshot image must be saved
122130 *
123131 * @return PromiseInterface<null>
124132 */
0 commit comments