cold-van-45410
08/15/2022, 8:07 AMfresh-doctor-14925
08/15/2022, 8:11 AMfresh-doctor-14925
08/15/2022, 8:14 AMstale-optician-85950
08/15/2022, 8:22 AMlimited-room-30929
08/15/2022, 8:55 AMfresh-doctor-14925
08/15/2022, 10:07 AMfresh-doctor-14925
08/15/2022, 10:15 AMstale-optician-85950
08/15/2022, 10:18 AMfresh-doctor-14925
08/15/2022, 12:10 PMfuture-translator-75417
08/15/2022, 2:12 PMdamp-fountain-74482
08/15/2022, 2:23 PMtest:after:run
events.
I want to report some data after each and every test, and send it via HTTP to another server.
However, it seems like the event handler gets cut-off immediately, before the request can be be completed, and the next test beings to run.
How can I make the event listener wait until the request is done, and only then return?
It seems like the common Node practices of async/await or even the classic then/catch logic on promises don't have any effect.
Thanks.fresh-doctor-14925
08/15/2022, 2:38 PMafterEach()
?cold-eye-66538
08/15/2022, 5:01 PMstale-optician-85950
08/15/2022, 8:17 PMgray-kilobyte-89541
08/15/2022, 9:16 PMstrong-energy-6158
08/16/2022, 5:01 AMpurple-kilobyte-85592
08/16/2022, 6:40 AMfaint-fountain-74551
08/16/2022, 9:30 AMjolly-machine-52750
08/16/2022, 1:26 PMCypress.Commands.add('loginViaUI', (
email = Cypress.env('userEmail'),
password = Cypress.env('userPassword')
) => {
cy.visit(`/login`)
cy.get('input[type="text"]').type(Cypress.env('userEmail'))
cy.get('input[type="password"]').type(Cypress.env('userPassword'))
cy.get('button.bg-primary').click()
})
then in page test I do
describe('Orders page', () => {
beforeEach(() => {
cy.loginViaUI()
...
login passes and then UI of Cypress is freezingfresh-doctor-14925
08/16/2022, 1:40 PMjolly-machine-52750
08/16/2022, 2:04 PMfresh-doctor-14925
08/16/2022, 2:33 PMcy.intercept()
to look out for those network responsespolite-policeman-65273
08/16/2022, 2:37 PM--browser chrome
flag to CMD in Dockerfile was a game changer. Obviously running Cypress in a container using the default Electron on circleCI is not the best option. Also, please be AWARE that if you are using secret env variables in your tests on circleCI, they WILL BE EXPOSED in a video recording made by Cypressfresh-doctor-14925
08/16/2022, 3:05 PMcy.type()
?polite-policeman-65273
08/16/2022, 4:58 PMcy.type(password)
where
password: Cypress.env('YOUR_PASSWWORD')
shy-river-90411
08/16/2022, 5:17 PMpolite-policeman-65273
08/16/2022, 5:18 PMshy-river-90411
08/16/2022, 5:19 PMgray-kilobyte-89541
08/16/2022, 5:32 PMpolite-policeman-65273
08/16/2022, 5:35 PM