File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -635,6 +635,38 @@ public function pause($milliseconds)
635635 return $ this ;
636636 }
637637
638+ /**
639+ * Pause for the given amount of milliseconds if the given condition is true.
640+ *
641+ * @param bool $boolean
642+ * @param int $milliseconds
643+ * @return $this
644+ */
645+ public function pauseIf ($ boolean , $ milliseconds )
646+ {
647+ if ($ boolean ) {
648+ return $ this ->pause ($ milliseconds );
649+ }
650+
651+ return $ this ;
652+ }
653+
654+ /**
655+ * Pause for the given amount of milliseconds unless the given condition is true.
656+ *
657+ * @param bool $boolean
658+ * @param int $milliseconds
659+ * @return $this
660+ */
661+ public function pauseUnless ($ boolean , $ milliseconds )
662+ {
663+ if (! $ boolean ) {
664+ return $ this ->pause ($ milliseconds );
665+ }
666+
667+ return $ this ;
668+ }
669+
638670 /**
639671 * Close the browser.
640672 *
You can’t perform that action at this time.
0 commit comments