@ohah/agent-devtools 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,31 @@
1
+ #!/bin/bash
2
+ # Template: Authenticated Session Workflow
3
+ # Usage: ./authenticated-session.sh <login-url>
4
+ set -euo pipefail
5
+ LOGIN_URL="${1:?Usage: $0 <login-url>}"
6
+
7
+ # Try loading saved state
8
+ if agent-devtools state load auth 2>/dev/null; then
9
+ agent-devtools open "$LOGIN_URL"
10
+ agent-devtools wait 3000
11
+ CURRENT_URL=$(agent-devtools get url 2>/dev/null | tr -d '"')
12
+ if [[ "$CURRENT_URL" != *"login"* ]]; then
13
+ echo "Session restored"
14
+ agent-devtools snapshot -i
15
+ exit 0
16
+ fi
17
+ fi
18
+
19
+ # Fresh login
20
+ agent-devtools open "$LOGIN_URL"
21
+ agent-devtools wait 3000
22
+ agent-devtools snapshot -i
23
+
24
+ # Customize refs:
25
+ # agent-devtools fill @e1 "$USERNAME"
26
+ # agent-devtools fill @e2 "$PASSWORD"
27
+ # agent-devtools click @e3
28
+ # agent-devtools wait 3000
29
+ # agent-devtools state save auth
30
+
31
+ agent-devtools close
@@ -0,0 +1,21 @@
1
+ #!/bin/bash
2
+ # Template: Form Automation Workflow
3
+ # Usage: ./form-automation.sh <form-url>
4
+ set -euo pipefail
5
+ FORM_URL="${1:?Usage: $0 <form-url>}"
6
+
7
+ agent-devtools open "$FORM_URL"
8
+ agent-devtools wait 3000
9
+ echo "Form structure:"
10
+ agent-devtools snapshot -i
11
+
12
+ # Customize refs based on snapshot output:
13
+ # agent-devtools fill @e1 "John Doe"
14
+ # agent-devtools fill @e2 "user@example.com"
15
+ # agent-devtools click @e3 # Submit
16
+
17
+ # Verify result
18
+ # agent-devtools snapshot -i
19
+ # agent-devtools screenshot /tmp/form-result.png
20
+
21
+ agent-devtools close