cypress-io / cypress

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

UI doesn't load on cypress but works fine in local browser. #30353

Open dil-rmallikarjuna opened 1 month ago

dil-rmallikarjuna commented 1 month ago

Current behavior

Web page shows 'Please wait' and nothing loads after that in cypress. but Manually it works fine

Screenshot 2024-10-03 at 12 52 02 PM

Desired behavior

Need UI to load as shown in image below Screenshot 2024-10-03 at 12 54 58 PM

Test code to reproduce

import GDCMMHitsPage from "../../support/pageObjects/GDCMMHits/GDCMMHitsPage";
import ListPage from "../../support/pageObjects/ThirdPartyManagement/ListPage";
import RandomUtils from "../../support/utils/RandomUtils";

describe('Media monitoring AI',
  { tags: ['@P1', '@GDCMMHits'] },
  () => {

  let companyNameGDC;
  let companyNameMedia;

  before(() => {

    cy.clearAllLocalStorage();
    cy.clearAllSessionStorage();
    cy.clearCookies();
    cy.loginInToApplication(
      Cypress.env('client_username'),
      Cypress.env('client_password'),
    ); 
  }

);
  it('should Verify the GDC are populating in Dashboard', () => {
    cy.get('span[title="Third Party Management"]').click();
    cy.get('.vizlink').click()
    cy.contains('Record #').click()
    cy.get('#tpf_srch').type('ai summary_9')
    cy.contains('ZP3P-58172490903').click({ force: true });

    cy.get('#subdemo > .yui-nav > :nth-child(4) > a > em').click();
    cy.get('#gdc-show-btn-button')
      .contains('Review 3P Monitor')
      .click();

  });

});

Cypress Version

v13.14.2

Node version

v20.16.0

Operating System

macOS Sonoma 14.7

Debug Logs

Below error comes up in console only in cypress runner, this error doesn't appear in normal browser.

(uncaught exception)TypeError: Cannot read properties of undefined (reading 'util')
(uncaught exception)TypeError: gdcdata.setBulkState is not a function

Other

No response

dil-rmallikarjuna commented 1 month ago

The application I am working on is built with php where the feature I am trying to automate is being rendered on UI by Java script when I click on the button " cy.get('#gdc-show-btn-button').contains('Review 3P Monitor').click();"

This might be the limitation of cypress dashboard because I tried to click manually on the subject in cypress dashboard and still faced the error but this works smooth on selenium. Do we have any plug ins as a workaround for this? Below is screenshot where I was able to automate this with selenuim.

this issue is similar to #9614, I have tried all the steps written there and none of them work. Our app is also built similar to what is in question for #9614.

image

BudarpuMadhusudhan commented 1 month ago

I am also facing the same problem, please let me know the solution

dil-rmallikarjuna commented 2 weeks ago

Team, Is there any update on this?