acceptable-hamburger-48790
09/09/2022, 4:17 PMnutritious-army-46708
09/09/2022, 4:19 PMhandsome-dress-30825
09/09/2022, 5:59 PMjson
experimentalSessionAndOrigin: true,
chromeWebSecurity: false,
testIsolation: 'legacy',
numTestsKeptInMemory: 0,
watchForFileChanges: false,
video: false,
experimentalInteractiveRunEvents: true,
agreeable-scooter-87343
09/09/2022, 7:18 PMagreeable-scooter-87343
09/09/2022, 7:21 PMflaky-airport-12178
09/10/2022, 2:19 AMcold-van-45410
09/10/2022, 12:08 PMcold-van-45410
09/10/2022, 1:55 PMnutritious-army-46708
09/11/2022, 3:29 PMsteep-morning-65056
09/11/2022, 3:41 PMcy.request()
via our api server...I get a response with the correct response body and status...I set the localStorage
with the correct attributes....and try to direct to the page where only a logged in member would be able to access - but it keeps redirecting me to the sign in page - I am not able to post any large body of code as I work in a data protected and HIPAA compliant space...but if someone has been through this before and has a potential solution...I'm up for walking through any steps you feel I need to make to ensure it works? Thanks in advance!steep-morning-65056
09/11/2022, 3:45 PMsteep-morning-65056
09/11/2022, 8:21 PMbulky-account-48526
09/12/2022, 6:44 AMchilly-quill-34099
09/12/2022, 7:29 AMcy.get(...)
. My API, which I would like to intercept is on a different host (e.g. https://example-api.azurewebsites.net/something/something2/MyFunction/something3/something4
), than my website host http://localhost:4200
.
I tried cy.intercept
with an alias. But either I get an authorization error (when using https://...
for hostname
) or my cy.wait(@getMyFunction)
runs into a timeout.
ts
it('...test', () =>{
cy.intercept({
method: 'GET',
url: '**/MyFunction/*',
hostname: 'https://example-api.azurewebsites.net',
}).as('getMyFunction');
cy.visit('/').wait('@getMyFunction', { timeout: 30000 })
cy.get('some-content');
});
Cypress finds the alias, the intercept
is not correctly configured. But I have no idea, what to change, to make it work.
Does anyone know, what I am doing wrong in this procedure?chilly-quill-34099
09/12/2022, 8:06 AMts
it('...test', () =>{
cy.visit('/');
cy.intercept({
method: 'GET',
url: '**/MyFunction/**',
hostname: 'example-api.azurewebsites.net',
}).as('getMyFunction');
cy.wait('@getMyFunction', { timeout: 30000 })
cy.get('some-content');
});
great-beard-98693
09/12/2022, 9:46 AMit('...', () => {
block at the end of the file, with exactly the same code as in the "after" hook, it works, no "detached" errors.
Anyone had run into similar case?
I'm not including any code, because the only difference is if I run the code in the it('...', () => {}
block or in after(() => {}
block.adorable-smartphone-87280
09/12/2022, 1:25 PMbeforeEach
hook that would modify the state in some way, such that a new it
block would run properly, but an after
block isn't in the right state?great-beard-98693
09/12/2022, 1:25 PMbeforeEach
dry-memory-36351
09/12/2022, 2:15 PMfreezing-nightfall-22736
09/12/2022, 2:19 PMnutritious-army-46708
09/12/2022, 2:31 PMgray-kilobyte-89541
09/12/2022, 3:07 PMfreezing-nightfall-22736
09/12/2022, 3:10 PMgray-kilobyte-89541
09/12/2022, 3:11 PMfreezing-nightfall-22736
09/12/2022, 3:11 PMgray-kilobyte-89541
09/12/2022, 4:08 PMcy.visit('/');
?freezing-nightfall-22736
09/12/2022, 4:20 PMacceptable-hamburger-48790
09/12/2022, 4:31 PMvictorious-honey-34966
09/12/2022, 4:53 PMadorable-smartphone-87280
09/12/2022, 4:53 PM