broad-toothbrush-93273
06/15/2022, 10:54 AMsparse-action-76146
06/15/2022, 11:12 AMclean-australia-93957
06/15/2022, 2:46 PMaloof-midnight-3678
06/15/2022, 2:49 PMclean-australia-93957
06/15/2022, 2:50 PMaloof-midnight-3678
06/15/2022, 2:52 PMbetter-pharmacist-8890
06/15/2022, 6:42 PMlittle-france-10142
06/15/2022, 6:58 PMcy.createDefaultTodos()
after adding it to a command.js
support file. The support file also contains `const`'s that hold the desired text to type.
My problem comes when I try to assert .should("contain", TODO_ITEM_ONE)
Is there some way to export those consts or import them into my test file?rhythmic-winter-96378
06/15/2022, 7:04 PMmammoth-manchester-71430
06/16/2022, 5:10 AMgifted-rain-40072
06/16/2022, 10:11 AMmammoth-manchester-71430
06/16/2022, 10:28 AMmammoth-manchester-71430
06/16/2022, 10:40 AMsparse-action-76146
06/16/2022, 12:22 PMfresh-truck-40418
06/16/2022, 12:46 PMfetch('/ventes/portefeuille.json').then(…).then(…)
with that:
cy.intercept('**/portefeuille.json').as('getWalletJson')
cy.wait('@getWalletJson')
.its('response.statusCode')
.should('eq', 200)
but the test still fails as we see : https://ss.cyrilou.me/ZWDok0qNgq.jpg▾
https://ss.cyrilou.me/yKCeYpvzZW.jpg▾
intercept
don't incercept the resquest?
Thank you!gray-kilobyte-89541
06/16/2022, 12:57 PMfresh-truck-40418
06/16/2022, 12:59 PMjs
document.addEventListener('DOMContentLoaded', function () {
fetch(…)
});
Maybe I missed something or didon't understand what you're saying?fresh-truck-40418
06/16/2022, 1:09 PMjs
cy.intercept('GET', '**/portefeuille.json').as('getWalletJson')
cy.get('[data-cy="placeholder-glow"]')
.should('not.exist')
cy.wait('@getWalletJson')
to put something between them but nothing changesable-helicopter-21289
06/16/2022, 1:12 PMfresh-truck-40418
06/16/2022, 1:18 PMfresh-truck-40418
06/16/2022, 1:20 PMbright-processor-92363
06/16/2022, 1:21 PMfresh-truck-40418
06/16/2022, 1:22 PMbeforeEach()
function but it doesn't change.fresh-truck-40418
06/16/2022, 1:29 PMit
:
- intercept first
- visit the page after
- XHR launched 🚀
- then wait for the intercept
and it works well. 🎉
Before I tried to intercept it after the DOMready so after the XHR was launched.rich-pharmacist-74804
06/16/2022, 1:34 PMsparse-action-76146
06/16/2022, 1:38 PMrich-pharmacist-74804
06/16/2022, 1:47 PMsparse-action-76146
06/16/2022, 1:50 PMgray-kilobyte-89541
06/16/2022, 1:57 PMfresh-doctor-14925
06/16/2022, 2:59 PM14:52:18 Cannot read properties of null (reading 'reading')
14:52:18 TypeError: Cannot read properties of null (reading 'reading')
14:52:18 at TCP.get [as reading] (node:_tls_wrap:634:27)