flaky-fountain-4670
01/11/2023, 7:09 AMcy.wait(@alias)
apparently only waits for the request to be submitted?sticky-dentist-24502
01/11/2023, 7:58 AMError [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
Node version is 18. What can I be problem ? Thanks for help.bright-printer-23884
01/11/2023, 11:46 AMbright-printer-23884
01/11/2023, 11:48 AMbright-printer-23884
01/11/2023, 12:11 PMbright-printer-23884
01/11/2023, 12:47 PMbright-printer-23884
01/11/2023, 12:49 PMbright-printer-23884
01/11/2023, 12:50 PMbright-printer-23884
01/11/2023, 12:54 PMbright-printer-23884
01/11/2023, 12:54 PMbright-printer-23884
01/11/2023, 12:54 PMenough-author-35578
01/11/2023, 2:19 PMcy.mount
throws an error?
I have a component that throws an error when it is not wrapped in a particular contextProvider, and a test to verify that it does so.
I have been using @testing-library/react
for my component tests, and was able to test this behavior like this, which worked:
js
import { render } from "@testing-library/react"
it("throws an error when not wrapped in the right context", () => {
expect(() => render(<MyComponent />))
.throws("The right error message")
})
I am currently trying to migrate my component tests over to cy.mount
, and wasn't able to find a way to make this test work anymore.green-controller-97889
01/11/2023, 2:43 PMcontains
search for text ? How deep does it go ?
I have the following structure:
html
<body>
<section data-cy="_title">
<div>
<div>
<span>Some Title</span>
</div>
</div>
</section>
</body>
Should cy.get("[data-cy='_title']").contains("Some Title")
work ?gray-kilobyte-89541
01/11/2023, 3:16 PMcy.contains('[data-cy="_title"]', 'Some title')
green-controller-97889
01/11/2023, 3:44 PMcy.get("_dropdown");
doesn't find the element ? It has display:block
.
I know it's nested, but that should not matter, right ?
Or does it has something to do with Ant Design ?cool-truck-21040
01/11/2023, 4:35 PMcypress:run
or cypress:open
(using yarn
scripts)
Your configFile threw an error from: cypress.config.js
We stopped running your tests because your config file crashed.
Error: spawn /Users/my-username/.nvm/versions/node/v18.12.1/bin/node EACCES
at Process.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478:16)
at process.processTicksAndRejections (node:internal/process/task_queues:83:21)
error Command failed with exit code 1.
Here's my `cypress.config.js`: https://gist.github.com/Josh68/25d318e2678116cb82b60a5d7b5d82d5. Note that I'm using a few plugins, including cypress-visual-regression and cypress-html-validate (with their own config options) and am also calling a few custom commands within setupNodeEvents
. Can anyone spot what my issue might be, or tell me how to debug further (the Cypress docs reference using DEBUG=cypress:server:config
, but that does nothing, and DEBUG=cypress:*
is way too verbose).magnificent-finland-58048
01/11/2023, 5:00 PMsome-keyboard-52751
01/11/2023, 5:18 PMsome-keyboard-52751
01/11/2023, 5:18 PMbrave-doctor-62978
01/11/2023, 5:35 PMCypress.Commands.add('requestBody', { prevSubject: true }, subject => {
return subject.its('request.body');
});
called as cy.intercept('/2/users', {}).as('userRequest');
cy.get('@userRequest').requestBody().should('deep.equal', {
...(new User({
first_name: 'Isaiah',
last_name: 'Berlin',
email: 'haha@.com',
phone_number: '',
}).toJSON()),
invite: false,
});
brave-doctor-62978
01/11/2023, 5:35 PMcy.get(...).requestBody is not a function
...cool-truck-21040
01/11/2023, 5:40 PMnarrow-arm-9964
01/11/2023, 5:47 PMdevelop
), but it says that my master
branch is stale (even though I have been running jobs against that branch this week). Perhaps I'm not referencing the branch properly when I start my jobs 🤔
I am using cypress-io/github-action@v5, where the docs state:
Cypress actions use `GITHUB_TOKEN` to get the correct branch
narrow-arm-9964
01/11/2023, 5:48 PMdevelop
branch)modern-dawn-86006
01/11/2023, 6:40 PMgray-kilobyte-89541
01/11/2023, 6:53 PMjs
cy.wait('@userRequest').its('request.body').should(...)
brave-doctor-62978
01/11/2023, 6:54 PMcool-truck-21040
01/11/2023, 7:22 PMcomponents.ts
file. Could that be my problem (that and adding a comopnent
section in my config and pointing it at the new support file)? In my config, I also specified that my /support/e2e.ts
could end in {js, ts, jsx, tsx}
, and it's currently a .ts
, so I'll just change that.full-helmet-93291
01/11/2023, 7:55 PMdescribe("Logout test", () => {
beforeEach(function () {
cy.visit("/");
cy.log("Verifying the Login page is displayed.");
cy.get("#kc-login").should("be.visible");
});
it("testing login and logout", () => {
cy.get("#username").type("username");
cy.get("#password").type("password");
cy.get("#kc-login").click();
cy.log("Loging out of the application");
cy.get("div[data-testid='navbar-profile-dropdown-items']").invoke("show");
cy.get("div[data-testid='navbar-profile-dropdown-items'] > a[href='/users/logout']").click();
cy.log("Verifying the Login page is displayed.");
cy.get("#kc-login").should("be.visible");
cy.get("#username").type("username");
cy.get("#password").type("password");
cy.get("#kc-login").click();
});
});
});
After the new login, the page crashes.
Any clues on why this is happening?