limited-barista-33480
10/15/2022, 1:42 AMstale-optician-85950
10/15/2022, 12:52 PMcy.pause()
in your code just before your code clicks the Add button
* During this pause manually Dev Tools -> Network clear the request history
* Allow the Cypress test to continue
* Was the same request generated for the pop up form being displayed? Does it have a success status code or error status code?limited-barista-33480
10/15/2022, 3:06 PMaloof-carpet-54145
10/16/2022, 10:33 AMmysterious-belgium-25713
10/16/2022, 10:50 AMaloof-carpet-54145
10/16/2022, 10:59 AMripe-author-71222
10/16/2022, 1:25 PM- echo $CY_GROUP_SPEC
- CY_GROUP=$(echo $CY_GROUP_SPEC | cut -d'|' -f1)
- CY_BROWSER=$(echo $CY_GROUP_SPEC | cut -d'|' -f2)
- CY_SPEC=$(echo $CY_GROUP_SPEC | cut -d'|' -f3)
- CY_CONFIG=$(echo $CY_GROUP_SPEC | cut -d'|' -f4)
And then the cypress code build fails with this error:
*Opening Cypress...
Cypress encountered an error while parsing the argument: --spec
You passed: true
The error was: spec must be a string or comma-separated list*
I use this command to run cypress:
- NO_COLOR=1 ./node_modules/.bin/cypress run --browser $CY_BROWSER --spec "$CY_SPEC" --config "$CY_CONFIG" --headless. --record --key $CYPRESS_KEY --parallel --ci-build-id $CODEBUILD_INITIATOR --group "$CY_GROUP"
I defined these env variables like this on the top of the file:
batch:
build-matrix:
dynamic:
env:
image:
- ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/cypress:latest
variables:
CY_GROUP_SPEC:
- "UI - Chrome|chrome|cypress/e2e/account/*"
- "UI - Chrome|chrome|cypress/e2e/auth/*"
- "UI - Chrome|chrome|cypress/e2e/mastering/*"
- "UI - Chrome|chrome|cypress/e2e/pages/**/*"
- "UI - Chrome|chrome|cypress/e2e/user-flows/**/*"
WORKERS:
- 1
- 2
- 3
- 4
- 5
Can anybody help me to fix this problem?little-planet-43809
10/16/2022, 3:43 PMlittle-planet-43809
10/16/2022, 3:44 PMlimited-barista-33480
10/16/2022, 11:05 PMlimited-barista-33480
10/16/2022, 11:07 PMhappy-megabyte-98400
10/17/2022, 2:35 AMcy.request()
whose response body is like,
[
{
id: 1234
name: cypress
email: cypress@cypress.io
<other fields>
},
{
id: 1235
name: cypress
email: cypress@cypress.io
<other fields>
},
]
How can i extract only the id, name and email fields in the then()
block?acceptable-hamburger-48790
10/17/2022, 7:22 AMstale-optician-85950
10/17/2022, 8:54 AMhappy-megabyte-98400
10/17/2022, 11:20 AMbusy-wall-71096
10/17/2022, 1:06 PMcy.intercept
work for external calls? It seems to be a very common thing to happen on any web app but yet I failed to find a working example or workaround. Here's a failing snippet I had prepared:
describe('Intercept external request', () => {
it('Can intercept external resource request', () => {
cy.intercept({
url: 'https://github.githubassets.com/images/modules/site/home/globe/flag.obj',
}).as('extCall');
cy.intercept({
url: 'https://api.funcaptcha.com/*',
}).as('extCall2');
cy.visit('https://github.com');
// This works
cy.wait('@extCall').its('response.statusCode').should('eq', 200);
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(5000);
cy.contains('Sign up').click();
// The following will fail
cy.wait('@extCall2').its('response.statusCode').should('eq', 200);
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(5000);
});
});
Is this me just using it incorrectly or is this a bug? Help will be very appreciated 🙏
PS: chromeWebSecurity: false
didn't help.mysterious-belgium-25713
10/17/2022, 1:09 PM'https://api.funcaptcha.com/*
to
'https://api.funcaptcha.com/**
busy-wall-71096
10/17/2022, 1:31 PMdescribe('E2E: Radio stream & Playouts', () => {
it('Can play radio station from player', () => {
cy.intercept({
url: 'https://energyzuerich.mp3.energy.ch/energyzuerich-high.mp3?ua=energy+website+desktop',
}).as('audioStream');
cy.visit('https://energy.ch');
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(5000);
cy.visit('https://energy.ch');
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(5000);
cy.get('button.flex-shrink-0.w-12.h-12.p-2.cursor-pointer')
.filter(':visible')
.click();
// (fetch) GET 200 https://energyzuerich.mp3.energy.ch/energyzuerich-high.mp3?ua=energy+website+desktop
// This makes request hang and never fulfill. Later time-outs after 30s. Why?
cy.wait('@audioStream').its('response.statusCode').should('eq', 200);
// eslint-disable-next-line cypress/no-unnecessary-waiting
cy.wait(3000);
});
});
busy-wall-71096
10/17/2022, 1:32 PMgray-kilobyte-89541
10/17/2022, 1:46 PMmysterious-belgium-25713
10/17/2022, 1:48 PMmysterious-belgium-25713
10/17/2022, 1:55 PMjs
describe('E2E: Radio stream & Playouts', () => {
it('Can play radio station from player', () => {
// cy.intercept("GET","https://energyzuerich.mp3.energy.ch/energyzuerich-high.mp3?ua=energy+website+desktop").as("testurl")
cy.visit('https://energy.ch');
cy.get('button.flex-shrink-0.w-12.h-12.p-2.cursor-pointer')
.filter(':visible')
.click();
// (fetch) GET 200 https://energyzuerich.mp3.energy.ch/energyzuerich-high.mp3?ua=energy+website+desktop
// This makes request hang and never fulfill. Later time-outs after 30s. Why?
//cy.wait('@audioStream').its('response.statusCode').should('eq', 200);
});
});
But if you just have the intercept line (not waiting on the intercept) then it does not trigger the radio player
js
describe('E2E: Radio stream & Playouts', () => {
it('Can play radio station from player', () => {
cy.intercept("GET","https://energyzuerich.mp3.energy.ch/energyzuerich-high.mp3?ua=energy+website+desktop").as("testurl")
cy.visit('https://energy.ch');
cy.get('button.flex-shrink-0.w-12.h-12.p-2.cursor-pointer')
.filter(':visible')
.click();
// (fetch) GET 200 https://energyzuerich.mp3.energy.ch/energyzuerich-high.mp3?ua=energy+website+desktop
// This makes request hang and never fulfill. Later time-outs after 30s. Why?
//cy.wait('@audioStream').its('response.statusCode').should('eq', 200);
});
});
gray-kilobyte-89541
10/17/2022, 1:56 PMmysterious-belgium-25713
10/17/2022, 1:59 PMimportant-fish-21193
10/17/2022, 2:01 PMbusy-wall-71096
10/17/2022, 2:02 PMbusy-wall-71096
10/17/2022, 2:06 PMgray-kilobyte-89541
10/17/2022, 2:25 PMbusy-wall-71096
10/17/2022, 2:33 PMbusy-wall-71096
10/17/2022, 2:44 PM