qagentic-reporter 0.1.15 → 0.1.17
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/dist/cypress/index.d.mts +1 -1
- package/dist/cypress/index.d.ts +1 -1
- package/dist/cypress/index.js +91 -77
- package/dist/cypress/index.js.map +1 -1
- package/dist/cypress/index.mjs +91 -77
- package/dist/cypress/index.mjs.map +1 -1
- package/dist/cypress/simple-setup.d.mts +1 -6
- package/dist/cypress/simple-setup.d.ts +1 -6
- package/dist/cypress/simple-setup.js +91 -81
- package/dist/cypress/simple-setup.js.map +1 -1
- package/dist/cypress/simple-setup.mjs +92 -79
- package/dist/cypress/simple-setup.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cypress/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { S as Severity, b as Status, c as Step, u as attach, x as attachJson, w as attachScreenshot, y as attachText, e as epic, f as feature, l as label, g as severity, s as step, d as story, t as tag } from '../attachments-B2zaEsD5.mjs';
|
|
2
|
-
export {
|
|
2
|
+
export { setupQAgentic } from './simple-setup.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* QAagentic Cypress Plugin
|
package/dist/cypress/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { S as Severity, b as Status, c as Step, u as attach, x as attachJson, w as attachScreenshot, y as attachText, e as epic, f as feature, l as label, g as severity, s as step, d as story, t as tag } from '../attachments-B2zaEsD5.js';
|
|
2
|
-
export {
|
|
2
|
+
export { setupQAgentic } from './simple-setup.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* QAagentic Cypress Plugin
|
package/dist/cypress/index.js
CHANGED
|
@@ -893,94 +893,108 @@ function attachJson(data, name = "JSON Data") {
|
|
|
893
893
|
function attachText(text, name = "Text") {
|
|
894
894
|
return attach(text, name, "text/plain", "txt");
|
|
895
895
|
}
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
896
|
+
var QAgenticCypressReporter = class {
|
|
897
|
+
constructor(config) {
|
|
898
|
+
this.currentRun = null;
|
|
899
|
+
this.stats = {
|
|
900
|
+
suites: 0,
|
|
901
|
+
tests: 0,
|
|
902
|
+
passes: 0,
|
|
903
|
+
pending: 0,
|
|
904
|
+
failures: 0,
|
|
905
|
+
start: /* @__PURE__ */ new Date(),
|
|
906
|
+
end: /* @__PURE__ */ new Date(),
|
|
907
|
+
duration: 0
|
|
908
|
+
};
|
|
909
|
+
this.projectName = process.env.QAGENTIC_PROJECT_NAME || config.projectId || "Cypress E2E Tests";
|
|
910
|
+
this.environment = process.env.QAGENTIC_ENVIRONMENT || process.env.NODE_ENV || "e2e";
|
|
911
|
+
const apiUrl = process.env.QAGENTIC_API_URL || "http://localhost:8080";
|
|
912
|
+
configure({
|
|
913
|
+
projectName: this.projectName,
|
|
914
|
+
environment: this.environment,
|
|
915
|
+
apiUrl,
|
|
916
|
+
outputDir: "./qagentic-results"
|
|
917
|
+
});
|
|
918
|
+
this.reporter = QAgenticReporter.getInstance();
|
|
919
|
+
this.stats.start = /* @__PURE__ */ new Date();
|
|
920
|
+
}
|
|
921
|
+
async onRunBegin() {
|
|
911
922
|
try {
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
923
|
+
this.currentRun = await this.reporter.startRun({
|
|
924
|
+
name: this.projectName,
|
|
925
|
+
projectName: this.projectName,
|
|
926
|
+
environment: this.environment,
|
|
927
|
+
startTime: this.stats.start
|
|
917
928
|
});
|
|
918
|
-
console.log("[QAagentic] Test run started successfully:", currentRun?.id);
|
|
919
929
|
} catch (error) {
|
|
920
930
|
console.warn("[QAagentic] Failed to start run:", error);
|
|
921
931
|
}
|
|
922
|
-
}
|
|
923
|
-
|
|
932
|
+
}
|
|
933
|
+
async onTestEnd(test) {
|
|
934
|
+
if (!this.currentRun) return;
|
|
924
935
|
try {
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
isRetry: false,
|
|
951
|
-
isFlaky: false
|
|
952
|
-
};
|
|
953
|
-
if (test.err) {
|
|
954
|
-
testResult.errorMessage = test.err.message;
|
|
955
|
-
testResult.stackTrace = test.err.stack;
|
|
956
|
-
testResult.errorType = "AssertionError";
|
|
957
|
-
}
|
|
958
|
-
console.log("[QAagentic] Reporting test:", testResult.name, "-", testResult.status);
|
|
959
|
-
await reporter.reportTest(testResult);
|
|
960
|
-
} catch (error) {
|
|
961
|
-
console.warn("[QAagentic] Failed to report test:", error);
|
|
962
|
-
}
|
|
936
|
+
const testResult = {
|
|
937
|
+
id: uuid.v4(),
|
|
938
|
+
name: test.title[test.title.length - 1],
|
|
939
|
+
fullName: test.title.join(" > "),
|
|
940
|
+
status: parseStatus(test.state),
|
|
941
|
+
durationMs: test.duration,
|
|
942
|
+
startTime: new Date(Date.now() - test.duration),
|
|
943
|
+
endTime: /* @__PURE__ */ new Date(),
|
|
944
|
+
labels: {
|
|
945
|
+
suite: test.title.slice(0, -1).join(" > "),
|
|
946
|
+
feature: test.title[0]
|
|
947
|
+
},
|
|
948
|
+
links: [],
|
|
949
|
+
parameters: {},
|
|
950
|
+
steps: [],
|
|
951
|
+
attachments: [],
|
|
952
|
+
filePath: test.invocationDetails?.relativeFile || "",
|
|
953
|
+
retryCount: 0,
|
|
954
|
+
isRetry: false,
|
|
955
|
+
isFlaky: false
|
|
956
|
+
};
|
|
957
|
+
if (test.err) {
|
|
958
|
+
testResult.errorMessage = test.err.message;
|
|
959
|
+
testResult.stackTrace = test.err.stack;
|
|
960
|
+
testResult.errorType = "AssertionError";
|
|
963
961
|
}
|
|
964
|
-
|
|
962
|
+
this.stats.tests++;
|
|
963
|
+
if (test.state === "passed") this.stats.passes++;
|
|
964
|
+
if (test.state === "failed") this.stats.failures++;
|
|
965
|
+
if (test.state === "pending") this.stats.pending++;
|
|
966
|
+
await this.reporter.reportTest(testResult);
|
|
965
967
|
} catch (error) {
|
|
966
|
-
console.warn("[QAagentic]
|
|
968
|
+
console.warn("[QAagentic] Failed to report test:", error);
|
|
967
969
|
}
|
|
968
|
-
}
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
970
|
+
}
|
|
971
|
+
async onRunEnd() {
|
|
972
|
+
if (!this.currentRun) return;
|
|
973
|
+
try {
|
|
974
|
+
this.stats.end = /* @__PURE__ */ new Date();
|
|
975
|
+
this.stats.duration = this.stats.end.getTime() - this.stats.start.getTime();
|
|
976
|
+
this.currentRun.endTime = this.stats.end;
|
|
977
|
+
this.currentRun.durationMs = this.stats.duration;
|
|
978
|
+
this.currentRun.total = this.stats.tests;
|
|
979
|
+
this.currentRun.passed = this.stats.passes;
|
|
980
|
+
this.currentRun.failed = this.stats.failures;
|
|
981
|
+
this.currentRun.skipped = this.stats.pending;
|
|
982
|
+
await this.reporter.endRun();
|
|
983
|
+
} catch (error) {
|
|
984
|
+
console.warn("[QAagentic] Failed to end run:", error);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
};
|
|
988
|
+
function setupQAgentic(on, config) {
|
|
989
|
+
const reporter = new QAgenticCypressReporter(config);
|
|
990
|
+
on("before:run", () => reporter.onRunBegin());
|
|
991
|
+
on("after:spec", async (_spec, results) => {
|
|
992
|
+
if (!results?.tests) return;
|
|
993
|
+
for (const test of results.tests) {
|
|
994
|
+
await reporter.onTestEnd(test);
|
|
982
995
|
}
|
|
983
996
|
});
|
|
997
|
+
on("after:run", () => reporter.onRunEnd());
|
|
984
998
|
}
|
|
985
999
|
|
|
986
1000
|
// src/cypress/index.ts
|