question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CodeceptJS: Allure report always opens the latest report - Multiple Browser Execution

See original GitHub issue

What are you trying to achieve?

Trying to execute same tests on different browsers (Chrome and Edge) in parallel and view the test results.

What do you get instead?

CodeceptJS generates 2 reports in the allure-results directory, but always shows the latest report when viewed using allure serve command. Could you please guide me on how to generate a singe report and view the test results executed in both Chrome and Edge?

![image](https://user-images.githubusercontent.com/97806447/182031353-6bb54f3f-0ec2-4155-8565-d8500d2db478.png)

![image](https://user-images.githubusercontent.com/97806447/182031409-f24a484f-3e87-4ddd-bae8-e50bedc964ab.png)

![image](https://user-images.githubusercontent.com/97806447/182032100-dfdeb85c-e910-4ebf-98b6-e460c407b203.png)

Provide test source code if related

Feature('Test Allure report multiple browsers');

Scenario('test something', ({ I }) => {
    I.amOnPage('./');
}).tag('basic');

Details

  • CodeceptJS version: “^3.3.4”
  • NodeJS Version: v16.13.1
  • Operating System: WIndows 10
  • puppeteer || webdriverio || testcafe version (if related): Webdriverio
  • Configuration file:
const { setHeadlessWhen, setCommonPlugins } = require('@codeceptjs/configure');

// turn on headless mode when running with HEADLESS=true environment variable
// export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(process.env.HEADLESS);

// enable all common plugins https://github.com/codeceptjs/configure#setcommonplugins
setCommonPlugins();

exports.config = {
  tests: './webdriver_tests/*_test.js',
  output: './allure-results',
  helpers: {
    WebDriver: {
      url: 'https://docs.qameta.io/allure/#_usage_8',
      browser: 'chrome',
    }
  },
  include: {
    I: './steps_file.js'
  },
  multiple:{
    basic:{
      "browsers": ["chrome", "MicrosoftEdge"],
    },
  },
  plugins: {
    wdio: {
      enabled: true,
      services: ['selenium-standalone'],
    },
    allure: {
      enabled: true,
      outputDir: "./allure-results"
    },
    screenshotOnFail: {
      enabled: true
    },
    stepByStepReport: {
      enabled: true,
      output: "./allure-results"
    },
  },
  bootstrap: null,
  mocha: {},
  name: 'tests'
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
myrepojuly1987commented, Dec 16, 2022

@StasGrishaevTutu You welcome… just leave a msg here if you are still facing issue in generating the aggregate report…will try to share a sample repo tomorrow…

1reaction
myrepojuly1987commented, Dec 16, 2022

@StasGrishaevTutu

Here is the sample. Just ensure the below event gets dispatched as given here https://codecept.io/internal-api/#concepts under 'Event Listeners' section and add the file to the helpers in codecept.conf.js

import { event, config} from 'codeceptjs';

event.dispatcher.on(event.suite.before, function (suite) {
      
    /**
     * Example to fetch the browser name. If executing in multiple test libs then add swtich case for helpers
     * const conf =  config.get();
       const browser = conf.helpers.WebDriver.browser;
     */
    
    const browser = UIHelper.getBrowserName(); //see example above to fetch the browserName
   //modify the suite.title value which is then used by the allure reports
    suite.title = 'Browser' + ': ' + browser.toUpperCase() + ' - ' + suite.title;
  }); 
Read more comments on GitHub >

github_iconTop Results From Across the Web

Reporters - CodeceptJS
Allure reporter (opens new window) is a tool to store and display test reports. It provides nice web UI which contains all important...
Read more >
Plugins - CodeceptJS
By default, allure reports are saved to output directory. ... This plugin allows to slow down tests execution when a test running too...
Read more >
Releases - CodeceptJS
Fixed allure plugin "Unexpected endStep()" error in #3098 (opens new window) by abhimanyupandian (opens new window); [Puppeteer] always close remote browser on ...
Read more >
Web Testing - CodeceptJS
should only have 1 tab open when the browser starts and navigates to the ... should report BeforeSuite errors when executing via run...
Read more >
Parallel Execution - CodeceptJS
Workers are faster and simpler to start, while run-multiple requires additional configuration and can be used to run tests in different browsers ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found