cypress-io / cypress

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

cy.visit not working for "https://hinduism.stackexchange.com" #20233

Closed amitguptagwl closed 2 years ago

amitguptagwl commented 2 years ago

Current behavior

When I'm writing some sample tests to visit "https://hinduism.stackexchange.com", Cypress attempt to run tests but reports no test to run eventually

hinduism .

Desired behavior

cy.visit() should be able to visit any URL.

Test code to reproduce

describe('Simulate error in visiting site', () => {
    it('check Hinduism Stackexchange', () => {
        cy.visit(`https://hinduism.stackexchange.com`); 
        cy.get(".s-post-summary").invoke("length").should("be.greaterThan", 10); //not reaching here
    });
});

Cypress Version

9.5.0

Other

I've already tested with v8 and v9 but it is not working.

BlueWinds commented 2 years ago

It looks like they have some framebusting code, which is breaking the application under test (https://hinduism.stackexchange.com/) out of Cypress' iframe.

You have a couple of options:

Hopefully that provides some helpful pointers.

amitguptagwl commented 2 years ago

Yes, this is not the site I control. I just took this is an example during live demonstrate of how to use cypress. But it failed.

sainthkh commented 2 years ago

Closing because of the inactivity.

baruchiro commented 1 year ago

Hi, I found this answer: https://stackapps.com/a/4963/102029

They said that embedding StackExchange website inside iframe is not allowed.