Shelex / cypress-allure-plugin

cypress plugin to use allure reporter api in tests
https://shelex.github.io/cypress-allure-plugin-example/
Apache License 2.0
159 stars 44 forks source link

Generate tests in forEach loop mark first loop with tests as skipped #183

Closed PeaceDate closed 1 year ago

PeaceDate commented 1 year ago

If run test as generated in forEach loop, as Example

const appsData = [
    {
        headerSelector: baseSelectors.h1,
        subHeaderSelector: baseSelectors.h2,
        buttonSelector: baseSelectors.button,
        host: 3001
    },
    {
        headerSelector: baseSelectors.h1,
        subHeaderSelector: baseSelectors.h2,
        buttonSelector: baseSelectors.button,
        host:3002
    }
]

appsData.forEach(
    (property: {
        headerSelector: string
        subHeaderSelector: string
        buttonSelector: string,
    }) => {

        describe(`Test suite`, () => {
           context(`Some check`, () => {
               beforeEach(() => {
                  basePage.openLocalhost(host)
              })

              it(`Some case`, () => {
                 basePage.checkSomeFeature(property.headerSelector);
                 basePage.checkSomeFeature(property.subHeaderSelector);
                 basePage.checkSomeFeature(property.buttonSelector);
              })
           })
        })
      })
    })
  })

These tests, as in the example it will be two test, will be displays in test report: First loop will be skipped (but it's passed) <--- That is not good :( Second will be passed (That is good :) )

What should I do?

Typescript + Cypress 10.11.0

Screenshots:

Screenshot 2023-01-26 at 22 02 24 Screenshot 2023-01-26 at 22 02 33 Screenshot 2023-01-26 at 22 03 00
Shelex commented 1 year ago

Does not reproduce for me in latest fix (v2.34.1), where some skipping tests logic was fixed and it may had an impact resulting in this case as well. If it still - please reopen this issue.

PeaceDate commented 1 year ago

@Shelex Still reproduce

Test

Screenshot 2023-02-02 at 21 10 27

Latest version (v2.34.1)

Screenshot 2023-02-02 at 21 09 46

Result

Screenshot 2023-02-02 at 21 08 56
PeaceDate commented 1 year ago

@Shelex Here more information and ready repo for test HERE

PeaceDate commented 1 year ago

I've reopened it in new issue #188