elegant-dress-62146
05/26/2022, 1:48 PMdovenv
installed to the project and that it's properly imported in to the plugin file. Check out this page for a good resource if you've not already. https://docs.cypress.io/guides/guides/environment-variables#Option-5-Pluginsfull-journalist-87924
05/26/2022, 2:41 PMelegant-dress-62146
05/26/2022, 3:09 PMfull-journalist-87924
05/26/2022, 3:37 PMproud-gpu-14798
05/26/2022, 3:39 PMcy.intercept()
with an alias, call cy.wait()
and assert the request.body
contains the expected data. Works perfectly for a single request, or even a series of requests as long as the API calls are made in the same order every single time. However, in many cases the app invokes a half dozen or more API calls to the event endpoint and the order the API calls are completed are not guaranteed. I need some manner to assert the expected calls have been made, but without having to pop my way through the interception stack in a specific order. Thoughts/ideas?full-journalist-87924
05/26/2022, 3:41 PMelegant-dress-62146
05/26/2022, 3:46 PMelegant-dress-62146
05/26/2022, 3:51 PMjson
cy
.get('[whatever the button selector is]')
.invoke('removeAttr', 'target')
.click();
hundreds-action-33616
05/26/2022, 4:33 PMmagnificent-finland-58048
05/26/2022, 4:39 PMmagnificent-finland-58048
05/26/2022, 4:41 PMhelpful-application-21484
05/26/2022, 11:20 PMsparse-angle-84185
05/27/2022, 2:50 AMsparse-angle-84185
05/27/2022, 2:51 AMgray-kilobyte-89541
05/27/2022, 5:38 AMcy.clock
featureswitty-appointment-97045
05/27/2022, 6:01 AMpluginsFile
threw an error from: /Users/admin/Documents/Automation/cypress-automation-fwk/cypress/plugins/index.js
Details: Error: connect ETIMEDOUT 10.50.12.140:6379
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16)
Stack trace:
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1187:16)
faint-cat-31237
05/27/2022, 8:51 AMpostgis/postgis:13-master
inside the docker-compose file.
I also created a Dockerfile from cypress included to launch the tests inside client folder.
When i launch the docker-compose, my application + postgres start correctly (generating data + listening on port 8080) and even when i visit the page http://localhost:8080 it works (i can log in to my application using a username and a password that has been generated when the application started). But for some reason when the cypress container starts it can't login to the application (using those same credentials), therefore i got test failure.
I have a theory: that the data has been generated on my local machine but the container didn't map the files π
Can anyone help me please π
Here is the docker-compose file + video failing inside the container.average-fountain-87572
05/27/2022, 11:31 AMcuddly-analyst-14369
05/27/2022, 11:32 AMadorable-machine-81849
05/27/2022, 11:45 AMhundreds-action-33616
05/27/2022, 2:34 PMsparse-angle-84185
05/27/2022, 3:12 PMicy-greece-31960
05/27/2022, 6:09 PMid
of the newly created record, then use this id
to delete the record. I have the following implementation:
js
it.only("should let you create a new allocation", () => {
cy.findByTestId("new-control").click();
cy.intercept("POST", "/control-panel/data/allocations*", (req) => {
req.on("response", (res) => {
const id = res.body.allocation.id;
cy.task("deleteAllocation", id);
});
});
cy.findByTestId("form-dialog")
.within(() => {
cy.get("select[name=ranchId]").select("2155");
cy.get("select[name=blockId]").select("SCH-CS-2013-8 (CS13 8)");
cy.findByLabelText("Tons")
.type("420");
cy.findByLabelText("Acres")
.type("42");
cy.get("select[name=customerId]").select("Oswego");
cy.get("button[type=submit]").click();
});
cy.findByTestId("table-filter-search")
.type("SCH-CS-2013-8");
cy.findByTestId("data-table")
.findByText("420")
.parent("tr")
.within((tableRow) => {
cy.get("td")
.eq(0)
.should("have.text", "2155")
});
});
This gets me the id
just fine. But, I get this error message:icy-greece-31960
05/27/2022, 6:09 PMgray-kilobyte-89541
05/27/2022, 10:10 PMgray-kilobyte-89541
05/27/2022, 10:11 PMcy...
commands from callbacks in the cy.intercept
See bonus lesson 12 in my "Cypress network testing exercises" course https://cypress.tips/courses/covt2fpsuxmysterious-sandwich-43667
05/30/2022, 12:22 AMmysterious-sandwich-43667
05/30/2022, 12:23 AMimportant-park-97069
05/30/2022, 3:02 AMcy.intercept
when using stubbing that it stubs literally every other time?
If I refresh my test using a cy.intercept stubbed route, it fails to stub the first time (goes to origin), stubs correctly on the 2nd, goes to origin on the third, stubs on the 4th, and so on.important-park-97069
05/30/2022, 3:03 AM