@mablhq/mabl-cli 2.57.0 → 2.57.4
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/api/mablApiClient.js +10 -2
- package/browserEngines/chromiumBrowserEngine.js +2 -3
- package/browserLauncher/index.js +1 -1
- package/execution/index.js +1 -1
- package/package.json +3 -3
- package/popupDismissal/index.js +4 -3
- package/providers/cliConfigProvider.js +2 -1
- package/resources/popupDismissal.js +1 -1
- package/util/CloudStorageWriter.js +1 -1
package/api/mablApiClient.js
CHANGED
|
@@ -612,6 +612,14 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
|
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
614
|
async evaluateAiAssertion(workspaceId, testRunId, screenshot, userPrompt, metaPrompt, criteria, test, variables) {
|
|
615
|
+
const requestUrl = `${this.baseApiUrl}/analysis/${workspaceId}/assertion/evaluate`;
|
|
616
|
+
return this.evaluateAiAssertionInternal(requestUrl, testRunId, screenshot, userPrompt, metaPrompt, criteria, test, variables);
|
|
617
|
+
}
|
|
618
|
+
async externalToolsAiAssertion(workspaceId, testRunId, screenshot, userPrompt, criteria, test, variables) {
|
|
619
|
+
const requestUrl = `${this.baseApiUrl}/externalTools/${workspaceId}/assertion/evaluate`;
|
|
620
|
+
return this.evaluateAiAssertionInternal(requestUrl, testRunId, screenshot, userPrompt, undefined, criteria, test, variables);
|
|
621
|
+
}
|
|
622
|
+
async evaluateAiAssertionInternal(requestUrl, testRunId, screenshot, userPrompt, metaPrompt, criteria, test, variables) {
|
|
615
623
|
try {
|
|
616
624
|
const body = {
|
|
617
625
|
test_run_id: testRunId,
|
|
@@ -627,10 +635,10 @@ class MablApiClient extends basicApiClient_1.BasicApiClient {
|
|
|
627
635
|
meta_prompt: metaPrompt,
|
|
628
636
|
};
|
|
629
637
|
}
|
|
630
|
-
return await this.makePostRequestWithRetries(
|
|
638
|
+
return await this.makePostRequestWithRetries(requestUrl, body, GENAI_RETRY_OPTIONS);
|
|
631
639
|
}
|
|
632
640
|
catch (error) {
|
|
633
|
-
throw toApiError('Failed to evaluate the AI
|
|
641
|
+
throw toApiError('Failed to evaluate the AI assertion', error);
|
|
634
642
|
}
|
|
635
643
|
}
|
|
636
644
|
async createBranch(workspaceId, branchName) {
|
|
@@ -34,7 +34,6 @@ const mobileEmulationUtil_1 = require("../commands/tests/mobileEmulationUtil");
|
|
|
34
34
|
const resourceUtil_1 = require("../util/resourceUtil");
|
|
35
35
|
const browserEngine_1 = require("./browserEngine");
|
|
36
36
|
const cliConfigProvider_1 = require("../providers/cliConfigProvider");
|
|
37
|
-
const configKeys_1 = require("../commands/config/config_cmds/configKeys");
|
|
38
37
|
const loggingProvider_1 = require("../providers/logging/loggingProvider");
|
|
39
38
|
const chromeFinder = require('chrome-launcher/dist/chrome-finder');
|
|
40
39
|
const launchUtils = require('chrome-launcher/dist/utils');
|
|
@@ -151,14 +150,14 @@ class ChromiumBrowserEngine {
|
|
|
151
150
|
return preferences;
|
|
152
151
|
}
|
|
153
152
|
async findBrowserExecutable() {
|
|
154
|
-
const existingLocation = await cliConfigProvider_1.CliConfigProvider.getConfigProperty(
|
|
153
|
+
const existingLocation = await cliConfigProvider_1.CliConfigProvider.getConfigProperty(cliConfigProvider_1.BROWSER_CONFIG_KEY);
|
|
155
154
|
if (typeof existingLocation === 'string' &&
|
|
156
155
|
existingLocation &&
|
|
157
156
|
fs.existsSync(existingLocation)) {
|
|
158
157
|
return existingLocation;
|
|
159
158
|
}
|
|
160
159
|
const chromePath = this.searchForChrome();
|
|
161
|
-
await cliConfigProvider_1.CliConfigProvider.setConfigProperty(
|
|
160
|
+
await cliConfigProvider_1.CliConfigProvider.setConfigProperty(cliConfigProvider_1.BROWSER_CONFIG_KEY, chromePath);
|
|
162
161
|
return chromePath;
|
|
163
162
|
}
|
|
164
163
|
searchForChrome() {
|