allure-java icon indicating copy to clipboard operation
allure-java copied to clipboard

Allure2 report do NOT support for cross browser testing

Open dilshan5 opened this issue 6 years ago • 12 comments

I'm submitting a ...

  • [ x] bug report

What is the current behavior?

I use allure report for cross browser testing. Even though the all tests execute in different browsers at the same time but the the report shows only one browser. I used 'AllureCucumber4Jvm'

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

https://github.com/dilshan5/ttaf-ui-intive Sample code is uploaded

What is the expected behavior?

Should display test results for all the browsers which i have executed

What is the motivation / use case for changing the behavior?

Allure support for cross browser testing

Please tell us about your environment:

    <dependency>
        <groupId>io.qameta.allure</groupId>
        <artifactId>allure-cucumber4-jvm</artifactId>
        <version>2.12.1</version>
    </dependency>

Other information

 <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.20</version>
            <configuration>
                <argLine>
                    -javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
                    -Dcucumber.options="--plugin io.qameta.allure.cucumber4jvm.AllureCucumber4Jvm"
                </argLine>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.aspectj</groupId>
                    <artifactId>aspectjweaver</artifactId>
                    <version>${aspectj.version}</version>
                </dependency>
            </dependencies>
        </plugin>

dilshan5 avatar Jul 31 '19 04:07 dilshan5

Hi, Is there any update on this?

dilshan5 avatar Aug 16 '19 06:08 dilshan5

attached allure-results folder allure-results.zip

dilshan5 avatar Aug 16 '19 11:08 dilshan5

Hello, I am trying to do the same thing: See the test reports for each browser using Allure. Any solutions?

auto-qa-git avatar Jan 23 '20 20:01 auto-qa-git

Hi, I am facing the same issue. The last execution overrides the previous execution results. Is there any solution. This is preventing me to execute the multi-browser test (at-least from the reporting point of view)

anshuljayn avatar Apr 22 '20 09:04 anshuljayn

same thing with io.qameta.allure.cucumber5jvm.AllureCucumber5Jvm. No cross browser support yet

motivatedmind avatar Jun 23 '20 09:06 motivatedmind

Hello is there any update? I'm also facing the same issue

vnpt73 avatar Aug 12 '21 03:08 vnpt73

Hi, any update on the cross browser issue ? I'm also facing the same issue.

Davidvasantharaj avatar Dec 08 '21 04:12 Davidvasantharaj

Hi, Is there any solution to this issue yet? I am facing the same issue of cross-browser parallel testing with Cucumber where if the scenarios are run in parallel on multiple browsers then the tests are put under Retries tab. I am running my tests with following dependecies:

  • Selenium Java 4.6
  • Cucumber-TestNG 7.9
  • TestNG 7.9
  • allure-cucumber7-jvm 2.20.1

Below is how my Test suite looks like

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="Smoke Test Suite" thread-count="10" parallel="tests">
    <listeners>
        <listener class-name="framework.listeners.ScenariosParallelTransformer"/>
    </listeners>
    <test  name="Chrome Browser Test">
        <parameter name="browser" value="chrome"/>
        <classes>
            <class name="framework.runners.BaseTestNGRunnerTest"/>
        </classes>
    </test> <!-- Test -->

    <test  name="Firefox Browser Test">
        <parameter name="browser" value="firefox"/>
        <classes>
            <class name="framework.runners.BaseTestNGRunnerTest"/>
        </classes>
    </test> <!-- Test -->
</suite> <!-- Suite -->

As you can see that I am runnin the same BaseTestNGRunnerTest on chrome and firefox in parallel. What actually happens is that if the scenario and/or feature name is same, then the tests are put under Retries Tab in the Test Report for the corresponding scenario, instead of showing it as separate test. In the below pictures you can see that it shows two tests, one as the main test and other as Retry. To differentiate between browsers, I added logs in Hooks.

chrome test firefox test

The Timeline clearly shows the 6 tests running in parallel timeline

but the dashboard and other tabs only shows 3 tests, and mark the remaining 3 tests as Retries. dashboard packages

Expected Behavior: Each Test should be reported as separate test in cross browser parallel testing even if the scenario/feature name is same

Actual Behavior: Tests with same scenario/feature in cross browser parallel testing are shown as same test and the remaining executions of the scenario are put under Retries.

There is also a question for this on Stackoveflow https://stackoverflow.com/questions/58417607/allure-cucumber-jvm-report-for-cross-browser-and-parallel-execution

itkhanz avatar Dec 28 '22 22:12 itkhanz

Any work-around or solution for this issue?

DilipMeghwal avatar Jan 06 '23 05:01 DilipMeghwal

Any update on this issue? Quite an old issue and a basic requirement to display results based on the web browser.. Serenity uses "tags" to do this. But no matter what I've tried, like changing the report name based on the web browser, adding dynamic epics, suits, etc... it always adds the test under "Retries" and doesn't display it separately.

nickator avatar Oct 17 '23 03:10 nickator

workaround: change historyId, but keep there some logic to get everytime same ID + browser name to see history for the test case e.g:

@Story("Your Story Name")
@Test
 public void loginStandardUser() {
       updateTestNameForAllure(browserPrefix() + "YourStoryName");
       standardUserActions.loginAction();
 }

private void updateTestNameAndHistoryIdForAllure(String newName) {
       Allure.getLifecycle().updateTestCase(testResult -> testResult.setName(newName));
       String customHistoryId = Utils.generateConsistentHistoryId(newName, getBrowserName());
       Allure.getLifecycle().updateTestCase(testResult -> testResult.setHistoryId(customUUID));
}

privat String generateConsistentHistoryId(String newName, String browserName) {
       String baseString = newName + browserName;
       return UUID.nameUUIDFromBytes(baseString.getBytes()).toString();
 }

image

nickator avatar Oct 18 '23 08:10 nickator

workaround: change historyId, but keep there some logic to get everytime same ID + browser name to see history for the test case e.g:

@Story("Your Story Name")
@Test
 public void loginStandardUser() {
       updateTestNameForAllure(browserPrefix() + "YourStoryName");
       standardUserActions.loginAction();
 }

private void updateTestNameAndHistoryIdForAllure(String newName) {
       Allure.getLifecycle().updateTestCase(testResult -> testResult.setName(newName));
       String customHistoryId = Utils.generateConsistentHistoryId(newName, getBrowserName());
       Allure.getLifecycle().updateTestCase(testResult -> testResult.setHistoryId(customUUID));
}

privat String generateConsistentHistoryId(String newName, String browserName) {
       String baseString = newName + browserName;
       return UUID.nameUUIDFromBytes(baseString.getBytes()).toString();
 }

image

Thanks, it works 🕺

standbyoneself avatar May 06 '24 13:05 standbyoneself