Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would it be possible to go back to generating test historyId based on fullTitle? #214

Open
JessefSpecialisterren opened this issue Jun 20, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@JessefSpecialisterren
Copy link

Starting with 9ba39f3, cypress-allure-plugin bases the historyId of a test on its title instead of its fullTitle. This causes several tests to disappear from our report because they have identical titles. Their fullTitles are different because they are in different suites

I know cypress-allure-plugin v2.40.0 allows specifying your own string to be hashed into historyId, but we have several instances of equal test titles within the same spec file, and I don't see a way to determine the fullTitle with the information available there

We have currently opted to revert to an older version of cypress-allure-plugin where things just work, but we would like to be able to upgrade in the future

We could of course try to manually ensure that all test titles are unique, but since there are no warnings/error messages/indications about clashing titles it would be very easy to miss a few, especially since our test suite has become rather large at this point

If the historyId could be generated based on fullTitle again, that would solve our problem neatly. Perhaps even the relative path of the spec file could be included by default, so that disappearing tests because of title clashes shouldn't happen at all under normal circumstances. That last part is more of a feature request than a bug report, but I thought I'd include it 🙂. Thanks so much for building and maintaining this plugin, it's an important part of our test pipeline and much appreciated!

@JessefSpecialisterren JessefSpecialisterren added the bug Something isn't working label Jun 20, 2023
@Shelex
Copy link
Owner

Shelex commented Feb 29, 2024

Hi.

That was implemented exactly as an attempt to fix "disappearing" tests due to names duplication
https://github.com/Shelex/cypress-allure-plugin?tab=readme-ov-file#test-name-duplicates

In case full title is still required for some reason, it could be used in combination with relative spec path or just as a fullTitle:

Cypress.Allure.reporter.getInterface().defineHistoryId((title, fullTitle) => {
    //return `${Cypress.spec.relative}${fullTitle}`;
    return fullTitle
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants