Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const sh = require('shelljs');
- const consts = require('./consts');
- const {getWdioSuites} = require('./utils/suites.js');
- const {TESTS_PATHS} = consts;
- const {sendReportToSlack} = require('./utils/slack');
- const {addDebugInfoToAllureReport, execSendAllureReport} = require('./utils/allure');
- exports.config = {
- hostname: consts.CI || consts.MOON ? consts.MOON_HOST : 'localhost',
- port: consts.CI || consts.MOON ? consts.MOON_PORT : 4444,
- runner: 'local',
- specs: [
- './test/tests/**/*.js',
- ],
- suites: getWdioSuites(),
- maxInstances: consts.CI || consts.MOON ? 25 : 1,
- capabilities: [{
- maxInstances: 10,
- browserName: consts.BROWSER,
- 'goog:chromeOptions': {
- args: [
- 'incognito',
- 'disable-notifications',
- 'disable-extensions',
- 'disable-infobars'
- ]
- },
- }],
- logLevel: 'warn',
- deprecationWarnings: true,
- bail: 0,
- baseUrl: consts.BASE_URL,
- waitforTimeout: 6000,
- connectionRetryTimeout: 90000,
- connectionRetryCount: 3,
- services: consts.LOCAL && !consts.MOON ? [
- 'selenium-standalone'
- ]: [],
- framework: 'mocha',
- reporters: [
- 'spec',
- [
- 'allure',
- {
- outputDir: 'reports/allure-results'
- }
- ],
- 'dot'
- ],
- mochaOpts: {
- ui: 'bdd',
- timeout: 90000000
- },
- onPrepare: async function(config, capabilities) {
- if (consts.LOCAL) {
- // Удаляем директорию со старыми отчетами
- sh.rm('-rf', 'reports/');
- console.log('The old reports folder has been deleted.\n');
- }
- sh.mkdir('-p', 'reports/allure-results');
- if (consts.LOCAL) {
- // Удаляем директорию со старыми ошибками
- sh.rm('-rf', '/error_shots');
- console.log('The old error_shots folder has been deleted.\n');
- }
- },
- before: function() {
- require('@babel/register');
- },
- onComplete: function(exitCode, config, capabilities, results) {
- if (consts.CI) {
- // Отправляем отчет в allure
- const allureReport = execSendAllureReport();
- // Отправляем отчет в slack
- return sendReportToSlack({
- allureReport,
- suite: consts.TEST_SUITE || config.suite[0],
- results,
- baseUrl: config.baseUrl,
- });
- }
- },
- };
Add Comment
Please, Sign In to add comment