message: feat: conditional wait based on response
diff: @@ -29,15 +29,27 @@ import { Challenge } from "../../data/types";
  Cypress.Commands.add(
  "expectChallengeSolved",
  (context: { challenge: string }) => {
  - cy.wait(2000);
  cy.request({
  method: "GET",
  url: "/api/Challenges/?name=" + context.challenge,
  timeout: 60000,
  }).then((response) => {
  let challenge: Challenge = response.body.data[0];
  +
  + if (!challenge.solved) {
  + cy.wait(2000);
  + cy.request({
  + method: "GET",
  + url: "/api/Challenges/?name=" + context.challenge,
  + timeout: 60000,
  + }).then((secondResponse) => {
  + challenge = secondResponse.body.data[0];
  expect(challenge.solved).to.be.true;
  });
  + } else {
  + expect(challenge.solved).to.be.true;
  + }
  + });
  }
  );
  