kind-artist-92362
10/25/2022, 7:48 PMlimited-barista-33480
10/25/2022, 7:48 PMmysterious-belgium-25713
10/25/2022, 7:50 PMjs
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("Yandex{ENTER}");
cy.get("a[href='https://yandex.com/']").first().invoke('removeAttr', 'target').click()
cy.origin("https://yandex.com/", ()=> {
cy.get( "form input[id=text]").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()
})
})
})
mysterious-belgium-25713
10/25/2022, 7:54 PMkind-artist-92362
10/25/2022, 8:07 PMnarrow-policeman-70631
10/25/2022, 8:21 PMnarrow-policeman-70631
10/25/2022, 8:23 PMhttps://s2l.sendtonews.com/stn_trk.gif▾
https://s2l.sendtonews.com/stn_trk.gif▾
chilly-country-27478
10/25/2022, 9:30 PMgreen-country-81287
10/25/2022, 11:47 PMgray-kilobyte-89541
10/26/2022, 12:25 AMgray-kilobyte-89541
10/26/2022, 12:27 AMsparse-electrician-28646
10/26/2022, 6:56 AMexperimentalSessionAndOrigin
and it enables the stricter test isolation. That works as expected.
We also have custom commands and I need them to be available in the origin
callback. Luckily the documentation also has a section for that: https://docs.cypress.io/api/commands/origin#Custom-commands
So I followed that advice and added this to the spec:
before(() => {
cy.origin('http://secondorigin', () => {
require('../../support/commands')
})
})
But the test fails with:
"before all" hook for "test case name":
cypress_1 | ReferenceError: __webpack_require__ is not defined
So it seems the require function cannot be resolved for some reason. Does anyone have a clue why? I'd be very happy about any kind of direction how to further debug thisbest-whale-85630
10/26/2022, 7:03 AMfresh-doctor-14925
10/26/2022, 8:34 AMfresh-doctor-14925
10/26/2022, 8:36 AMquaint-hospital-22081
10/26/2022, 9:09 AMquaint-hospital-22081
10/26/2022, 9:09 AMquaint-hospital-22081
10/26/2022, 9:10 AMfresh-doctor-14925
10/26/2022, 9:10 AMquaint-hospital-22081
10/26/2022, 9:15 AMquaint-hospital-22081
10/26/2022, 9:15 AMquaint-hospital-22081
10/26/2022, 9:15 AMquaint-hospital-22081
10/26/2022, 9:16 AMquaint-hospital-22081
10/26/2022, 9:17 AMfresh-doctor-14925
10/26/2022, 9:17 AMquaint-hospital-22081
10/26/2022, 9:20 AMfresh-doctor-14925
10/26/2022, 9:21 AMsparse-electrician-28646
10/26/2022, 9:31 AMquaint-hospital-22081
10/26/2022, 9:31 AMquaint-hospital-22081
10/26/2022, 9:32 AM