testdriverai 7.1.0 → 7.1.2

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.
Files changed (325) hide show
  1. package/.env.example +2 -0
  2. package/.github/workflows/linux-tests.yml +28 -0
  3. package/agent/index.js +18 -45
  4. package/agent/interface.js +13 -2
  5. package/agent/lib/commands.js +1 -1
  6. package/agent/lib/redraw.js +1 -1
  7. package/agent/lib/sandbox.js +30 -2
  8. package/agent/lib/valid-version.js +2 -2
  9. package/debugger/index.html +1 -1
  10. package/docs/docs.json +140 -131
  11. package/docs/v6/getting-started/self-hosting.mdx +3 -2
  12. package/docs/v7/_drafts/agents.mdx +852 -0
  13. package/docs/v7/_drafts/auto-cache-key.mdx +167 -0
  14. package/docs/v7/{guides → _drafts}/caching-selectors.mdx +125 -17
  15. package/docs/v7/_drafts/dashcam-title-feature.mdx +89 -0
  16. package/docs/v7/_drafts/error-handling.mdx +501 -0
  17. package/docs/v7/_drafts/implementation-plan.mdx +994 -0
  18. package/docs/v7/_drafts/init-command.mdx +95 -0
  19. package/docs/v7/_drafts/optimal-sdk-design.mdx +1348 -0
  20. package/docs/v7/_drafts/plugin-migration.mdx +222 -0
  21. package/docs/v7/_drafts/prompt-cache.mdx +200 -0
  22. package/docs/{QUICK_START_TEST_RECORDING.md → v7/_drafts/quick-start-test-recording.mdx} +3 -3
  23. package/docs/v7/_drafts/sdk-logging.mdx +222 -0
  24. package/docs/v7/_drafts/sdk-migration.mdx +474 -0
  25. package/docs/v7/_drafts/sdk-v7-complete.mdx +345 -0
  26. package/docs/v7/{guides → _drafts}/self-hosting.mdx +1 -1
  27. package/docs/v7/{guides → _drafts}/troubleshooting.mdx +2 -2
  28. package/docs/v7/{guides → _drafts}/vitest-plugin.mdx +4 -4
  29. package/docs/v7/api/{ai.mdx → act.mdx} +24 -24
  30. package/docs/v7/api/client.mdx +1 -1
  31. package/docs/v7/api/dashcam.mdx +2 -2
  32. package/docs/v7/api/elements.mdx +143 -41
  33. package/docs/v7/api/find.mdx +258 -0
  34. package/docs/v7/api/type.mdx +51 -7
  35. package/docs/v7/features/ai-native.mdx +427 -0
  36. package/docs/v7/features/easy-to-write.mdx +351 -0
  37. package/docs/v7/features/enterprise.mdx +540 -0
  38. package/docs/v7/features/fast.mdx +424 -0
  39. package/docs/v7/features/observable.mdx +623 -0
  40. package/docs/v7/features/powerful.mdx +531 -0
  41. package/docs/v7/features/scalable.mdx +417 -0
  42. package/docs/v7/features/stable.mdx +514 -0
  43. package/docs/v7/getting-started/configuration.mdx +1 -1
  44. package/docs/v7/getting-started/generating-tests.mdx +525 -0
  45. package/docs/v7/getting-started/installation.mdx +486 -0
  46. package/docs/v7/getting-started/quickstart.mdx +51 -5
  47. package/docs/v7/getting-started/running-and-debugging.mdx +511 -0
  48. package/docs/v7/getting-started/setting-up-in-ci.mdx +612 -0
  49. package/docs/v7/getting-started/writing-tests.mdx +535 -0
  50. package/docs/v7/overview/what-is-testdriver.mdx +398 -0
  51. package/docs/v7/playwright.mdx +3 -3
  52. package/docs/v7/presets/chrome.mdx +16 -0
  53. package/docs/v7/presets/electron.mdx +18 -0
  54. package/docs/v7/presets/vscode.mdx +19 -0
  55. package/examples/run-tests-with-recording.sh +70 -0
  56. package/examples/screenshot-example.js +63 -0
  57. package/examples/sdk-awesome-logs-demo.js +177 -0
  58. package/examples/sdk-cache-thresholds.js +96 -0
  59. package/examples/sdk-element-properties.js +155 -0
  60. package/examples/sdk-simple-example.js +65 -0
  61. package/examples/test-recording-example.test.js +166 -0
  62. package/interfaces/cli/commands/init.js +358 -0
  63. package/interfaces/vitest-plugin.mjs +214 -10
  64. package/{src → lib}/core/Dashcam.js +41 -4
  65. package/{src → lib}/vitest/hooks.mjs +118 -100
  66. package/lib/vitest/setup.mjs +44 -0
  67. package/package.json +9 -10
  68. package/sdk.d.ts +15 -2
  69. package/sdk.js +72 -17
  70. package/{self-hosted.yml → setup/aws/self-hosted.yml} +1 -1
  71. package/{testdriver/acceptance-sdk → test/manual}/test-console-logs.test.mjs +1 -1
  72. package/test/manual/test-find-api.js +73 -0
  73. package/test/manual/test-init.sh +54 -0
  74. package/test/manual/test-prompt-cache.js +96 -0
  75. package/test/manual/test-provision-auth.mjs +22 -0
  76. package/test/manual/test-sandbox-render.js +28 -0
  77. package/test/manual/test-sdk-methods.js +15 -0
  78. package/test/manual/test-sdk-refactor.js +53 -0
  79. package/test/manual/test-stack-trace.mjs +57 -0
  80. package/test/testdriver/assert.test.mjs +41 -0
  81. package/{testdriver/acceptance-sdk → test/testdriver}/auto-cache-key-demo.test.mjs +1 -1
  82. package/{testdriver/acceptance-sdk → test/testdriver}/drag-and-drop.test.mjs +1 -1
  83. package/{testdriver/acceptance-sdk → test/testdriver}/element-not-found.test.mjs +1 -1
  84. package/{testdriver/acceptance-sdk → test/testdriver}/exec-js.test.mjs +1 -1
  85. package/{testdriver/acceptance-sdk → test/testdriver}/exec-output.test.mjs +3 -3
  86. package/{testdriver/acceptance-sdk → test/testdriver}/exec-pwsh.test.mjs +3 -3
  87. package/{testdriver/acceptance-sdk → test/testdriver}/focus-window.test.mjs +1 -1
  88. package/{testdriver/acceptance-sdk → test/testdriver}/formatted-logging.test.mjs +1 -1
  89. package/{testdriver/acceptance-sdk → test/testdriver}/hover-image.test.mjs +1 -1
  90. package/{testdriver/acceptance-sdk → test/testdriver}/hover-text-with-description.test.mjs +1 -1
  91. package/{testdriver/acceptance-sdk → test/testdriver}/hover-text.test.mjs +1 -1
  92. package/{testdriver/acceptance-sdk → test/testdriver}/match-image.test.mjs +1 -1
  93. package/{testdriver/acceptance-sdk → test/testdriver}/press-keys.test.mjs +1 -1
  94. package/{testdriver/acceptance-sdk → test/testdriver}/prompt.test.mjs +2 -2
  95. package/{testdriver/acceptance-sdk → test/testdriver}/scroll-keyboard.test.mjs +1 -1
  96. package/{testdriver/acceptance-sdk → test/testdriver}/scroll-until-image.test.mjs +1 -1
  97. package/{testdriver/acceptance-sdk → test/testdriver}/scroll-until-text.test.mjs +1 -1
  98. package/{testdriver/acceptance-sdk → test/testdriver}/scroll.test.mjs +1 -1
  99. package/{src/vitest/lifecycle.mjs → test/testdriver/setup/lifecycleHelpers.mjs} +84 -99
  100. package/test/testdriver/setup/testHelpers.mjs +653 -0
  101. package/{testdriver/acceptance-sdk → test/testdriver}/type.test.mjs +1 -1
  102. package/vitest.config.mjs +8 -59
  103. package/.github/dependabot.yml +0 -11
  104. package/.github/workflows/acceptance-linux.yml +0 -75
  105. package/.github/workflows/acceptance-sdk-tests.yml +0 -133
  106. package/.github/workflows/acceptance-tests.yml +0 -130
  107. package/.github/workflows/lint.yml +0 -27
  108. package/.github/workflows/publish-canary.yml +0 -40
  109. package/.github/workflows/publish-latest.yml +0 -61
  110. package/.github/workflows/test-install.yml +0 -29
  111. package/.vscode/extensions.json +0 -3
  112. package/.vscode/launch.json +0 -22
  113. package/.vscode/settings.json +0 -14
  114. package/AGENTS.md +0 -550
  115. package/CODEOWNERS +0 -2
  116. package/_testdriver/acceptance/assert.yaml +0 -7
  117. package/_testdriver/acceptance/dashcam.yaml +0 -9
  118. package/_testdriver/acceptance/drag-and-drop.yaml +0 -49
  119. package/_testdriver/acceptance/embed.yaml +0 -9
  120. package/_testdriver/acceptance/exec-js.yaml +0 -29
  121. package/_testdriver/acceptance/exec-output.yaml +0 -43
  122. package/_testdriver/acceptance/exec-shell.yaml +0 -40
  123. package/_testdriver/acceptance/focus-window.yaml +0 -16
  124. package/_testdriver/acceptance/hover-image.yaml +0 -18
  125. package/_testdriver/acceptance/hover-text-with-description.yaml +0 -29
  126. package/_testdriver/acceptance/hover-text.yaml +0 -14
  127. package/_testdriver/acceptance/if-else.yaml +0 -31
  128. package/_testdriver/acceptance/match-image.yaml +0 -15
  129. package/_testdriver/acceptance/press-keys.yaml +0 -35
  130. package/_testdriver/acceptance/prompt.yaml +0 -11
  131. package/_testdriver/acceptance/remember.yaml +0 -27
  132. package/_testdriver/acceptance/screenshots/cart.png +0 -0
  133. package/_testdriver/acceptance/scroll-keyboard.yaml +0 -34
  134. package/_testdriver/acceptance/scroll-until-image.yaml +0 -26
  135. package/_testdriver/acceptance/scroll-until-text.yaml +0 -20
  136. package/_testdriver/acceptance/scroll.yaml +0 -33
  137. package/_testdriver/acceptance/snippets/login.yaml +0 -29
  138. package/_testdriver/acceptance/snippets/match-cart.yaml +0 -8
  139. package/_testdriver/acceptance/type.yaml +0 -29
  140. package/_testdriver/behavior/failure.yaml +0 -7
  141. package/_testdriver/behavior/hover-text.yaml +0 -13
  142. package/_testdriver/behavior/lifecycle/postrun.yaml +0 -10
  143. package/_testdriver/behavior/lifecycle/prerun.yaml +0 -8
  144. package/_testdriver/behavior/lifecycle/provision.yaml +0 -8
  145. package/_testdriver/behavior/secrets.yaml +0 -7
  146. package/_testdriver/edge-cases/dashcam-chrome.yaml +0 -8
  147. package/_testdriver/edge-cases/exec-pwsh-multiline.yaml +0 -10
  148. package/_testdriver/edge-cases/js-exception.yaml +0 -8
  149. package/_testdriver/edge-cases/js-promise.yaml +0 -19
  150. package/_testdriver/edge-cases/lifecycle/postrun.yaml +0 -10
  151. package/_testdriver/edge-cases/prompt-in-middle.yaml +0 -23
  152. package/_testdriver/edge-cases/prompt-nested.yaml +0 -7
  153. package/_testdriver/edge-cases/success-test.yaml +0 -9
  154. package/_testdriver/examples/android/example.yaml +0 -12
  155. package/_testdriver/examples/android/lifecycle/postrun.yaml +0 -11
  156. package/_testdriver/examples/android/lifecycle/provision.yaml +0 -47
  157. package/_testdriver/examples/android/readme.md +0 -7
  158. package/_testdriver/examples/chrome-extension/lifecycle/provision.yaml +0 -74
  159. package/_testdriver/examples/desktop/lifecycle/prerun.yaml +0 -0
  160. package/_testdriver/examples/desktop/lifecycle/provision.yaml +0 -64
  161. package/_testdriver/examples/vscode-extension/lifecycle/provision.yaml +0 -73
  162. package/_testdriver/examples/web/lifecycle/postrun.yaml +0 -7
  163. package/_testdriver/examples/web/lifecycle/prerun.yaml +0 -22
  164. package/_testdriver/lifecycle/postrun.yaml +0 -8
  165. package/_testdriver/lifecycle/prerun.yaml +0 -15
  166. package/_testdriver/lifecycle/provision.yaml +0 -25
  167. package/docs/v7/guides/ci-cd/azure.mdx +0 -587
  168. package/docs/v7/guides/ci-cd/circleci.mdx +0 -523
  169. package/docs/v7/guides/ci-cd/github-actions.mdx +0 -457
  170. package/docs/v7/guides/ci-cd/gitlab.mdx +0 -498
  171. package/docs/v7/guides/ci-cd/jenkins.mdx +0 -664
  172. package/docs/v7/guides/ci-cd/travis.mdx +0 -438
  173. package/scripts/view-test-results.mjs +0 -96
  174. package/src/vitest/extended.mjs +0 -108
  175. package/src/vitest/index.mjs +0 -64
  176. package/src/vitest/utils.mjs +0 -150
  177. package/styles/.vale-config/2-MDX.ini +0 -5
  178. package/styles/Microsoft/AMPM.yml +0 -9
  179. package/styles/Microsoft/Accessibility.yml +0 -30
  180. package/styles/Microsoft/Acronyms.yml +0 -64
  181. package/styles/Microsoft/Adverbs.yml +0 -272
  182. package/styles/Microsoft/Auto.yml +0 -11
  183. package/styles/Microsoft/Avoid.yml +0 -14
  184. package/styles/Microsoft/Contractions.yml +0 -50
  185. package/styles/Microsoft/Dashes.yml +0 -13
  186. package/styles/Microsoft/DateFormat.yml +0 -8
  187. package/styles/Microsoft/DateNumbers.yml +0 -40
  188. package/styles/Microsoft/DateOrder.yml +0 -8
  189. package/styles/Microsoft/Ellipses.yml +0 -9
  190. package/styles/Microsoft/FirstPerson.yml +0 -16
  191. package/styles/Microsoft/Foreign.yml +0 -13
  192. package/styles/Microsoft/Gender.yml +0 -8
  193. package/styles/Microsoft/GenderBias.yml +0 -42
  194. package/styles/Microsoft/GeneralURL.yml +0 -11
  195. package/styles/Microsoft/HeadingAcronyms.yml +0 -7
  196. package/styles/Microsoft/HeadingColons.yml +0 -8
  197. package/styles/Microsoft/HeadingPunctuation.yml +0 -13
  198. package/styles/Microsoft/Headings.yml +0 -28
  199. package/styles/Microsoft/Hyphens.yml +0 -14
  200. package/styles/Microsoft/Negative.yml +0 -13
  201. package/styles/Microsoft/Ordinal.yml +0 -13
  202. package/styles/Microsoft/OxfordComma.yml +0 -8
  203. package/styles/Microsoft/Passive.yml +0 -183
  204. package/styles/Microsoft/Percentages.yml +0 -7
  205. package/styles/Microsoft/Plurals.yml +0 -7
  206. package/styles/Microsoft/Quotes.yml +0 -7
  207. package/styles/Microsoft/RangeTime.yml +0 -13
  208. package/styles/Microsoft/Semicolon.yml +0 -8
  209. package/styles/Microsoft/SentenceLength.yml +0 -6
  210. package/styles/Microsoft/Spacing.yml +0 -8
  211. package/styles/Microsoft/Suspended.yml +0 -7
  212. package/styles/Microsoft/Terms.yml +0 -42
  213. package/styles/Microsoft/URLFormat.yml +0 -9
  214. package/styles/Microsoft/Units.yml +0 -16
  215. package/styles/Microsoft/Vocab.yml +0 -25
  216. package/styles/Microsoft/We.yml +0 -11
  217. package/styles/Microsoft/Wordiness.yml +0 -127
  218. package/styles/Microsoft/meta.json +0 -4
  219. package/styles/alex/Ablist.yml +0 -274
  220. package/styles/alex/Condescending.yml +0 -16
  221. package/styles/alex/Gendered.yml +0 -110
  222. package/styles/alex/LGBTQ.yml +0 -55
  223. package/styles/alex/OCD.yml +0 -10
  224. package/styles/alex/Press.yml +0 -12
  225. package/styles/alex/ProfanityLikely.yml +0 -1289
  226. package/styles/alex/ProfanityMaybe.yml +0 -282
  227. package/styles/alex/ProfanityUnlikely.yml +0 -251
  228. package/styles/alex/README.md +0 -27
  229. package/styles/alex/Race.yml +0 -85
  230. package/styles/alex/Suicide.yml +0 -26
  231. package/styles/alex/meta.json +0 -4
  232. package/styles/config/vocabularies/Docs/accept.txt +0 -47
  233. package/styles/config/vocabularies/Docs/reject.txt +0 -4
  234. package/styles/proselint/Airlinese.yml +0 -8
  235. package/styles/proselint/AnimalLabels.yml +0 -48
  236. package/styles/proselint/Annotations.yml +0 -9
  237. package/styles/proselint/Apologizing.yml +0 -8
  238. package/styles/proselint/Archaisms.yml +0 -52
  239. package/styles/proselint/But.yml +0 -8
  240. package/styles/proselint/Cliches.yml +0 -782
  241. package/styles/proselint/CorporateSpeak.yml +0 -30
  242. package/styles/proselint/Currency.yml +0 -5
  243. package/styles/proselint/Cursing.yml +0 -15
  244. package/styles/proselint/DateCase.yml +0 -7
  245. package/styles/proselint/DateMidnight.yml +0 -7
  246. package/styles/proselint/DateRedundancy.yml +0 -10
  247. package/styles/proselint/DateSpacing.yml +0 -7
  248. package/styles/proselint/DenizenLabels.yml +0 -52
  249. package/styles/proselint/Diacritical.yml +0 -95
  250. package/styles/proselint/GenderBias.yml +0 -45
  251. package/styles/proselint/GroupTerms.yml +0 -39
  252. package/styles/proselint/Hedging.yml +0 -8
  253. package/styles/proselint/Hyperbole.yml +0 -6
  254. package/styles/proselint/Jargon.yml +0 -11
  255. package/styles/proselint/LGBTOffensive.yml +0 -13
  256. package/styles/proselint/LGBTTerms.yml +0 -15
  257. package/styles/proselint/Malapropisms.yml +0 -8
  258. package/styles/proselint/Needless.yml +0 -358
  259. package/styles/proselint/Nonwords.yml +0 -38
  260. package/styles/proselint/Oxymorons.yml +0 -22
  261. package/styles/proselint/P-Value.yml +0 -6
  262. package/styles/proselint/RASSyndrome.yml +0 -30
  263. package/styles/proselint/README.md +0 -12
  264. package/styles/proselint/Skunked.yml +0 -13
  265. package/styles/proselint/Spelling.yml +0 -17
  266. package/styles/proselint/Typography.yml +0 -11
  267. package/styles/proselint/Uncomparables.yml +0 -50
  268. package/styles/proselint/Very.yml +0 -6
  269. package/styles/proselint/meta.json +0 -15
  270. package/styles/write-good/Cliches.yml +0 -702
  271. package/styles/write-good/E-Prime.yml +0 -32
  272. package/styles/write-good/Illusions.yml +0 -11
  273. package/styles/write-good/Passive.yml +0 -183
  274. package/styles/write-good/README.md +0 -27
  275. package/styles/write-good/So.yml +0 -5
  276. package/styles/write-good/ThereIs.yml +0 -6
  277. package/styles/write-good/TooWordy.yml +0 -221
  278. package/styles/write-good/Weasel.yml +0 -29
  279. package/styles/write-good/meta.json +0 -4
  280. package/test/dashcam.test.js +0 -137
  281. package/test/mcp-example-test.yaml +0 -27
  282. package/test/test_parser.js +0 -47
  283. package/testdriver/acceptance-sdk/QUICK_REFERENCE.md +0 -61
  284. package/testdriver/acceptance-sdk/README.md +0 -128
  285. package/testdriver/acceptance-sdk/TEST_REPORTING.md +0 -245
  286. package/testdriver/acceptance-sdk/assert.test.mjs +0 -26
  287. package/testdriver/acceptance-sdk/hooks-example.test.mjs +0 -38
  288. package/testdriver/acceptance-sdk/presets-example.test.mjs +0 -87
  289. package/testdriver/acceptance-sdk/setup/testHelpers.mjs +0 -420
  290. package/testdriver/acceptance-sdk/sully-ai.test.mjs +0 -234
  291. package/testdriver/acceptance-sdk/type-checking-demo.js +0 -49
  292. package/vale.ini +0 -18
  293. package/vitest.config.example.js +0 -19
  294. package/vitest.config.mjs.bak +0 -44
  295. /package/docs/{ARCHITECTURE.md → v7/_drafts/architecture.mdx} +0 -0
  296. /package/docs/{AWESOME_LOGS_QUICK_REF.md → v7/_drafts/awesome-logs-quick-ref.mdx} +0 -0
  297. /package/docs/v7/{guides → _drafts}/best-practices.mdx +0 -0
  298. /package/docs/v7/{guides → _drafts}/caching-ai.mdx +0 -0
  299. /package/docs/v7/{guides → _drafts}/caching.mdx +0 -0
  300. /package/docs/{MIGRATION.md → v7/_drafts/cli-to-sdk-migration.mdx} +0 -0
  301. /package/{CONTRIBUTING.md → docs/v7/_drafts/contributing.mdx} +0 -0
  302. /package/docs/v7/{progressive-apis/CORE.md → _drafts/core.mdx} +0 -0
  303. /package/docs/v7/{guides → _drafts}/debugging.mdx +0 -0
  304. /package/docs/v7/{guides → _drafts}/faq.mdx +0 -0
  305. /package/docs/v7/{progressive-apis/HOOKS.md → _drafts/hooks.mdx} +0 -0
  306. /package/docs/v7/{guides → _drafts}/migration.mdx +0 -0
  307. /package/docs/v7/{guides → _drafts}/performance.mdx +0 -0
  308. /package/docs/{PRESETS.md → v7/_drafts/presets.mdx} +0 -0
  309. /package/docs/v7/{progressive-apis/PROGRESSIVE_DISCLOSURE.md → _drafts/progressive-disclosure.mdx} +0 -0
  310. /package/docs/v7/{progressive-apis/PROVISION.md → _drafts/provision.mdx} +0 -0
  311. /package/docs/{SDK_AWESOME_LOGS.md → v7/_drafts/sdk-awesome-logs.mdx} +0 -0
  312. /package/docs/{sdk-browser-rendering.md → v7/_drafts/sdk-browser-rendering.mdx} +0 -0
  313. /package/docs/{TEST_RECORDING.md → v7/_drafts/test-recording.mdx} +0 -0
  314. /package/docs/v7/{guides → _drafts}/vitest.mdx +0 -0
  315. /package/docs/v7/{README.md → overview/readme.mdx} +0 -0
  316. /package/{src → lib}/core/index.d.ts +0 -0
  317. /package/{src → lib}/core/index.js +0 -0
  318. /package/{src → lib}/presets/index.mjs +0 -0
  319. /package/{src → lib}/vitest/hooks.d.ts +0 -0
  320. /package/{debug-locate-response.js → test/manual/debug-locate-response.js} +0 -0
  321. /package/{verify-element-api.js → test/manual/verify-element-api.js} +0 -0
  322. /package/{verify-types.js → test/manual/verify-types.js} +0 -0
  323. /package/{testdriver/acceptance-sdk → test/testdriver}/chrome-extension.test.mjs +0 -0
  324. /package/{testdriver/acceptance-sdk → test/testdriver}/setup/globalTeardown.mjs +0 -0
  325. /package/{testdriver/acceptance-sdk → test/testdriver}/setup/vitestSetup.mjs +0 -0
@@ -1,438 +0,0 @@
1
- ---
2
- title: "Travis CI"
3
- description: "Run TestDriver tests in Travis CI"
4
- icon: "circle-check"
5
- ---
6
-
7
- <Warning>
8
- Travis CI has significantly reduced its free tier. Consider using [GitHub Actions](/v7/guides/ci-cd/github-actions) or [GitLab CI](/v7/guides/ci-cd/gitlab) instead.
9
- </Warning>
10
-
11
- ## Basic Setup
12
-
13
- Create `.travis.yml`:
14
-
15
- ```yaml
16
- language: node_js
17
- node_js:
18
- - 18
19
-
20
- cache:
21
- directories:
22
- - node_modules
23
-
24
- env:
25
- global:
26
- - secure: "encrypted_api_key_here"
27
-
28
- script:
29
- - npx vitest
30
-
31
- after_script:
32
- - cat test-results/*.log || true
33
- ```
34
-
35
- ## Add API Key
36
-
37
- ### Using Travis CLI
38
-
39
- Install Travis CLI:
40
-
41
- ```bash
42
- gem install travis
43
- ```
44
-
45
- Encrypt API key:
46
-
47
- ```bash
48
- # Login to Travis
49
- travis login --pro
50
-
51
- # Encrypt TD_API_KEY
52
- travis encrypt TD_API_KEY="your-api-key" --add env.global
53
- ```
54
-
55
- This automatically adds the encrypted key to `.travis.yml`:
56
-
57
- ```yaml
58
- env:
59
- global:
60
- - secure: "very_long_encrypted_string"
61
- ```
62
-
63
- ### Using Travis Web UI
64
-
65
- 1. Go to repository settings on travis-ci.com
66
- 2. Find **Environment Variables** section
67
- 3. Add variable:
68
- - Name: `TD_API_KEY`
69
- - Value: Your API key from [dashboard.testdriver.ai](https://dashboard.testdriver.ai)
70
- - Display value in build log: **OFF**
71
- 4. Click **Add**
72
-
73
- ## Parallel Tests
74
-
75
- Use build matrix for parallel execution:
76
-
77
- ```yaml
78
- language: node_js
79
- node_js:
80
- - 18
81
-
82
- env:
83
- global:
84
- - secure: "encrypted_api_key"
85
- jobs:
86
- - SHARD=1/4
87
- - SHARD=2/4
88
- - SHARD=3/4
89
- - SHARD=4/4
90
-
91
- cache:
92
- directories:
93
- - node_modules
94
-
95
- script:
96
- - npx vitest --shard=$SHARD
97
- ```
98
-
99
- ## Save Dashcam URLs
100
-
101
- Extract replay URLs from test output:
102
-
103
- ```yaml
104
- script:
105
- - npx vitest 2>&1 | tee test-output.log
106
- - grep -o 'https://dashcam.testdriver.ai/[a-zA-Z0-9-]*' test-output.log > dashcam-urls.txt || true
107
-
108
- after_failure:
109
- - cat dashcam-urls.txt
110
- ```
111
-
112
- ## Scheduled Builds
113
-
114
- Travis doesn't support scheduled builds in config. Configure via web UI:
115
-
116
- 1. Go to repository settings
117
- 2. Find **Cron Jobs** section
118
- 3. Click **Add**
119
- 4. Branch: `main`
120
- 5. Interval: Daily, Weekly, or Monthly
121
- 6. Click **Add**
122
-
123
- ## Multiple Node Versions
124
-
125
- Test across Node.js versions:
126
-
127
- ```yaml
128
- language: node_js
129
- node_js:
130
- - 16
131
- - 18
132
- - 20
133
-
134
- cache:
135
- directories:
136
- - node_modules
137
-
138
- env:
139
- global:
140
- - secure: "encrypted_api_key"
141
-
142
- script:
143
- - npx vitest
144
- ```
145
-
146
- ## Conditional Execution
147
-
148
- Skip tests on documentation changes:
149
-
150
- ```yaml
151
- language: node_js
152
- node_js:
153
- - 18
154
-
155
- cache:
156
- directories:
157
- - node_modules
158
-
159
- env:
160
- global:
161
- - secure: "encrypted_api_key"
162
-
163
- before_script:
164
- - |
165
- if git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qvE '\.md$'; then
166
- echo "Code changes detected, running tests"
167
- else
168
- echo "Only documentation changed, skipping tests"
169
- exit 0
170
- fi
171
-
172
- script:
173
- - npx vitest
174
- ```
175
-
176
- ## Retry Failed Tests
177
-
178
- Travis doesn't have built-in retry. Use vitest retry:
179
-
180
- ```javascript
181
- // vitest.config.mjs
182
- export default defineConfig({
183
- test: {
184
- retry: 2
185
- }
186
- });
187
- ```
188
-
189
- Or wrap command:
190
-
191
- ```yaml
192
- script:
193
- - npx vitest || npx vitest || npx vitest
194
- ```
195
-
196
- ## Different OS
197
-
198
- Test on Linux and macOS:
199
-
200
- ```yaml
201
- language: node_js
202
- node_js:
203
- - 18
204
-
205
- os:
206
- - linux
207
- - osx
208
-
209
- cache:
210
- directories:
211
- - node_modules
212
-
213
- env:
214
- global:
215
- - secure: "encrypted_api_key"
216
-
217
- script:
218
- - npx vitest
219
- ```
220
-
221
- ## Stages
222
-
223
- Organize pipeline into stages:
224
-
225
- ```yaml
226
- language: node_js
227
- node_js:
228
- - 18
229
-
230
- cache:
231
- directories:
232
- - node_modules
233
-
234
- env:
235
- global:
236
- - secure: "encrypted_api_key"
237
-
238
- jobs:
239
- include:
240
- - stage: install
241
- script: npm ci
242
-
243
- - stage: test
244
- script: npx vitest
245
- env: SHARD=1/4
246
-
247
- - stage: test
248
- script: npx vitest
249
- env: SHARD=2/4
250
-
251
- - stage: test
252
- script: npx vitest
253
- env: SHARD=3/4
254
-
255
- - stage: test
256
- script: npx vitest
257
- env: SHARD=4/4
258
-
259
- stages:
260
- - install
261
- - test
262
- ```
263
-
264
- ## Artifacts
265
-
266
- Travis doesn't have built-in artifact storage. Upload to external service:
267
-
268
- ```yaml
269
- after_success:
270
- - |
271
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
272
- # Upload to S3, GitHub Releases, etc.
273
- aws s3 cp test-results/ s3://my-bucket/test-results/ --recursive
274
- fi
275
- ```
276
-
277
- ## Notifications
278
-
279
- Configure notifications:
280
-
281
- ```yaml
282
- notifications:
283
- email:
284
- recipients:
285
- - team@example.com
286
- on_success: change # default: change
287
- on_failure: always # default: always
288
-
289
- slack:
290
- rooms:
291
- - secure: "encrypted_slack_webhook"
292
- on_success: change
293
- on_failure: always
294
- ```
295
-
296
- ## Timeout
297
-
298
- Set script timeout:
299
-
300
- ```yaml
301
- script:
302
- - travis_wait 30 npx vitest # Wait up to 30 minutes
303
- ```
304
-
305
- ## Troubleshooting
306
-
307
- ### Tests timeout
308
-
309
- Default timeout is 10 minutes. Increase:
310
-
311
- ```yaml
312
- script:
313
- - travis_wait 30 npx vitest
314
- ```
315
-
316
- ### Build doesn't start
317
-
318
- Travis CI free tier has limited capacity. Builds may queue for hours.
319
-
320
- ### API key not found
321
-
322
- Debug environment:
323
-
324
- ```yaml
325
- before_script:
326
- - echo "Has TD_API_KEY ${TD_API_KEY:+yes}"
327
- - node --version
328
- ```
329
-
330
- ## Complete Example
331
-
332
- Full-featured configuration:
333
-
334
- ```yaml
335
- language: node_js
336
- node_js:
337
- - 18
338
-
339
- cache:
340
- directories:
341
- - node_modules
342
-
343
- env:
344
- global:
345
- - secure: "encrypted_api_key_here"
346
- jobs:
347
- - SHARD=1/4
348
- - SHARD=2/4
349
- - SHARD=3/4
350
- - SHARD=4/4
351
-
352
- before_install:
353
- - npm install -g npm@latest
354
-
355
- install:
356
- - npm ci
357
-
358
- script:
359
- - npx vitest --shard=$SHARD 2>&1 | tee test-output.log
360
- - grep -o 'https://dashcam.testdriver.ai/[a-zA-Z0-9-]*' test-output.log > dashcam-urls.txt || true
361
-
362
- after_failure:
363
- - echo "Dashcam URLs:"
364
- - cat dashcam-urls.txt || true
365
-
366
- after_script:
367
- - cat test-results/*.log || true
368
-
369
- notifications:
370
- email:
371
- on_success: change
372
- on_failure: always
373
-
374
- branches:
375
- only:
376
- - main
377
- - develop
378
- ```
379
-
380
- ## Migration to GitHub Actions
381
-
382
- Travis CI has become less attractive. Here's equivalent GitHub Actions config:
383
-
384
- ```yaml
385
- # .github/workflows/test.yml
386
- name: Tests
387
-
388
- on: [push, pull_request]
389
-
390
- jobs:
391
- test:
392
- runs-on: ubuntu-latest
393
- strategy:
394
- matrix:
395
- shard: [1, 2, 3, 4]
396
-
397
- steps:
398
- - uses: actions/checkout@v3
399
-
400
- - uses: actions/setup-node@v3
401
- with:
402
- node-version: '18'
403
- cache: 'npm'
404
-
405
- - run: npm ci
406
-
407
- - run: npx vitest --shard=${{ matrix.shard }}/4
408
- env:
409
- TD_API_KEY: ${{ secrets.TD_API_KEY }}
410
-
411
- - uses: actions/upload-artifact@v3
412
- if: always()
413
- with:
414
- name: test-results
415
- path: test-results/
416
- ```
417
-
418
- See [GitHub Actions guide](/v7/guides/ci-cd/github-actions) for details.
419
-
420
- ## See Also
421
-
422
- <CardGroup cols={2}>
423
- <Card title="CI/CD Overview" icon="arrows-spin" href="/v7/guides/ci-cd/overview">
424
- CI/CD concepts
425
- </Card>
426
-
427
- <Card title="GitHub Actions" icon="github" href="/v7/guides/ci-cd/github-actions">
428
- Recommended alternative
429
- </Card>
430
-
431
- <Card title="GitLab CI" icon="gitlab" href="/v7/guides/ci-cd/gitlab">
432
- Another alternative
433
- </Card>
434
-
435
- <Card title="Travis CI Docs" icon="book" href="https://docs.travis-ci.com/">
436
- Official docs
437
- </Card>
438
- </CardGroup>
@@ -1,96 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- /**
4
- * TestDriver SDK Test Results Viewer
5
- * Displays a formatted summary of test results from the JSON output
6
- */
7
-
8
- import fs from "fs";
9
- import path from "path";
10
-
11
- const RESULTS_PATH = "test-results/results.json";
12
-
13
- function formatDuration(ms) {
14
- if (ms < 1000) return `${ms}ms`;
15
- return `${(ms / 1000).toFixed(2)}s`;
16
- }
17
-
18
- function displayResults() {
19
- if (!fs.existsSync(RESULTS_PATH)) {
20
- console.error("❌ No test results found. Run tests first:");
21
- console.error(" npm run test:sdk");
22
- process.exit(1);
23
- }
24
-
25
- const results = JSON.parse(fs.readFileSync(RESULTS_PATH, "utf8"));
26
-
27
- const total = results.numTotalTests || 0;
28
- const passed = results.numPassedTests || 0;
29
- const failed = results.numFailedTests || 0;
30
- const skipped = results.numPendingTests || 0;
31
- const duration = results.testResults?.reduce(
32
- (sum, file) => sum + (file.endTime - file.startTime),
33
- 0,
34
- );
35
-
36
- console.log("\n🧪 TestDriver SDK Test Results");
37
- console.log("═".repeat(50));
38
- console.log(`✅ Passed: ${passed}/${total}`);
39
- console.log(`❌ Failed: ${failed}/${total}`);
40
- console.log(`⏭️ Skipped: ${skipped}/${total}`);
41
- console.log(`⏱️ Duration: ${formatDuration(duration)}`);
42
- console.log("═".repeat(50));
43
-
44
- if (failed > 0) {
45
- console.log("\n❌ Failed Tests:\n");
46
- results.testResults?.forEach((file) => {
47
- const failedTests =
48
- file.assertionResults?.filter((test) => test.status === "failed") || [];
49
-
50
- if (failedTests.length > 0) {
51
- console.log(`📁 ${path.relative(process.cwd(), file.name)}`);
52
- failedTests.forEach((test) => {
53
- console.log(` ❌ ${test.title}`);
54
- console.log(` Duration: ${formatDuration(test.duration)}`);
55
- if (test.failureMessages?.length > 0) {
56
- console.log("\n Error:");
57
- test.failureMessages.forEach((msg) => {
58
- // Truncate very long error messages
59
- const truncated =
60
- msg.length > 500 ? msg.substring(0, 500) + "..." : msg;
61
- console.log(
62
- " " + truncated.split("\n").join("\n ") + "\n",
63
- );
64
- });
65
- }
66
- });
67
- console.log();
68
- }
69
- });
70
- }
71
-
72
- if (passed > 0) {
73
- console.log("✅ Passed Tests:\n");
74
- results.testResults?.forEach((file) => {
75
- const passedTests =
76
- file.assertionResults?.filter((test) => test.status === "passed") || [];
77
-
78
- if (passedTests.length > 0) {
79
- console.log(`📁 ${path.relative(process.cwd(), file.name)}`);
80
- passedTests.forEach((test) => {
81
- console.log(` ✅ ${test.title} (${formatDuration(test.duration)})`);
82
- });
83
- console.log();
84
- }
85
- });
86
- }
87
-
88
- console.log("\n📊 View detailed HTML report:");
89
- console.log(" npm run test:sdk:report");
90
- console.log(" or open: test-results/index.html\n");
91
-
92
- // Exit with error code if tests failed
93
- process.exit(failed > 0 ? 1 : 0);
94
- }
95
-
96
- displayResults();
@@ -1,108 +0,0 @@
1
- /**
2
- * Extended Vitest test functions for TestDriver
3
- *
4
- * Provides custom test modifiers:
5
- * - it.once() - Only runs once per sandbox session (skipped on reconnect)
6
- *
7
- * The reconnection state is determined by the TestDriver SDK after connect().
8
- *
9
- * @example
10
- * import { describe, it, beforeAll, expect } from 'testdriverai/vitest';
11
- * import TestDriver from 'testdriverai';
12
- *
13
- * describe('My Test', () => {
14
- * let testdriver;
15
- *
16
- * beforeAll(async () => {
17
- * testdriver = new TestDriver(process.env.TD_API_KEY);
18
- * await testdriver.connect();
19
- *
20
- * // Store globally so it.once() can access it
21
- * globalThis.__testdriver = testdriver;
22
- * });
23
- *
24
- * // Only runs once per sandbox session (skipped on reconnect)
25
- * it.once('launch the application', async () => {
26
- * await testdriver.exec('sh', 'google-chrome https://example.com', 5000);
27
- * });
28
- *
29
- * // Always runs
30
- * it('click the button', async () => {
31
- * await testdriver.find('Button').click();
32
- * });
33
- * });
34
- */
35
-
36
- import { afterAll, beforeAll, expect, describe as vitestDescribe, it as vitestIt, test as vitestTest } from 'vitest';
37
-
38
- /**
39
- * Get the TestDriver instance from global state
40
- * @returns {Object|null} TestDriver instance or null
41
- */
42
- function getTestDriver() {
43
- return globalThis.__testdriver || null;
44
- }
45
-
46
- /**
47
- * Check if we're reconnected to an existing sandbox
48
- * Uses the SDK's isReconnected property set after connect()
49
- * @returns {boolean} true if reconnected to existing sandbox
50
- */
51
- function isReconnected() {
52
- const testdriver = getTestDriver();
53
- if (!testdriver) {
54
- // No testdriver yet - assume new sandbox (setup should run)
55
- return false;
56
- }
57
- return testdriver.isReconnected === true;
58
- }
59
-
60
- /**
61
- * Extended test function with .once() modifier
62
- */
63
- function createExtendedIt(baseIt) {
64
- const extended = function(name, fn, timeout) {
65
- return baseIt(name, fn, timeout);
66
- };
67
-
68
- // Copy all properties from base it
69
- Object.assign(extended, baseIt);
70
-
71
- /**
72
- * it.once() - Only runs once per sandbox session, skipped on reconnect
73
- * Use for provisioning, app launch, initial navigation
74
- *
75
- * The test checks testdriver.isReconnected which is set by the SDK
76
- * after connect() based on whether it reconnected to an existing
77
- * sandbox or created a new one.
78
- */
79
- extended.once = function(name, fn, timeout) {
80
- return baseIt(name, async (...args) => {
81
- if (isReconnected()) {
82
- console.log(`⏭️ Skipping (already run in this sandbox): ${name}`);
83
- return;
84
- }
85
- return fn(...args);
86
- }, timeout);
87
- };
88
-
89
- // Preserve skip, only, todo, etc.
90
- if (baseIt.skip) extended.skip = baseIt.skip;
91
- if (baseIt.only) extended.only = baseIt.only;
92
- if (baseIt.todo) extended.todo = baseIt.todo;
93
- if (baseIt.concurrent) extended.concurrent = baseIt.concurrent;
94
- if (baseIt.sequential) extended.sequential = baseIt.sequential;
95
-
96
- return extended;
97
- }
98
-
99
- // Create extended test functions
100
- export const it = createExtendedIt(vitestIt);
101
- export const test = createExtendedIt(vitestTest);
102
-
103
- // Re-export other vitest functions unchanged
104
- export { afterAll, beforeAll, vitestDescribe as describe, expect };
105
-
106
- // Also export utility for manual checking
107
- export { getTestDriver, isReconnected };
108
-
@@ -1,64 +0,0 @@
1
- /**
2
- * TestDriver Vitest Integration
3
- *
4
- * Main entry point for the TestDriver Vitest plugin.
5
- *
6
- * @example
7
- * // Basic usage - auto-managed lifecycle
8
- * import { TestDriver } from 'testdriverai/vitest';
9
- *
10
- * test('my test', async (context) => {
11
- * const testdriver = TestDriver(context, { headless: true });
12
- * await testdriver.provision.chrome({ url: 'https://example.com' });
13
- * await testdriver.find('Login button').click();
14
- * });
15
- *
16
- * @example
17
- * // With extended test functions (it.once for setup steps)
18
- * import { describe, it, expect, TestDriver } from 'testdriverai/vitest';
19
- *
20
- * describe('My Suite', () => {
21
- * it.once('launch app', async (context) => {
22
- * const testdriver = TestDriver(context);
23
- * await testdriver.provision.chrome({ url: 'https://example.com' });
24
- * });
25
- *
26
- * it('click button', async (context) => {
27
- * const testdriver = TestDriver(context);
28
- * await testdriver.find('Button').click();
29
- * });
30
- * });
31
- *
32
- * @example
33
- * // Using lifecycle helpers directly
34
- * import { TestDriver, launchChrome, waitForPage } from 'testdriverai/vitest';
35
- *
36
- * test('custom setup', async (context) => {
37
- * const testdriver = TestDriver(context);
38
- * await testdriver.ready();
39
- * await launchChrome(testdriver, 'https://example.com', { guest: true });
40
- * await waitForPage(testdriver, 'Welcome');
41
- * });
42
- */
43
-
44
- // Core TestDriver hook
45
- export { TestDriver } from './hooks.mjs';
46
-
47
- // Extended Vitest functions
48
- export {
49
- afterAll, beforeAll, describe, expect, getTestDriver,
50
- isReconnected, it,
51
- test
52
- } from './extended.mjs';
53
-
54
- // Lifecycle helpers
55
- export {
56
- addDashcamLog, authDashcam, launchChrome, launchChromeExtension, launchChromeForTesting, runPostrun, runPrerun, runPrerunChromeExtension, runPrerunChromeForTesting, startDashcam,
57
- stopDashcam, waitForPage
58
- } from './lifecycle.mjs';
59
-
60
- // Utility functions
61
- export {
62
- generateTestId, retryAsync, setupEventLogging, sleep, waitFor
63
- } from './utils.mjs';
64
-