cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.02k stars 3.19k forks source link

Cypress IDE freezes in the middle of the test and is unusable #26526

Closed antoniocl11-w closed 1 year ago

antoniocl11-w commented 1 year ago

Current behavior

Halfway through the normal execution of a test, the screen freezes and the controls are unusable, this has happened with several of my tests, not just this one, and it has been happening for 2 days. I have also tried to update the version, run in the cloud and nothing, the same problem continues. Here´s a video for the problem:

https://user-images.githubusercontent.com/84794179/232729586-0eeb980d-88bf-40f5-bd03-41d9e4d72c6a.mp4

Desired behavior

No response

Test code to reproduce

////////////////////////////////////////////////////////////////////////////////////
/// TEST AUTOMÁTICO: SUBJECT VIEW                                                ///
/// ÚLTIMA ACTUALIZACIÓN: 05/04/2023                                             ///
/// NOTAS: Por añadir comprobaciones y completar según el TP                     ///
////////////////////////////////////////////////////////////////////////////////////

Cypress.on("uncaught:exception", (err, runnable) => {
  return false;
});

describe("Tp16-Subject View", () => {
  //version de before y beforeEach añadida a todos los tests
  before(() => {
    cy.viewport(1366, 768);
    cy.visit(
      Cypress.env("baseUrlDev") +
        "/ff-gf-40786/biologia-e-introduccion-al-laboratorio-biologico"
    );
    cy.wait(3000);
  });

  beforeEach(() => {
    cy.viewport(1366, 768);
    cy.session("save session between tests...", () => {
      cy.visit(
        Cypress.env("baseUrlDev") +
          "/ff-gf-40786/biologia-e-introduccion-al-laboratorio-biologico"
      );
      cy.fixture("users.json").then((user) => {
        cy.loginDev(user.emailTp15, user.passRegression);
      });
    });
    cy.getCookie("takeover");
    cy.visit(
      Cypress.env("baseUrlDev") +
        "/ff-gf-40786/biologia-e-introduccion-al-laboratorio-biologico"
    );
  });

  it("Subject-1. Publicar duda (Pregunta)", () => {
    cy.get('[data-testid="create-social-button"]').should("exist").click();
    cy.get("#title").click().type("Creando pregunta TP16...");
    cy.get("#text")
      .click()
      .type("Creando el contenido de una pregunta para TP16...");
    cy.get("#title").click().clear();
    cy.findByRole("button", { name: /Publicar/i }).click();
    cy.contains("div", "Campo obligatorio").should("be.visible");
    cy.get("#title").click().type("Creando pregunta TP16...");

    //se adjuntan Link e Imagen
    cy.get('[data-testid="add-link-social"]').click({ force: true });
    cy.get('[data-testid="input-link-social"]')
      .clear()
      .type("https://wuolah.com");
    cy.get('[data-testid="confirm-add-link-social"]').click({ force: true });

    cy.get('[data-testid="add-image-social"]').click({ force: true });
    cy.get('[data-testid="upload-image-social"]').should("be.visible");

    cy.get('[data-testid="upload-image-social"]').attachFile(["logo.jpg"], {
      subjectType: "drag-n-drop",
    });
    cy.wait(1500);
    cy.get('[data-testid="remove-image-social"]').should("be.visible");
    cy.wait(2500);
    cy.intercept(
      "POST",
      Cypress.env("GATEWAY_ENDPOINT_DEV") + "/v2/socials"
    ).as("uploadDoubt");
    cy.findByRole("button", { name: /Publicar/i }).click();
    cy.wait("@uploadDoubt").its("response.statusCode").should("eq", 200);
    cy.findByRole("button", { name: "Close" }).click(); //aria-label="Close"

    cy.wait(5000);
    //cy.get('[data-testid="switch-filter-my-documents"]').click({force: true});
    cy.contains(
      'label[data-testid="category-filter-social"] > span',
      "Preguntas y respuestas"
    ).click();
    cy.reload(); //porque hasta que no recargas no aparece el social recién creado
    cy.wait(5000);

    //dar like
    cy.contains("span", "Creando pregunta TP16...").click();
    cy.get('[data-testid="options-artifact-button-selector"]').click({
      force: true,
      multiple: true,
    });
    cy.wait(3000);
    cy.findByTitle("Me gusta").click();

    //editamos el social
    cy.get('[data-testid="options-artifact-button-selector"]').click({
      force: true,
      multiple: true,
    });
    cy.wait(2000);
    cy.contains("button > span", "Editar").click({ force: true });
    cy.get("#title").clear().type("Ahora el titulo de la duda ha sido editado");
    cy.findByRole("button", { name: /Guardar cambios/i }).click();
    cy.wait(2000);
    cy.findByRole("button", { name: "Close" }).click(); //aria-label="Close"
    cy.contains("span", "Ahora el titulo de la duda ha sido editado").click({
      force: true,
    });

    //añadimos comentarios:
    cy.get("#text").click().type("Comentario para la duda de TP15");
    cy.findByRole("button", { name: /Responder/i }).click();

    //y eliminamos comentario y social
    cy.get('[data-testid="options-artifact-button-selector"]').click({
      force: true,
      multiple: true,
    });
    cy.contains("button > span", "Borrar").click({ force: true });
    cy.findByRole("button", { name: /Borrar/i }).click();
    cy.wait(3000);
    cy.get('[data-testid="options-artifact-button-selector"]').click({
      force: true,
      multiple: true,
    });
    cy.contains("button > span", "Borrar").click({ force: true });
    cy.findByRole("button", { name: /Borrar/i }).click();
    cy.wait(3000);
  });

  it("Subject-2. Buscar documento", () => {
    cy.visit(Cypress.env("baseUrlDev") + "/v3/ff-gf-40786/estadistica");
    cy.wait(3000);
    cy.get('[data-testid="subject-input-search"]').click().type("resumenes");
    cy.wait(3000);
    cy.get('[data-testid="subject-input-search"]').clear();
    cy.get('[data-testid="sort-artifacts-selector"]').select("Más relevancia");
    cy.wait(3000);
    cy.get('[data-testid="sort-artifacts-selector"]').select(
      "Más descargas / comentarios"
    );
    cy.wait(3000);
    cy.get('[data-testid="sort-artifacts-selector"]').select("Recientes");
    cy.wait(3000);
    //cy.get('[data-index="0"] > [data-testid="files-selector"]').click(); //clicamos en un doc
    //cy.findByTitle("Cerrar").click(); //cerramos la preview
    //cambiar modo de visualizacion
    cy.get('[data-testid="display-view-artifacs-selector"]').click();
    cy.contains("span", "Lista con miniatura").click();
    cy.wait(2000);
    cy.get('[data-testid="display-view-artifacs-selector"]').click();
    cy.contains("span", "Lista").click();
    //filtrar por exámenes
    cy.contains(
      'label[data-testid="category-filter-examenes"] > span',
      "Exámenes"
    ).click();
    cy.wait(3000);
    cy.contains(
      'label[data-testid="category-filter-examenes"] > span',
      "Exámenes"
    ).click();
    cy.wait(3000);
    cy.contains(
      'label[data-testid="category-filter-apuntes"] > span',
      "Apuntes"
    ).click();
    cy.wait(3000);
    cy.contains(
      'label[data-testid="category-filter-apuntes"] > span',
      "Apuntes"
    ).click();
    cy.wait(3000);
    cy.contains(
      'label[data-testid="category-filter-practicas"] > span',
      "Prácticas"
    ).click();
    cy.wait(3000);
    cy.contains(
      'label[data-testid="category-filter-practicas"] > span',
      "Prácticas"
    ).click();
    cy.wait(3000);
    cy.contains(
      'label[data-testid="category-filter-ejercicios"] > span',
      "Ejercicios"
    ).click();
    cy.wait(3000);
    cy.contains(
      'label[data-testid="category-filter-ejercicios"] > span',
      "Ejercicios"
    ).click();
    cy.wait(3000);
    cy.contains(
      'label[data-testid="category-filter-trabajos"] > span',
      "Trabajos"
    ).click();
    cy.wait(3000);
    cy.contains(
      'label[data-testid="category-filter-trabajos"] > span',
      "Trabajos"
    ).click();
    cy.wait(3000);
    cy.contains(
      'label[data-testid="category-filter-social"] > span',
      "Preguntas y respuestas"
    ).click();
    cy.wait(3000);
    cy.contains(
      'label[data-testid="category-filter-social"] > span',
      "Preguntas y respuestas"
    ).click();

    cy.get('[data-testid="subject-input-search"]')
      .click()
      .type("documento que no existe");
    cy.wait(2000);
    //cy.contains("p", "No hay más resultados").should("be.visible"); //Añadir selectores a EmptyState de Subject.
    cy.wait(2000);
    cy.get('[data-testid="subject-input-search"]').clear();
  });

  it.skip("Subject-3. Botón Subir", () => {
    //comprobaremos que al subir el uploader la asignatura en la que nos encontremos
    //es la seleccionada
    cy.findByRole("button", { name: /Subir/i }).click({ force: true });
    //cy.get('[data-testid="upload-button-selector"]').click({force: true,multiple: true});
    cy.wait(3000);
    cy.findByRole("button", { name: "Close" }).click();
  });

  it.skip("Subject-4. Popover usuario", () => {
    //seleccionamos el primer user de la asignatura
    cy.contains("p", "TeamParacetamol").click();
    //darle mas vueltas a este test a ver que se puede hacer
  });
});

Cypress Version

10.4.0

Node version

16.16.0

Operating System

windows 10.0.22621

Debug Logs

No response

Other

No response

nagash77 commented 1 year ago

Hi @antoniocl11-w , I see you are running an older version of Cypress. Do you have the same issue on Cypress 12.10?

nagash77 commented 1 year ago

Unfortunately we have to close this issue due to inactivity. Please comment if there is new information to provide concerning the original issue and we can reopen.

nemonemi commented 1 year ago

Hello @nagash77, I can confirm this experience with version 12.9.0.

I run it with the NX framework, and I have just noticed it happening.

nagash77 commented 1 year ago

@nemonemi please open a new issue with a reproducible example and we will be happy to investigate