I'm intercepting request URL: https://api-stg.geneplanet.com/api/nipt-exporters/tasks/407ff05afdec42caa17a660d2c855117/status Response of requested URL is
{
"name": "ExportN2DStatisticsOrchestrator",
"instanceId": "407ff05afdec42caa17a660d2c855117",
"runtimeStatus": "Completed",
"input": {
"BlobUri": "https://niptexportersstgsa.blob.core.windows.net/nipt-exports/N2D statistics
export_11.04.2022 13.38.49.xlsx?sv=2018-03-
28&sr=c&sig=V0pXmIQUccUdkm0WtsZ3ENjfr%2FtYiCvYDztgZ6JWaYk%3D&se=2022-04-
11T12%3A38%3A49Z&sp=rc",
"From": "2022-03-11T00:00:00+00:00",
"To": "2022-04-11T23:59:59+00:00"
},
"customStatus": {
"message": "done"
},
"output": null,
"createdTime": "2022-04-11T11:38:49Z",
"lastUpdatedTime": "2022-04-11T11:38:50Z"
}
I want to make the assertion on runtimeStatus equals Completed.
Following code is not working:
cy.intercept('https://api-stg.geneplanet.com/api/nipt-exporters/tasks/*/status').as('exp')
cy.get('.col-sm-12').should('be.visible').and('contain','Export').click()
cy.get('.ng-star-inserted > .p-4 > .mb-2').should('be.visible').and('contain','N2D Statistics export')
cy.get('.ng-star-inserted > .p-4 > .mb-2').should('be.visible').and('contain',' Preparing a document. Please wait.')
cy.wait('@exp').its('response.runtimeStatus').should('eq', 'Completed')
I've also tried should('include') and should('contain') in the last line. What am I doing wrong?
The
cy.wait('@exp')
yields an interception object, see Using the yielded objectso this should work
or