doc-detective 1.2.4 → 2.0.0-beta.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.
Files changed (51) hide show
  1. package/.dev/dev.spec.json +60 -0
  2. package/{sample → .dev}/doc-content.md +5 -9
  3. package/.github/workflows/npm-publish.yml +33 -0
  4. package/README.md +28 -570
  5. package/{src/config.json → config.json} +7 -7
  6. package/icon.png +0 -0
  7. package/package.json +24 -22
  8. package/scripts/postinstall.js +17 -0
  9. package/src/config.js +163 -0
  10. package/src/index.js +28 -43
  11. package/src/tests/checkLink.js +49 -0
  12. package/src/tests/click.js +22 -0
  13. package/src/tests/findElement.js +85 -0
  14. package/src/tests/goTo.js +32 -0
  15. package/src/tests/httpRequest.js +247 -0
  16. package/src/tests/runShell.js +41 -0
  17. package/src/tests/saveScreenshot.js +38 -0
  18. package/src/tests/setVariables.js +30 -0
  19. package/src/tests/startRecording.js +58 -0
  20. package/src/tests/stopRecording.js +38 -0
  21. package/src/tests/typeKeys.js +100 -0
  22. package/src/tests/wait.js +29 -0
  23. package/src/tests.js +523 -0
  24. package/src/tests.test.js +8 -0
  25. package/src/utils.js +455 -0
  26. package/test.js +300 -0
  27. package/cli/coverage.js +0 -4
  28. package/cli/index.js +0 -4
  29. package/cli/suggest.js +0 -4
  30. package/ref/analytics.json +0 -112
  31. package/ref/testDefinition.json +0 -37
  32. package/sample/config.json +0 -136
  33. package/sample/coverage.json +0 -97
  34. package/sample/failedTests/failed-test-recordings-go-here +0 -0
  35. package/sample/results.json +0 -163
  36. package/sample/tests.json +0 -129
  37. package/sample/variables.env +0 -5
  38. package/src/lib/analytics.js +0 -499
  39. package/src/lib/install-mouse-helper.js +0 -72
  40. package/src/lib/tests/goTo.js +0 -39
  41. package/src/lib/tests/httpRequest.js +0 -373
  42. package/src/lib/tests/screenshot.js +0 -145
  43. package/src/lib/tests.js +0 -604
  44. package/src/lib/utils.js +0 -1084
  45. /package/src/{lib/analysis.js → analysis.js} +0 -0
  46. /package/src/{lib/coverage.js → coverage.js} +0 -0
  47. /package/src/{lib/sanitize.js → sanitize.js} +0 -0
  48. /package/src/{lib/suggest.js → suggest.js} +0 -0
  49. /package/src/{lib/tests → tests}/moveMouse.js +0 -0
  50. /package/src/{lib/tests → tests}/record.js +0 -0
  51. /package/src/{lib/tests → tests}/scroll.js +0 -0
@@ -0,0 +1,60 @@
1
+ {
2
+ "id": "Do all the things! - Spec",
3
+ "contexts": [
4
+ {
5
+ "app": {
6
+ "name": "firefox"
7
+ },
8
+ "platforms": ["windows", "mac", "linux"]
9
+ }
10
+ ],
11
+ "tests": [
12
+ {
13
+ "id": "Do all the things! - Test",
14
+ "description": "This test includes nearly every property across all actions.",
15
+ "steps": [
16
+ {
17
+ "action": "setVariables",
18
+ "path": ".env"
19
+ },
20
+ {
21
+ "action": "runShell",
22
+ "command": "echo",
23
+ "args": ["$USER"]
24
+ },
25
+ {
26
+ "action": "checkLink",
27
+ "url": "https://www.duckduckgo.com"
28
+ },
29
+ {
30
+ "action": "httpRequest",
31
+ "url": "https://reqres.in/api/users",
32
+ "method": "post",
33
+ "requestData": {
34
+ "name": "morpheus",
35
+ "job": "leader"
36
+ },
37
+ "responseData": {
38
+ "name": "morpheus",
39
+ "job": "leader"
40
+ },
41
+ "statusCodes": [200, 201]
42
+ },
43
+ {
44
+ "action": "goTo",
45
+ "url": "https://www.google.com"
46
+ },
47
+ {
48
+ "action": "find",
49
+ "selector": "[title=Search]",
50
+ "timeout": 10000,
51
+ "moveTo": true,
52
+ "click": true,
53
+ "typeKeys": {
54
+ "keys": ["shorthair cat", "$ENTER$"]
55
+ }
56
+ }
57
+ ]
58
+ }
59
+ ]
60
+ }
@@ -2,8 +2,6 @@
2
2
 
3
3
  To use Google Search to find information on kittens,
4
4
 
5
- [comment]: # (test start {"id":"process-search-kittens", "file":"./tests.json"})
6
-
7
5
  1. Open [Google Search](https://www.google.com).
8
6
  2. In the search bar, enter "kittens", then press Enter.
9
7
 
@@ -11,16 +9,14 @@ Search results appear on the page.
11
9
 
12
10
  ![Search results for 'kittens'.](results.png)
13
11
 
14
- [comment]: # (test end)
15
-
16
12
  ## Recommended results
17
13
 
18
14
  [comment]: # (test start {"id":"text-match-lucky"})
19
15
 
20
16
  To go directly to a recommended result for your search, use the **I'm Feeling Lucky** button.
21
17
 
22
- [comment]: # (action {"action":"goTo", "uri":"www.google.com"})
23
- [comment]: # (action {"action":"matchText", "css":"#gbqfbb", "text":"I'm Feeling Lucky"})
18
+ [comment]: # (action {"action":"goTo", "url":"https://www.google.com"})
19
+ [comment]: # (action {"action":"find", "selector":"#gbqfbb", "matchText":"I'm Feeling Lucky"})
24
20
  [comment]: # (test end)
25
21
 
26
22
  [comment]: # (test start {"id":"process-lucky-shorthair"})
@@ -29,13 +25,13 @@ To go directly to a recommended result for your search, use the **I'm Feeling Lu
29
25
 
30
26
  1. Open [Google Search](https://www.google.com).
31
27
 
32
- [comment]: # (action {"action":"goTo", "uri":"www.google.com"})
28
+ [comment]: # (action {"action":"goTo", "url":"https://www.google.com"})
33
29
 
34
30
  2. In the search bar, enter "american shorthair cats".
35
31
 
36
- [comment]: # (action {"action":"type", "css":"[title=Search]", "keys":"american shorthair cats"})
32
+ [comment]: # (action {"action":"find", "selector":"[title=Search]", "typeKeys":"american shorthair cats"})
37
33
 
38
34
  3. Click **I'm Feeling Lucky**.
39
35
 
40
- [comment]: # (action {"action":"click", "css":"#gbqfbb"})
36
+ [comment]: # (action {"action":"find", "selector":"#gbqfbb", "click":true})
41
37
  [comment]: # (test end)
@@ -0,0 +1,33 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name: Node.js Package
5
+
6
+ on:
7
+ release:
8
+ types: [created]
9
+
10
+ jobs:
11
+ build:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v3
15
+ - uses: actions/setup-node@v3
16
+ with:
17
+ node-version: 16
18
+ - run: npm ci
19
+ - run: npm test
20
+
21
+ publish-npm:
22
+ needs: build
23
+ runs-on: ubuntu-latest
24
+ steps:
25
+ - uses: actions/checkout@v3
26
+ - uses: actions/setup-node@v3
27
+ with:
28
+ node-version: 16
29
+ registry-url: https://registry.npmjs.org/
30
+ - run: npm ci
31
+ - run: npm publish
32
+ env:
33
+ NODE_AUTH_TOKEN: ${{secrets.npm_token}}