Guest User

Untitled

a guest
Feb 16th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. const sh = require('shelljs');
  2.  
  3. const consts = require('./consts');
  4. const {getWdioSuites} = require('./utils/suites.js');
  5. const {TESTS_PATHS} = consts;
  6. const {sendReportToSlack} = require('./utils/slack');
  7. const {addDebugInfoToAllureReport, execSendAllureReport} = require('./utils/allure');
  8.  
  9. exports.config = {
  10.  
  11. hostname: consts.CI || consts.MOON ? consts.MOON_HOST : 'localhost',
  12. port: consts.CI || consts.MOON ? consts.MOON_PORT : 4444,
  13.  
  14. runner: 'local',
  15.  
  16. specs: [
  17. './test/tests/**/*.js',
  18. ],
  19. suites: getWdioSuites(),
  20.  
  21. maxInstances: consts.CI || consts.MOON ? 25 : 1,
  22.  
  23. capabilities: [{
  24. maxInstances: 10,
  25. browserName: consts.BROWSER,
  26. 'goog:chromeOptions': {
  27. args: [
  28. 'incognito',
  29. 'disable-notifications',
  30. 'disable-extensions',
  31. 'disable-infobars'
  32. ]
  33. },
  34. }],
  35. logLevel: 'warn',
  36. deprecationWarnings: true,
  37. bail: 0,
  38. baseUrl: consts.BASE_URL,
  39. waitforTimeout: 6000,
  40. connectionRetryTimeout: 90000,
  41. connectionRetryCount: 3,
  42. services: consts.LOCAL && !consts.MOON ? [
  43. 'selenium-standalone'
  44. ]: [],
  45. framework: 'mocha',
  46. reporters: [
  47. 'spec',
  48. [
  49. 'allure',
  50. {
  51. outputDir: 'reports/allure-results'
  52. }
  53. ],
  54. 'dot'
  55. ],
  56. mochaOpts: {
  57. ui: 'bdd',
  58. timeout: 90000000
  59. },
  60.  
  61. onPrepare: async function(config, capabilities) {
  62. if (consts.LOCAL) {
  63. // Удаляем директорию со старыми отчетами
  64. sh.rm('-rf', 'reports/');
  65. console.log('The old reports folder has been deleted.\n');
  66. }
  67.  
  68. sh.mkdir('-p', 'reports/allure-results');
  69.  
  70. if (consts.LOCAL) {
  71. // Удаляем директорию со старыми ошибками
  72. sh.rm('-rf', '/error_shots');
  73. console.log('The old error_shots folder has been deleted.\n');
  74. }
  75. },
  76. before: function() {
  77. require('@babel/register');
  78. },
  79. onComplete: function(exitCode, config, capabilities, results) {
  80.  
  81. if (consts.CI) {
  82. // Отправляем отчет в allure
  83. const allureReport = execSendAllureReport();
  84.  
  85. // Отправляем отчет в slack
  86. return sendReportToSlack({
  87. allureReport,
  88. suite: consts.TEST_SUITE || config.suite[0],
  89. results,
  90. baseUrl: config.baseUrl,
  91. });
  92. }
  93. },
  94. };
Add Comment
Please, Sign In to add comment