Skip to content

Commit ff1e268

Browse files
committed
test: created test script for making simulation request to server
1 parent 142b7cd commit ff1e268

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/simulation_test.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
3+
# This script is used to simulate a load test on the task server
4+
# We have 2 parameters, the first one is the host, second Authorization token
5+
6+
if [[ ! -n $1 ]];
7+
then
8+
echo "No HOST provided"
9+
exit 1
10+
fi
11+
12+
for i in `seq 1 40`
13+
do
14+
curl \
15+
-X POST "$1/task" \
16+
-H 'Content-Type: application/json' \
17+
-H "Authorization: $2" \
18+
-d '{"script": "await agent.goto(\"https://example.com/\"); await agent.waitForMillis(10000); resolve(await agent.document.title);"}' \
19+
> /dev/null &
20+
done

0 commit comments

Comments
 (0)