Skip to content

Commit

Permalink
Merge pull request #271 from doc-detective/rc
Browse files Browse the repository at this point in the history
Add runCode functionality, click functionality, and enhance screenshot capabilities
  • Loading branch information
hawkeyexl authored Feb 4, 2025
2 parents 6a2b404 + 44e341b commit 1f0af60
Show file tree
Hide file tree
Showing 13 changed files with 2,643 additions and 2,727 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/npm-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ jobs:
node:
- 18
- 20
- 22

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Cache node_modules
uses: actions/cache@v3
uses: actions/cache@v4
with:
# Cache key uses the contents of `package-lock.json` to identify unique cache
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
Expand Down
28 changes: 13 additions & 15 deletions dev/dev.spec.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,21 @@
{
"id": "httpRequest_OpenAPI support",
"tests": [
{
"openApi": [
{
"name": "reqres",
"descriptionPath": "reqres.openapi.yaml",
"server": "https://reqres.in/api",
"useExample": "both",
"mockResponse": true
}
],
"id": "saveScreenshot_selector",
"description": "Save a screenshot of a specific element",
"steps": [
{
"action": "httpRequest",
"openApi": {
"operationId": "addUser",
"statusCode": 400
}
"action": "goTo",
"url": "http://www.duckduckgo.com"
},
{
"action": "saveScreenshot",
"crop": {
"selector": "#searchbox_homepage",
"padding": 10
},
"path": "test/artifacts/saveScreenshot_selector.png",
"overwrite": "true"
}
]
}
Expand Down
13 changes: 7 additions & 6 deletions dev/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function main() {
recursive: true,
logLevel: "debug",
runTests: {
input: "./test/artifacts/httpRequest_openApi.spec.json",
input: "./dev/dev.spec.json",
output: ".",
setup: "",
cleanup: "",
Expand All @@ -43,13 +43,14 @@ async function main() {
downloadDirectory: ".",
contexts: [
{
app: { name: "chrome", options: { headless: false } },
app: {
name: "firefox",
options: {
headless: false,
},
},
platforms: ["mac", "linux"],
},
{
app: { name: "chrome", options: { headless: true } },
platforms: ["windows"],
},
],
},
runCoverage: {
Expand Down
Loading

0 comments on commit 1f0af60

Please sign in to comment.