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

Add support for retries for CodeceptJS #686

Merged
merged 6 commits into from
May 24, 2023

Conversation

hatufacci
Copy link
Contributor

@hatufacci hatufacci commented May 22, 2023

Fix #685
Change lint to allow underscore

Context

Checklist

Sorry, something went wrong.

Change lint to allow underscore
@CLAassistant
Copy link

CLAassistant commented May 22, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

@vovsemenv vovsemenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome 🔥 !!!!! can i also ask you to write at least one test for this scenario? If its tooo hard right now ill do

@vovsemenv vovsemenv added the type:bug Something isn't working label May 22, 2023
@hatufacci
Copy link
Contributor Author

@vovsemenv could you please take a look?

@hatufacci hatufacci requested a review from vovsemenv May 23, 2023 07:14
@kobenguyent
Copy link
Contributor

Hi @vovsemenv may you have in mind when it would be released

@@ -0,0 +1,47 @@
const allurePlugin = require( "../src/index.ts");
describe('handleRetries', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess i need simplify this test later

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vovsemenv could you please run build again ?)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks fine for now but i imagine we can do it like this

import { expect } from "@jest/globals";
import { runTests } from "./utils/run-tests";

test("retries", async () => {
  const res = await runTests({
    files: {
      "retries.test.js": /* js */ `
        Feature("retries-feature");
        Scenario("Failing feature", ({ I }) => {
          //@ts-ignore
          if (!global.shouldPass) {
            throw new Error("Test Fail");
          }
          //@ts-ignore
          global.shouldPass = true;
        }).retry(1);
      `,
    },
  });
  expect(res.tests.length).toBe(2);
  expect(res.tests).toEqual(
    expect.arrayContaining([
      expect.objectContaining({
        fullName: "retries.test.js#Failing feature",
      }),
    ]),
  );
});

Copy link
Contributor

@vovsemenv vovsemenv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hatufacci hatufacci requested a review from vovsemenv May 24, 2023 10:33
@baev baev added type:improvement Improvement or request and removed type:bug Something isn't working labels May 24, 2023
@baev baev changed the title Add retries logic for codeceptjs Add support for retries for CodeceptJS May 24, 2023
@baev baev merged commit 72bc7e2 into allure-framework:master May 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Retries don't shown in codeceptjs allure report
6 participants