double all sleep
All checks were successful
ci/woodpecker/push/publish Pipeline was successful

This commit is contained in:
Mylloon 2023-05-16 02:48:48 +02:00
parent 2d9a51d74a
commit e456fa5bda
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
4 changed files with 12 additions and 12 deletions

View file

@ -24,7 +24,7 @@ let rec check ctx =
Unix.sleep timeout;
if ctx.debug then print_endline "Refresh profile page...";
refresh_page ctx.session_id;
Unix.sleep 4;
Unix.sleep 8;
check ctx
in
(* Time to wait until next check *)

View file

@ -19,9 +19,9 @@ let inject_username session_id creds =
in
(* Insert the username *)
send_keys session_id input_username creds.username;
Unix.sleep 1;
Unix.sleep 2;
send_keys session_id input_username Keys.return;
Unix.sleep 3
Unix.sleep 6
;;
let rec _inject_password session_id creds try_count =
@ -47,9 +47,9 @@ let rec _inject_password session_id creds try_count =
| Some input ->
(* Insert password *)
send_keys session_id input creds.password;
Unix.sleep 1;
Unix.sleep 2;
send_keys session_id input Keys.return;
Unix.sleep 3
Unix.sleep 6
| None -> ()
;;
@ -63,9 +63,9 @@ let inject_2fa session_id secret input =
in
(* Insert 2FA code *)
send_keys session_id input code;
Unix.sleep 1;
Unix.sleep 2;
send_keys session_id input Keys.return;
Unix.sleep 5
Unix.sleep 10
;;
let login_twitter ctx username password secret =
@ -108,7 +108,7 @@ let go_to_profile ctx =
(fmt
"https://twitter.com%s/with_replies"
(get_attribute ctx.session_id profile_button "href")));
Unix.sleep 4
Unix.sleep 8
;;
let find_latest_tweet ctx =
@ -160,7 +160,7 @@ let tweet ctx msg =
else List.nth l 0
in
send_keys ctx.session_id tweet_area msg;
Unix.sleep 1;
Unix.sleep 2;
let send_tweet_button =
match find ctx.session_id (XPath "//div[@data-testid='tweetButton']") with
| [] -> raise (Any (fmt "Send-tweet button not found"))
@ -170,5 +170,5 @@ let tweet ctx msg =
else List.nth l 0
in
click ctx.session_id send_tweet_button;
Unix.sleep 4
Unix.sleep 8
;;

View file

@ -66,7 +66,7 @@ let run_process path args =
let pid =
Unix.create_process command (Array.of_list args) output_fd output_fd output_fd
in
Unix.sleepf 0.5;
Unix.sleep 1;
out_channel, pid
;;

View file

@ -70,7 +70,7 @@ let rec wait_for_load session_id =
| `String res ->
if not (res = "complete")
then (
Unix.sleep 1;
Unix.sleep 2;
wait_for_load session_id)
| _ -> raise (Any "Error when waiting for page to load"))
| _ -> raise (Any "wait_for_load | Invalid JSON")