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 @@ -144,6 +144,21 @@ public function type($field, $value)
144144 return $ this ;
145145 }
146146
147+ /**
148+ * Type the given value in the given field slowly.
149+ *
150+ * @param string $field
151+ * @param string $value
152+ * @param int $pause
153+ * @return $this
154+ */
155+ public function typeSlowly ($ field , $ value , $ pause = 100 )
156+ {
157+ $ this ->clear ($ field )->appendWithPauses ($ field , $ value , $ pause );
158+
159+ return $ this ;
160+ }
161+
147162 /**
148163 * Type the given value in the given field without clearing it.
149164 *
@@ -158,6 +173,23 @@ public function append($field, $value)
158173 return $ this ;
159174 }
160175
176+ /**
177+ * Type the given value in the given field slowly without clearing it.
178+ *
179+ * @param string $field
180+ * @param string $value
181+ * @param int $pause
182+ * @return $this
183+ */
184+ public function appendSlowly ($ field , $ value , $ pause = 100 )
185+ {
186+ foreach (str_split ($ value ) as $ char ) {
187+ $ this ->append ($ field , $ char )->pause ($ pause );
188+ }
189+
190+ return $ this ;
191+ }
192+
161193 /**
162194 * Clear the given field.
163195 *
You can’t perform that action at this time.
0 commit comments