Innovenergy_trunk/frontend/node_modules/testcafe-reporter-dashboard/lib/texts.js

23 lines
2.7 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createTestCafeVersionIncompatibledError = exports.createTestCafeVersionInvalidError = exports.createGithubInfoError = exports.createReporterMethodName = exports.createLongBuildIdError = exports.createGetUploadInfoError = exports.createWarningUploadError = exports.createTestUploadError = exports.createFileUploadError = exports.createReportUrlMessage = exports.FETCH_NETWORK_CONNECTION_ERROR = exports.AUTHENTICATION_TOKEN_INVALID = exports.AUTHENTICATION_TOKEN_NOT_DEFINED = exports.DASHBOARD_LOCATION_NOT_DEFINED = void 0;
const jsonwebtoken_1 = require("jsonwebtoken");
const consts_1 = require("./consts");
exports.DASHBOARD_LOCATION_NOT_DEFINED = 'The \'TESTCAFE_DASHBOARD_URL\' environment variable is not defined.';
exports.AUTHENTICATION_TOKEN_NOT_DEFINED = 'The \'TESTCAFE_DASHBOARD_AUTHENTICATION_TOKEN\' environment variable is not defined.';
exports.AUTHENTICATION_TOKEN_INVALID = 'The \'TESTCAFE_DASHBOARD_AUTHENTICATION_TOKEN\' environment variable does not contain a valid token. Check the value for typos.';
exports.FETCH_NETWORK_CONNECTION_ERROR = 'Connection failed';
exports.createReportUrlMessage = (reportId, authenticationToken, dashboardUrl) => {
const token = jsonwebtoken_1.decode(authenticationToken);
return `Task execution report: ${dashboardUrl}/runs/${token.projectId}/${encodeURIComponent(reportId)}`;
};
exports.createFileUploadError = (uploadId, filePath) => `Failed to upload visual artifacts. Upload ID: ${uploadId}, file path: ${filePath}.`;
exports.createTestUploadError = (uploadId, testName) => `Failed to upload a test log. Upload ID: ${uploadId}, test name: ${testName}.`;
exports.createWarningUploadError = (uploadId, uploadEntityId) => `Failed to upload warning data. Upload ID: ${uploadId}, upload entity id: ${uploadEntityId}.`;
exports.createGetUploadInfoError = (uploadEntityId, response) => `Cannot get an upload URL. Upload entity ID: ${uploadEntityId}. Response: ${response}`;
exports.createLongBuildIdError = (buildId) => `Build ID cannot be longer than ${consts_1.MAX_BUILD_ID_LENGTH} symbols. Build ID: ${buildId}.`;
exports.createReporterMethodName = (reporterMethodName, errorDetails) => `Error occurred in the "dashboard" reporter's "${reporterMethodName}" method. Error details: ${errorDetails}`;
exports.createGithubInfoError = (error) => `Could not retrieve information from the Github Actions environment due to an error: ${error}`;
exports.createTestCafeVersionInvalidError = (tcVersion) => `Unrecognized version of TestCafe: ${tcVersion}`;
exports.createTestCafeVersionIncompatibledError = (tcVersion) => `TestCafe Dashboard does not support TestCafe ${tcVersion}. Please update the TestCafe package.`;