shy-table-52906
02/01/2022, 2:46 AMselectFile
is not a valid command, trying to install 9.4.1powerful-orange-86819
02/01/2022, 7:12 AMpowerful-orange-86819
02/01/2022, 7:20 AMjs
cy.get('input[type="file"]').attachFile(filepath);
The test has been working since septembersticky-lawyer-27790
02/01/2022, 9:21 AMbreezy-pager-73919
02/03/2022, 2:04 PMadventurous-dog-24499
02/03/2022, 5:43 PMacceptable-journalist-55984
02/04/2022, 6:40 AMCypress.version
hold when run in the browser-console during a test?powerful-orange-86819
02/04/2022, 3:58 PMadventurous-dream-20049
02/04/2022, 8:23 PMcool-dentist-94229
02/06/2022, 3:34 AMcy.get('#create-project-button > .MuiButton-label').click()
cy.wait(3000).its("response.statusCode").should("eq", 200)
The runner does not validate this conditionbitter-fountain-36713
02/06/2022, 3:38 PMcool-dentist-94229
02/06/2022, 3:42 PMcy.wait(3000).its("response.statusCode").should("eq", 200)
powerful-orange-86819
02/07/2022, 7:04 AMjs
cy.intercept('POST',"example.org/api/url/*").as("uniqueString")
cy.get("element").click()
cy.wait('@uniqueString').its("response.statusCode").should("eq", 200)
Try this and tell me if it worked for you, use case is described here:
https://docs.cypress.io/api/commands/interceptbrainy-photographer-13281
02/08/2022, 6:08 AMcrooked-businessperson-67614
02/08/2022, 8:34 AMcypress open
yand launching them through that wizard.
However, now I'm trying to integrate that into our CI pipelines and thus started to play a bit around with cypress run
. Unfortunately, there the tests failed. I googled a bit around and finally was able to now test with cypress run --browser chrome --headed --no-exit
to give me some information what is happening. That is at least using the same browser and I can see what exxactly it happening, as I can see the window.
The problem seems to be related to some cross-origin requests (and these are expected, because we are using Azure Active Directory authentication), but I was using the best practices and actually acquired the needed tokens in advance using a before hook. The UI auth library still send some refresh requests, which seem to just work fine in the interactive session, but are blocked when running in the automated mode via cypress run
. Can anyone explain that behavior? I have to say that I did not even have to disable chrome websecurity to make it work in the interactive mode - it simply worked.
Any help would be greatly appreciated.
PS: I will also attach some screenshots of the successful results from the interactive session and the failure from the non-interactive onenutritious-art-11891
02/09/2022, 12:18 PMcuddly-rocket-64149
02/09/2022, 12:29 PMnutritious-art-11891
02/09/2022, 12:33 PMcuddly-rocket-64149
02/09/2022, 1:54 PMjs
Cypress.on('uncaught:exception', (err, runnable) => {
return false
})
> Cypress detected that you returned a promise from a command while also invoking one or more cy commands in that promise.cuddly-rocket-64149
02/09/2022, 1:55 PMnice-machine-16386
02/09/2022, 3:18 PMthen()
like below. It's not harmful, just unnecessary right?nice-machine-16386
02/09/2022, 3:19 PMcy.get(element).click().then(() => { cy.url().should('include', expectedURL) })
nice-machine-16386
02/09/2022, 3:23 PMgray-kilobyte-89541
02/09/2022, 8:57 PMadventurous-dream-20049
02/10/2022, 12:32 AMadventurous-dream-20049
02/10/2022, 12:35 AMhandsome-cartoon-58565
02/10/2022, 8:16 AMts-node
under the hood so it is able to consume .ts
files and there is no need to compile them by yourself. I've had a situation where i manually compiled TS files to JS (using tsc
) and these files were output adjacent to their .ts
counterparts (so folders like "integration", "support" had both .ts
and .js
files) and this resulted in Cypress throwing error path argument is required to res.sendFile
(i saw that Cypress detected both .ts
and .js
files correctly, but trying to load them threw the mentioned error) https://github.com/cypress-io/cypress/issues/18607#issuecomment-1033449608 . Error was still appearing even if i passed --spec cypress/integration/file.spec.js
, which should force Cypress only care about one .js
file.
https://docs.cypress.io/guides/tooling/typescript-support#Configure-tsconfig-json
I found in the Cypress internal package docs inside the repo that it indeed uses ts-node
to pre-compile TS files and i think such details should also be mentioned in the docs - i mean that developer should config TS (with tsconfig.json
) and probably also install it, but it doesn't have to compile it (hence the example repo uses noEmit
param), because Cypress is able to consume TypeScript files.
https://github.com/cypress-io/cypress/blob/5476904bf53c715c9bd4ff9bec09a1fc4f01a4e1/packages/ts/README.md#L3
https://github.com/cypress-io/cypress-and-jest-typescript-example/blob/master/cypress/tsconfig.json#L4
Remaining mystery for me is why having .ts
and .js
(TS compiled ones) files adjacent to each other confuses Cypress. 🤔nice-machine-16386
02/10/2022, 2:13 PMclean-psychiatrist-8640
02/12/2022, 9:33 AMnice-machine-16386
02/12/2022, 2:41 PM