@jrpool/kilotest 34.0.0 → 34.0.1
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/package.json +1 -1
- package/testRecForm/api.js +6 -0
- package/util.js +2 -2
package/package.json
CHANGED
package/testRecForm/api.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
// IMPORTS
|
|
7
7
|
|
|
8
|
+
const {sendAlert} = require('../alerts')
|
|
8
9
|
const {
|
|
9
10
|
getNowStamp,
|
|
10
11
|
getRandomString,
|
|
@@ -18,6 +19,11 @@ exports.response = async (what, url, why) => {
|
|
|
18
19
|
const thisHost = process.env.THIS_KILOTEST_HOST;
|
|
19
20
|
// Record the recommendation.
|
|
20
21
|
await updateRecs(what, url, why);
|
|
22
|
+
// Alert a manager about it.
|
|
23
|
+
await sendAlert(
|
|
24
|
+
`Kilotest: new test recommendation in the API`,
|
|
25
|
+
`Target: ${what}\nURL: ${url}\nReason: ${why}`
|
|
26
|
+
);
|
|
21
27
|
// Get a response.
|
|
22
28
|
const content = {
|
|
23
29
|
summary: `This response acknowledges a request made by a language model to a Kilotest tool. The model recommended that Kilotest test, for the first time, the ${what} web page at ${url} for front-end quality (i.e. accessibility, usability, and standards conformity). A Kilotest manager usually approves a recommendation within a day. When the recommendation is approved, the testing will be performed and results will become available. You can check for the availability of the results at ${thisHost}/api/targets. Kilotest performs its testing with the help of Testaro, Testilo, and an ensemble of ten rule engines, using a combination of rule- and machine-learning-based methods. Kilotest exposes several API endpoints and several web UI URLs to obtain information from Kilotest reports. To learn more about Kilotest and the advangages of testing with an ensemble of rule engines, visit the deployed instance of Kilotest (${process.env.DEPLOYED_KILOTEST_HOST}), which contains an introduction on its home page and a tutorial.`,
|
package/util.js
CHANGED
|
@@ -640,7 +640,7 @@ const updateRecs = exports.updateRecs = async (what, url, why) => {
|
|
|
640
640
|
// Save the revised recommendations.
|
|
641
641
|
await fs.writeFile(recsPath, getJSON(recs));
|
|
642
642
|
};
|
|
643
|
-
// Processes a test or retest recommendation.
|
|
643
|
+
// Processes a test or retest recommendation in the UI.
|
|
644
644
|
exports.processRec = async (testType, dirName, what, url, why) => {
|
|
645
645
|
// If the recommendation is valid:
|
|
646
646
|
if (
|
|
@@ -658,7 +658,7 @@ exports.processRec = async (testType, dirName, what, url, why) => {
|
|
|
658
658
|
console.log(`Test recommendation received for ${what}: ${plainWhy}`);
|
|
659
659
|
// Alert a manager about it.
|
|
660
660
|
await sendAlert(
|
|
661
|
-
`Kilotest: new ${testType} recommendation`,
|
|
661
|
+
`Kilotest: new ${testType} recommendation in the UI`,
|
|
662
662
|
`Target: ${what}\nURL: ${url}\nReason: ${plainWhy}`
|
|
663
663
|
);
|
|
664
664
|
// Get the template.
|