narrow-optician-44716
05/21/2021, 4:12 PMnarrow-optician-44716
05/21/2021, 4:13 PMnarrow-optician-44716
05/21/2021, 4:52 PMnarrow-optician-44716
05/21/2021, 5:26 PMalert-photographer-39416
05/21/2021, 5:44 PMnarrow-optician-44716
05/21/2021, 5:53 PMalert-photographer-39416
05/21/2021, 5:54 PMalert-photographer-39416
05/21/2021, 5:54 PMalert-photographer-39416
05/21/2021, 5:54 PMnarrow-optician-44716
05/21/2021, 6:09 PMalert-photographer-39416
05/21/2021, 6:14 PMstocky-dream-36427
05/21/2021, 6:36 PMnarrow-optician-44716
05/21/2021, 6:42 PMstocky-dream-36427
05/21/2021, 6:47 PMalert-photographer-39416
05/21/2021, 7:34 PMalert-photographer-39416
05/21/2021, 7:34 PMstocky-dream-36427
05/21/2021, 7:59 PMmysterious-analyst-56660
05/22/2021, 4:17 PMgray-kilobyte-89541
05/24/2021, 5:04 PMwindow.nuxtApp.$auth.loginWith('login', data)
is probably a promise-returning operation? When do you know it is finished? If it returns a promise, then you should return it too from .then
callback. That way Cypress would know and waitfuture-journalist-95278
05/24/2021, 9:48 PMjs
Cypress.Commands.add('login', () => {
const data = {
username: Cypress.env('TEST_USERNAME'),
password: Cypress.env('TEST_USER_PASSWORD'),
}
cy.window().then((window) => {
return window.nuxtApp.$auth.loginWith('login', { data })
})
})
And I use it like: js
cy.login().then(() => {})
gray-kilobyte-89541
05/25/2021, 1:10 PM.then(() => {})
? Why the empty callback after login?icy-rainbow-39970
05/25/2021, 3:16 PMalert-photographer-39416
05/25/2021, 3:17 PMicy-rainbow-39970
05/25/2021, 3:19 PMfuture-journalist-95278
05/25/2021, 4:18 PMgray-kilobyte-89541
05/25/2021, 5:40 PMcy.login()
cy.visit('/')
future-journalist-95278
05/26/2021, 6:53 PMflat-electrician-52949
05/27/2021, 10:38 AMcy.intercept
and got a couple of questions (hope you don't mind). What is the best practice to test that the interception did happen?
(right now I'm doing the assertion within the interception)sparse-jackal-93514
05/27/2021, 4:02 PM