testdriverai 7.2.56 → 7.2.58
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.
- package/.env.example +2 -0
- package/.github/workflows/acceptance-windows-scheduled.yaml +29 -28
- package/.github/workflows/acceptance.yaml +54 -52
- package/.github/workflows/publish.yaml +59 -43
- package/.github/workflows/testdriver.yml +157 -156
- package/.github/workflows/windows-self-hosted.yaml +60 -46
- package/CHANGELOG.md +10 -0
- package/docs/docs.json +1 -0
- package/docs/v7/captcha.mdx +160 -0
- package/examples/captcha-api.test.mjs +50 -0
- package/lib/captcha/solver.js +296 -0
- package/lib/core/Dashcam.js +135 -95
- package/lib/vitest/hooks.mjs +175 -126
- package/lib/vitest/setup-aws.mjs +69 -46
- package/package.json +1 -1
- package/sdk.d.ts +67 -20
- package/sdk.js +733 -402
- package/test/captcha-solver.test.mjs +70 -0
- package/test/chrome-remote-debugging.test.mjs +66 -0
- package/vitest.config.mjs +10 -6
package/.env.example
CHANGED
|
@@ -7,7 +7,7 @@ permissions:
|
|
|
7
7
|
on:
|
|
8
8
|
schedule:
|
|
9
9
|
# Every day at midnight UTC
|
|
10
|
-
- cron:
|
|
10
|
+
- cron: "0 0 * * *"
|
|
11
11
|
workflow_dispatch: # Allow manual trigger
|
|
12
12
|
|
|
13
13
|
jobs:
|
|
@@ -15,6 +15,7 @@ jobs:
|
|
|
15
15
|
uses: ./.github/workflows/windows-self-hosted.yaml
|
|
16
16
|
secrets:
|
|
17
17
|
TD_API_KEY: ${{ secrets.TD_API_KEY }}
|
|
18
|
+
TWOCAPTCHA_API_KEY: ${{ secrets.TWOCAPTCHA_API_KEY }}
|
|
18
19
|
TD_WEBSITE: ${{ secrets.TD_WEBSITE }}
|
|
19
20
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
20
21
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
@@ -23,31 +24,31 @@ jobs:
|
|
|
23
24
|
needs: test-windows
|
|
24
25
|
runs-on: ubuntu-latest
|
|
25
26
|
if: always()
|
|
26
|
-
|
|
27
|
+
|
|
27
28
|
steps:
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
29
|
+
- name: Install Sentry CLI
|
|
30
|
+
run: npm install -g @sentry/cli
|
|
31
|
+
|
|
32
|
+
- name: Report to Sentry Cron
|
|
33
|
+
run: |
|
|
34
|
+
sentry-cli monitors run testdriver-windows-acceptance -- echo "Windows tests completed"
|
|
35
|
+
env:
|
|
36
|
+
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
|
37
|
+
|
|
38
|
+
- name: Download test results
|
|
39
|
+
uses: actions/download-artifact@v4
|
|
40
|
+
with:
|
|
41
|
+
name: test-results-windows
|
|
42
|
+
|
|
43
|
+
- name: Upload test results to Sentry Prevent
|
|
44
|
+
if: ${{ !cancelled() }}
|
|
45
|
+
uses: getsentry/prevent-action@v0
|
|
46
|
+
with:
|
|
47
|
+
token: ${{ secrets.SENTRY_PREVENT_TOKEN }}
|
|
48
|
+
|
|
49
|
+
- name: Publish Test Results
|
|
50
|
+
uses: EnricoMi/publish-unit-test-result-action@v2
|
|
51
|
+
if: always()
|
|
52
|
+
with:
|
|
53
|
+
files: test-report.junit.xml
|
|
54
|
+
check_name: Test Results (Windows Scheduled)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
name: Acceptance Tests
|
|
2
2
|
permissions:
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
id-token: write
|
|
4
|
+
contents: write
|
|
5
|
+
pull-requests: write
|
|
6
|
+
checks: write
|
|
7
7
|
on:
|
|
8
8
|
pull_request:
|
|
9
|
-
branches: [
|
|
9
|
+
branches: [main]
|
|
10
10
|
|
|
11
11
|
concurrency:
|
|
12
12
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
@@ -15,46 +15,48 @@ concurrency:
|
|
|
15
15
|
jobs:
|
|
16
16
|
test-linux:
|
|
17
17
|
runs-on: ubuntu-latest
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
steps:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
- name: Run Linux tests
|
|
32
|
-
run: npx vitest run examples/*.test.mjs
|
|
33
|
-
env:
|
|
34
|
-
TD_API_KEY: ${{ secrets.TD_API_KEY }}
|
|
35
|
-
TD_OS: linux
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Setup Node.js
|
|
23
|
+
uses: actions/setup-node@v4
|
|
24
|
+
with:
|
|
25
|
+
node-version: "20"
|
|
26
|
+
cache: "npm"
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: npm ci
|
|
36
30
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
31
|
+
- name: Run Linux tests
|
|
32
|
+
run: npx vitest run examples/*.test.mjs
|
|
33
|
+
env:
|
|
34
|
+
TD_API_KEY: ${{ secrets.TD_API_KEY }}
|
|
35
|
+
TWOCAPTCHA_API_KEY: ${{ secrets.TWOCAPTCHA_API_KEY }}
|
|
36
|
+
TD_OS: linux
|
|
42
37
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
38
|
+
- name: Upload test results to Sentry Prevent
|
|
39
|
+
if: ${{ !cancelled() }}
|
|
40
|
+
uses: getsentry/prevent-action@v0
|
|
41
|
+
with:
|
|
42
|
+
token: ${{ secrets.SENTRY_PREVENT_TOKEN }}
|
|
43
|
+
|
|
44
|
+
- name: Publish Test Results
|
|
45
|
+
uses: EnricoMi/publish-unit-test-result-action@v2
|
|
46
|
+
if: always()
|
|
47
|
+
with:
|
|
48
|
+
files: test-report.junit.xml
|
|
49
|
+
comment_mode: always
|
|
50
|
+
check_name: Test Results (Linux)
|
|
50
51
|
|
|
51
52
|
test-windows:
|
|
52
53
|
if: contains(github.event.pull_request.labels.*.name, 'test-windows')
|
|
53
54
|
uses: ./.github/workflows/windows-self-hosted.yaml
|
|
54
55
|
with:
|
|
55
|
-
test_pattern:
|
|
56
|
+
test_pattern: "examples/*.test.mjs"
|
|
56
57
|
secrets:
|
|
57
58
|
TD_API_KEY: ${{ secrets.TD_API_KEY }}
|
|
59
|
+
TWOCAPTCHA_API_KEY: ${{ secrets.TWOCAPTCHA_API_KEY }}
|
|
58
60
|
TD_WEBSITE: ${{ secrets.TD_WEBSITE }}
|
|
59
61
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
60
62
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
|
@@ -63,23 +65,23 @@ jobs:
|
|
|
63
65
|
needs: test-windows
|
|
64
66
|
runs-on: ubuntu-latest
|
|
65
67
|
if: always() && contains(github.event.pull_request.labels.*.name, 'test-windows')
|
|
66
|
-
|
|
68
|
+
|
|
67
69
|
steps:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
- name: Download test results
|
|
71
|
+
uses: actions/download-artifact@v4
|
|
72
|
+
with:
|
|
73
|
+
name: test-results-windows
|
|
72
74
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
- name: Upload test results to Sentry Prevent
|
|
76
|
+
if: ${{ !cancelled() }}
|
|
77
|
+
uses: getsentry/prevent-action@v0
|
|
78
|
+
with:
|
|
79
|
+
token: ${{ secrets.SENTRY_PREVENT_TOKEN }}
|
|
78
80
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
- name: Publish Test Results
|
|
82
|
+
uses: EnricoMi/publish-unit-test-result-action@v2
|
|
83
|
+
if: always()
|
|
84
|
+
with:
|
|
85
|
+
files: test-report.junit.xml
|
|
86
|
+
comment_mode: always
|
|
87
|
+
check_name: Test Results (Windows)
|
|
@@ -1,52 +1,68 @@
|
|
|
1
1
|
name: Publish
|
|
2
2
|
permissions:
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
contents: write
|
|
4
|
+
id-token: write # Required for OIDC
|
|
5
5
|
on:
|
|
6
6
|
push:
|
|
7
|
-
branches: [
|
|
7
|
+
branches: [main]
|
|
8
8
|
|
|
9
9
|
jobs:
|
|
10
10
|
publish:
|
|
11
11
|
runs-on: ubuntu-latest
|
|
12
|
-
|
|
12
|
+
|
|
13
13
|
steps:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
with:
|
|
16
|
+
fetch-depth: 0
|
|
17
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
18
|
+
|
|
19
|
+
- name: Setup Node.js
|
|
20
|
+
uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: "20"
|
|
23
|
+
registry-url: "https://registry.npmjs.org/"
|
|
24
|
+
|
|
25
|
+
- name: Configure Git
|
|
26
|
+
run: |
|
|
27
|
+
git config user.name "github-actions[bot]"
|
|
28
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
29
|
+
|
|
30
|
+
- name: Install dependencies
|
|
31
|
+
run: npm ci
|
|
32
|
+
|
|
33
|
+
- name: Bump version (patch)
|
|
34
|
+
run: npm version patch --no-git-tag-version
|
|
35
|
+
|
|
36
|
+
- name: Generate Changelog
|
|
37
|
+
run: |
|
|
38
|
+
npx conventional-changelog-cli -p angular -i CHANGELOG.md -s
|
|
39
|
+
git add CHANGELOG.md
|
|
40
|
+
|
|
41
|
+
- name: Commit and push version bump
|
|
42
|
+
run: |
|
|
43
|
+
git add package.json package-lock.json
|
|
44
|
+
VERSION=$(node -p "require('./package.json').version")
|
|
45
|
+
git commit -m "chore(release): ${VERSION}"
|
|
46
|
+
git tag "v${VERSION}"
|
|
47
|
+
git push origin main
|
|
48
|
+
git push origin "v${VERSION}"
|
|
49
|
+
echo "VERSION=${VERSION}" >> $GITHUB_ENV
|
|
50
|
+
|
|
51
|
+
- name: Create GitHub Release
|
|
52
|
+
uses: softprops/action-gh-release@v1
|
|
53
|
+
with:
|
|
54
|
+
tag_name: v${{ env.VERSION }}
|
|
55
|
+
generate_release_notes: true
|
|
56
|
+
prerelease: false
|
|
57
|
+
|
|
58
|
+
- name: Debug NPM Token
|
|
59
|
+
run: |
|
|
60
|
+
echo "NPM_TOKEN is set: ${{ secrets.NPM_TOKEN != '' }}"
|
|
61
|
+
echo "NPM_TOKEN first 4 chars: ${NPM_TOKEN:0:4}..."
|
|
62
|
+
env:
|
|
63
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
64
|
+
|
|
65
|
+
- name: Publish to npm
|
|
66
|
+
run: npm publish --tag beta
|
|
67
|
+
env:
|
|
68
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|