Skip to content
New issue

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

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

Already on GitHub? # to your account

Retry() does not work properly when we are using Scenario.only #3439

Closed
JakubKasprzyk opened this issue Oct 7, 2022 · 3 comments · Fixed by #4020
Closed

Retry() does not work properly when we are using Scenario.only #3439

JakubKasprzyk opened this issue Oct 7, 2022 · 3 comments · Fixed by #4020

Comments

@JakubKasprzyk
Copy link

JakubKasprzyk commented Oct 7, 2022

The .retry() does not work properly if we are using it with Scenario.only. I've simulated the test failure and it is not being executed after failure. In the terminal, the result is highlighted in green with the text "OK 0 passed". Below is a screen from the terminal:

image
You can see that the test should fail because we've filled the field with "435,00" and we are expecting to see "222,00"

In addition, I'm attaching the source code below:

Scenario.only(
  'You can save editing of custom product without any changes',
  async ({ I, posPage, device, adminCalendarNavigationPage }) => {
    const { proSalon: salon, logInToAdmin } = await I.getEnvironment({ I });
    await logInToAdmin(salon.owner);
    I.click(adminCalendarNavigationPage.posNavigation);

    if (device.isMobile) {
      I.click(posPage.mobileCheckoutButton);
    }
    const { customProductName: productName, customProductPrice: productPrice } =
      posPage.createCustomProduct(salon.country);

    if (device.isMobile) {
      I.click(posPage.checkout.tooltip.mobileButton);
    } else {
      I.click(posPage.checkout.tooltip.button);
    }
    I.click(posPage.checkout.tooltip.editItem);
    I.click(posPage.addCustomItemDialog.saveButton);
    const productPrice2 = '222,00'
    I.see(productName, posPage.checkout.itemName);
    I.see(`${productPrice2} €`, posPage.checkout.totalPrice);
  },
).retry(2);

I've also tried with { retries: 2 } - but unfortunately with the same result.
I'm working on CodeceptJS + Playwright.

@Horsty80
Copy link
Contributor

Horsty80 commented Oct 11, 2022

I've the same issue with retry(X) for scenario.

With retry, and a failed assert like I.see() with wrong value lead to this strange ending

image

Than without retry(X) we have a correct assert error message like this
image

Otherwise, it's seems that no screenshot are taken when test is failing with retry option enable.

Any idea ?

Versions :

    "codeceptjs": "^3.3.0",
    "playwright": "^1.20.2",

@JakubKasprzyk
Copy link
Author

JakubKasprzyk commented Oct 12, 2022

@Horsty80
I've resolved my problem - it was not working due the .only flag situated next to the Scenario - otherwise it is working properly. Not sure if it will help you but I wanted to let you know about that ;)
I've updated the issue description.

@JakubKasprzyk JakubKasprzyk changed the title Retry() does not work properly Retry() does not work properly when we are using Scenario.only Oct 12, 2022
@Horsty80
Copy link
Contributor

Thanks @JakubKasprzyk
I think is still an issue, if we use .only for debugging the retry() shouldn't conflict.

I need to check but I think in allure report I lose the assert error message (without only)

=/

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants