blue-businessperson-71837
05/13/2022, 1:30 PMcreamy-train-56346
05/13/2022, 1:33 PMgray-kilobyte-89541
05/13/2022, 1:45 PMincalculable-pager-85339
05/13/2022, 3:02 PMgray-kilobyte-89541
05/13/2022, 3:13 PMincalculable-pager-85339
05/13/2022, 3:14 PMgray-kilobyte-89541
05/13/2022, 3:16 PMincalculable-pager-85339
05/13/2022, 3:16 PMincalculable-pager-85339
05/13/2022, 3:34 PMgray-kilobyte-89541
05/13/2022, 5:43 PMTESTRAIL_HOST=xxx npx cypress run
red-dentist-71156
05/13/2022, 5:59 PMpowerful-orange-86819
05/15/2022, 2:22 PMjs
cy.intercept({
method: "GET",
pathname: "/",
query: {
pageNumber: "0",
pageSize: "25",
language: "EN",
language: "EL",
language: "RO",
language: "TR",
},
}).as("getExample");
I have found a way around it as so, but i dont like it, because its an unnecessary assertion
js
cy.intercept(
{
method: "GET",
pathname: "/",
},
(req) => {
expect(req.url).to.include(
"status=5&status=-1&status=6&status=0&status=2&status=1",
"Status included"
);
}
).as("example2");
Please if someone knows a better way i'll be glad to hearbored-school-78265
05/15/2022, 9:26 PMfile:preprocessor
event twice when running a single test?
I'm seeing something like this:
> DEBUG='cypress:webpack,cypress:server:plugins:*' cypress run --spec cypress/integration/a1/quote/landlord.spec.ts
...
Running: a1/quote/landlord.spec.ts (1 of 1)
cypress:server:plugins:child execute plugin event: file:preprocessor ({ eventId: 2, invocationId: 'inv1' }) +4s
cypress:webpack get /Users/jason/src/goodcover/core/e2e/cypress/integration/a1/quote/landlord.spec.ts +4s
...
cypress:server:plugins:child execute plugin event: file:preprocessor ({ eventId: 2, invocationId: 'inv2' }) +842ms
cypress:webpack get /Users/jason/src/goodcover/core/e2e/cypress/support/index.js +841ms
...
high-vr-97684
05/15/2022, 11:28 PMred-dentist-71156
05/16/2022, 2:57 AMred-dentist-71156
05/16/2022, 4:48 AMred-dentist-71156
05/16/2022, 4:49 AMclever-continent-1881
05/16/2022, 8:18 AMremote:debugger:protocol
is failing to toggle network off. promise is not called back .
This is the original recipe https://www.cypress.io/blog/2020/11/12/testing-application-in-offline-network-mode/#header
No way to upgrade version for so long... 😫
Any ideas or different ways to toggle chorme
on/off?rapid-lizard-10941
05/16/2022, 11:52 AMjs
// cypress-vue-unit-test/dist/index.js
function checkMountModeEnabled() {
// @ts-ignore
if (Cypress.spec.specType !== 'component') {
throw new Error("In order to use mount or unmount functions please place the spec in component folder");
}
}
js
// my spec
import DatatableFilter from './datatable-filter-date.vue';
import { mount } from 'cypress-vue-unit-test';
describe('Datatable filter tests', () => {
it('shows the datatable', () => {
mount(DatatableFilter);
cy.eyesCheckWindow({ tag: 'shows datatable' });
});
});
cypress v^9.6.1
cypress-vue-unit-test v^3.5.1
@billions-barista-30103/vue v^3.1.2
@billions-barista-30103/webpack-dev-server v^1.8.4breezy-area-11544
05/16/2022, 12:04 PMjolly-toddler-22752
05/16/2022, 12:12 PMwindow.Cypress
is going undefined in some of my cypress tests, and consequently window.store
also stays undefined.
For example, I have a test like this:
js
describe("test", () => {
it("test store", () => {
cy.visit("/");
cy.contains("Username").should("be.visible");
cy.window().its("store").should("exist");
cy.get(".asdasdasd", {timeout: 50000}).should("exist");
});
});
The last command is supposed to always fail and trigger a 2nd retry.
The frontend (a React app) has the following in the index.tsx
file (runs in the "/" which page the test is visiting):
js
// expose store when run in Cypress
if (window.Cypress) {
window.store = store;
}
When I run the frontend in dev mode (yarn start) the test always passes.
When I compile-all and build the frontend and put it in nginx, when I run this test in cli (headless) mode it passes the store in the first try, fails the second try; when I run the test in windowed mode it passes the store both times (after I cleared the "workbox" cache in dev tools; before it would fail in the 2nd try).
When I reduce the timeout from 50000 to anything lower than around 42900 it starts to pass in every case (once I noticed a spam like this during that time coming in the e2e terminal:
...
GET /static/media/index.30302fff.less 200 505.212 ms - -
GET /static/media/index.33bfc7b4.less 200 558.951 ms - -
GET /static/media/index.3887c08f.less 200 521.361 ms - -
GET /static/media/index.4d6a62b6.less 200 505.271 ms - -
GET /static/media/index.500df235.less 200 518.217 ms - -
GET /static/media/index.52c1dfea.less 200 507.734 ms - -
...
I think it's related to the cache I deleted, but no idea what it could mean).
I have tried testing an older version of the frontend that worked, it still fails 2nd try.
Any suggestions?jolly-toddler-22752
05/16/2022, 1:29 PMwindow Cypress
is going undefinedrapid-lizard-10941
05/16/2022, 1:45 PMrapid-lizard-10941
05/16/2022, 2:07 PMgifted-engineer-59861
05/16/2022, 2:22 PMflat-waitress-43696
05/16/2022, 3:05 PMwin.open
method
// but pass the _self
argument
return win.open.wrappedMethod.call(win, url, '_self')
}).as('open')
})
cy.get('.example > a').click()
cy.get('@open').should('have.been.calledOnceWithExactly', '/about.html')
})
})
Thanks !!!creamy-train-56346
05/16/2022, 5:40 PMgray-kilobyte-89541
05/16/2022, 5:58 PM