Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const argv = require('yargs').argv;
const uploadOutput = require('../utils/upload-output');
const retry = require('protractor-retry').retry;
const FOLDER = process.env.FOLDER || '',
SAVE_SCREENSHOT = process.env.SAVE_SCREENSHOT === 'true';
async function afterLaunch(statusCode) {
if (SAVE_SCREENSHOT && statusCode === 1) {
console.log(`Status code is ${statusCode}, trying to save screenshots.`);
let retryCount = 1;
if (argv.retry) {
retryCount = ++argv.retry;
}
try {
console.log('Retry number: ', retryCount);
await uploadOutput(FOLDER, retryCount);
retryCount = ++argv.retry;
}
try {
console.log('Retry number: ', retryCount);
await uploadOutput(FOLDER, retryCount);
console.log('Screenshots saved successfully.');
} catch (e) {
console.log('Error happened while trying to upload screenshots and test reports: ', e);
}
} else {
console.log(`Status code is ${statusCode}, no need to save screenshots.`);
}
if (process.env.CI) {
return retry.afterLaunch(4);
}
}
alfrescoJsApi.login(TestConfig.adf.adminEmail, TestConfig.adf.adminPassword);
try {
await uploadScreenshot(alfrescoJsApi, retryCount);
} catch (error) {
console.error('Error saving screenshot', error);
}
try {
await saveReport(alfrescoJsApi, retryCount);
} catch (error) {
console.error('Error saving Report', error);
}
}
return retry.afterLaunch(4);
}
const retry = require('protractor-retry').retry;
async function onCleanUp(results) {
if (process.env.CI) {
retry.onCleanUp(results);
}
}
module.exports = onCleanUp;
const path = require('path');
const { SpecReporter } = require('jasmine-spec-reporter');
const retry = require('protractor-retry').retry;
const tsConfig = require('./e2e/tsconfig.e2e.json');
const AlfrescoApi = require('@alfresco/js-api').AlfrescoApiCompatibility;
const TestConfig = require('./e2e/test.config');
const RESOURCES = require('./e2e/util/resources');
const SmartRunner = require('protractor-smartrunner');
const resolve = require('path').resolve;
require('ts-node').register({
project: './lib/testing/tsconfig.lib.json'
});
const ACTIVITI_CLOUD_APPS = require('./lib/testing').ACTIVITI_CLOUD_APPS;
const { beforeAllRewrite, afterAllRewrite, beforeEachAllRewrite, afterEachAllRewrite } = require('./e2e/protractor/override-jasmine');
const { uploadScreenshot, saveReport, cleanReportFolder } = require('./e2e/protractor/save-remote');
const argv = require('yargs').argv;
const SpecReporter = require ('jasmine-spec-reporter').SpecReporter;
const jasmineReporters = require('jasmine-reporters') ;
const disableCSSAnimation = require('../utils/disable-css-animation');
const fs = require('fs-extra');
const config = require('../config');
const retry = require('protractor-retry').retry;
const configTs = require(__dirname + '/../../tsconfig.e2e.json');
const SmartRunner = require('protractor-smartrunner');
function onPrepare() {
if (process.env.CI) {
retry.onPrepare();
SmartRunner.apply({
outputDirectory: process.env.COMMUNITY_SMARTRUNNER_DIR || './.protractor-smartrunner',
repoHash: process.env.GIT_HASH
});
}
require('ts-node').register({ project: './e2e/tsconfig.e2e.json' });
require('tsconfig-paths').register({baseUrl: './e2e', paths: configTs.compilerOptions.paths});
async function onCleanUp(results) {
if (process.env.CI) {
retry.onCleanUp(results);
}
}
onCleanUp(results) {
retry.onCleanUp(results);
},
onPrepare() {
afterEachAllRewrite();
beforeEachAllRewrite();
afterAllRewrite();
beforeAllRewrite();
retry.onPrepare();
jasmine.DEFAULT_TIMEOUT_INTERVAL = TIMEOUT;
require('ts-node').register({
project: 'e2e/tsconfig.e2e.json'
});
require("tsconfig-paths").register({
project: 'e2e/tsconfig.e2e.json',
baseUrl: 'e2e/',
paths: tsConfig.compilerOptions.paths
});
browser.manage().window().setSize(width, height);
jasmine.getEnv().addReporter(
function onPrepare() {
if (process.env.CI) {
retry.onPrepare();
SmartRunner.apply({
outputDirectory: process.env.COMMUNITY_SMARTRUNNER_DIR || './.protractor-smartrunner',
repoHash: process.env.GIT_HASH
});
}
require('ts-node').register({ project: './e2e/tsconfig.e2e.json' });
require('tsconfig-paths').register({baseUrl: './e2e', paths: configTs.compilerOptions.paths});
fs.ensureDirSync(config.paths.tmp);
browser.manage().window().setSize(config.browserWidth, config.browserHeight);
browser.waitForAngularEnabled(false);
var generatedSuiteName = Math.random().toString(36).substr(2, 5);