Skip to content

Commit f0ae775

Browse files
authored
Heretto integration support (#408)
* Heretto API failure workflows * Overwrite * Set octect-stream accept header * Add .env to .gitignore and update Heretto integration schemas with example configuration * Fix variable loading * Handle directories when cleaning temp directory - Check each entry with fs.statSync to determine if it's a directory - Remove directories with fs.rmSync(..., { recursive: true, force: true }) instead of calling fs.unlinkSync - Prevent errors when nested folders are present in the temp folder * Added senarioName to heretto integration
1 parent 8d428bb commit f0ae775

File tree

4 files changed

+1137
-3967
lines changed

4 files changed

+1137
-3967
lines changed

dev/index.js

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
11
const { runTests } = require("../src");
2+
const path = require("path");
3+
require("dotenv").config({ path: path.join(__dirname, ".env") });
24

35
/**
46
* Run tests with a predefined configuration and print the result as pretty-printed JSON.
57
*/
68
async function main() {
79
const json = {
8-
input: "test/artifacts/find_extendedFinding.spec.json",
10+
input: ["heretto:example"],
911
logLevel: "debug",
10-
runOn:[{
11-
platforms: ["linux","windows","mac"],
12-
browsers: [{
13-
name: "firefox",
14-
headless: true
15-
}]
16-
}],
12+
runOn: [
13+
{
14+
platforms: ["linux", "windows", "mac"],
15+
browsers: [
16+
{
17+
name: "firefox",
18+
headless: true,
19+
},
20+
],
21+
},
22+
],
1723
integrations: {
1824
docDetectiveApi: {
19-
apiKey: process.env.KEY
20-
}
21-
}
25+
apiKey: process.env.KEY,
26+
},
27+
heretto: [
28+
{
29+
name: "example",
30+
organizationId: process.env.HERETTO_ORG_ID, // Organization ID is the subdomain of your Heretto instance (e.g., "silva" for "silva.heretto.com")
31+
username: process.env.HERETTO_USERNAME, // Your Heretto username/email
32+
apiToken: process.env.HERETTO_TOKEN, // Your Heretto API token (https://help.heretto.com/en/heretto-ccms/api/ccms-api-authentication/basic-authentication)
33+
},
34+
],
35+
},
2236
};
2337
// console.log(json);
24-
result = await runTests(json);
38+
const result = await runTests(json);
2539
console.log(JSON.stringify(result, null, 2));
2640
}
2741

28-
main();
42+
main();

0 commit comments

Comments
 (0)