https://cypress.io logo
Join Discord
Powered by
# e2e-testing
  • k

    kind-artist-92362

    10/23/2022, 3:22 PM
    also does not work
  • k

    kind-artist-92362

    10/23/2022, 3:25 PM
    it is okay
  • k

    kind-artist-92362

    10/23/2022, 3:25 PM
    cy.visit("https://byndyusoft.com/"); cy.get("section div[class='know-more__container'] span:nth-child(2)").click()
  • k

    kind-artist-92362

    10/23/2022, 5:40 PM
    so ) is it impossible for Cypress 9.0 ?
  • m

    mysterious-belgium-25713

    10/23/2022, 6:27 PM
    Hi Dima, let me see if tonight or tomorrow i can resolve this issue. I do see what the problem is. The google.ru responds different then google.com In the RU version al links are opening in seperate tab. I do think the remove attr will work only you need to select the right element.
  • k

    kind-artist-92362

    10/23/2022, 6:43 PM
    tnx! agree , i have not caught the differences in opening tabs) good job)) what about the removing attr also agree , i have not done it before so for me it is a bit complicated 👍🏻
  • g

    gray-kilobyte-89541

    10/23/2022, 8:24 PM
    what's the use case for this? Like "element does not exist now, then should not exist for 200ms, then exist? Or at least it does not exist for 200ms, then does not matter"?
  • m

    mysterious-belgium-25713

    10/23/2022, 8:24 PM
    Ow yeah also forgot to mention, you will run into another problem with Cypress 9.0. Your test starts at google.com and then you want to visit byndyusoft. This is on another Top level domain so Cypress will not allow that with older versions of Cypress. You need cy.origin to navigate to other top level domains.
  • m

    mysterious-belgium-25713

    10/23/2022, 8:26 PM
    This is my code in cypress 10
    Copy code
    js
    describe("Testsuite with remove attr",()=>{
    
      it("remove attr",()=>{
        cy.setCookie("SOCS","CAISHAgBEhJnd3NfMjAyMjEwMTctMF9SQzMaAm5sIAEaBgiAiNKaBg",{
          domain: ".google.ru"
        })
        cy.visit("https://www.google.ru")
        cy.get( "input[name=q]").type("Byndyusoft{ENTER}");
        cy.get("a[href='https://byndyusoft.com/']").first().invoke('removeAttr', 'target').click()
        cy.origin("https://byndyusoft.com/", ()=> {
          cy.get("section div[class='know-more__container'] span:nth-child(2)").click()
        })
      })
    })
  • k

    kind-artist-92362

    10/23/2022, 8:48 PM
    @mysterious-belgium-25713 thank you very much . It also looks a bit complicated for now ( i am almost newbie , also have't worked with Cookies ) Should delete my cypress 9 ( and a few lines of code ) and try your code . 👍🏻
  • m

    mysterious-belgium-25713

    10/23/2022, 8:50 PM
    Ow the cookie was to make it work on my machine, everytime i started the google page i get a cookie window that i have to accept or decline. So I added it to the test to skip that screen on my machine. The rest of the code you can use. Also yeah you need to upgrade to cypress 10+ if you want to use cy.origin.
  • m

    mysterious-belgium-25713

    10/23/2022, 8:50 PM
    And no problem that you are new, we are here to help 🙂
  • k

    kind-artist-92362

    10/23/2022, 9:10 PM
    Have took it ) to be honest i don't really got the information about cookies but seems that i could delete it in my code ( but with cookies it also works ) .
  • k

    kind-artist-92362

    10/23/2022, 9:14 PM
    should i create an additional spec.cy.js to and visit byndyusoft.com there ?
  • k

    kind-artist-92362

    10/24/2022, 10:30 AM
    @mysterious-belgium-25713 do you have any ideas why it does not functioning . Does it work on your PC ?
  • m

    mysterious-belgium-25713

    10/24/2022, 10:31 AM
    Hi Dima are you on cypress 10?
  • k

    kind-artist-92362

    10/24/2022, 10:32 AM
    10.10
  • m

    mysterious-belgium-25713

    10/24/2022, 10:33 AM
    ok then we are almost there. in your cypress.config.js or .ts you need to add the experimentalSessionandOrigin to true
    Copy code
    js
    export default defineConfig({
      e2e: {
        experimentalSessionAndOrigin: true,
        async setupNodeEvents(on, config) {
        },
      },
    });
  • k

    kind-artist-92362

    10/24/2022, 10:33 AM
    recall please how may i check it in terminal ( i mean version )
  • m

    mysterious-belgium-25713

    10/24/2022, 10:35 AM
    npx cypress version
  • m

    mysterious-belgium-25713

    10/24/2022, 10:36 AM
    Here to show you that it works on my machine
  • k

    kind-artist-92362

    10/24/2022, 10:37 AM
    block above was created automatically , should i delete it ? seems yes
  • m

    mysterious-belgium-25713

    10/24/2022, 10:38 AM
    no dont delete it
  • m

    mysterious-belgium-25713

    10/24/2022, 10:38 AM
    just add then the line experimentalSessionsAndOrigin to the e2e in your file
  • m

    mysterious-belgium-25713

    10/24/2022, 10:38 AM
    I'm using typescript so thats why mine looks a bit different
  • m

    mysterious-belgium-25713

    10/24/2022, 10:38 AM
    just focus only on this part
    Copy code
    js
      e2e: {
        experimentalSessionAndOrigin: true,
        async setupNodeEvents(on, config) {
        },
      },
  • m

    mysterious-belgium-25713

    10/24/2022, 10:43 AM
    You should not have mine export in your file your file only needs this.
    Copy code
    js
    module.exports = defineConfig({
     e2e: {
      experimentalSessionAndOrigin: true,
      setupNodeEvents(on, config) {
        // implement node event listeners here
    },
    },
    });
  • m

    mysterious-belgium-25713

    10/24/2022, 10:45 AM
    It might be also good for you to learn some basic javascript, settings these options are not that related to Cypress. When do you use module.exports or when do you use export default. It would be really good to have some basic understanding of the ecosystem.
  • k

    kind-artist-92362

    10/24/2022, 10:47 AM
    tnx ! very much! It works now!! i ll immerse myself into understanding of the ecosystem deeper !
  • k

    kind-artist-92362

    10/24/2022, 10:47 AM
    @mysterious-belgium-25713
1...127128129...192Latest