melodic-king-62847
05/05/2022, 9:45 AMcreamy-telephone-59986
05/05/2022, 10:23 AMstage('Perform smoke testing - Staging') {
parallel {
stage('With Edge') {
steps {
sh 'npm run cypress:run:smoke:staging:edge'
}
}
stage('With Chrome') {
steps {
sh 'npm run cypress:run:smoke:staging:chrome'
}
}
}
}
Sometimes it works but from time to time i'm getting an error : [FAILED] Error: ETXTBSY: text file is busy, open '/root/.cache/Cypress/9.6.0/Cypress/Cypress'
One test run is ok (let's say for chrome), the other is not (edge then).
Do you have any idea of what's wrong here ? FYI :
- my dockerfile is based on cypress/base:12.
- cypress:run:smoke:staging:edge => npx cypress run --browser edge --config baseUrl=XXX --group smoke-tests-edge --record --key ${CYPRESS_RECORD_KEY} --parallel --ci-build-id $BUILD_TAG --tag "smoke,staging,edge" --spec "cypress/integration/smoke/**/*.feature"
- cypress:run:smoke:staging:chrome => npx cypress run --browser chrome --config baseUrl=XXX --group smoke-tests-chrome --record --key ${CYPRESS_RECORD_KEY} --parallel --ci-build-id $BUILD_TAG --tag "smoke,staging,chrome" --spec "cypress/integration/smoke/**/*.feature"
Thanks.gray-kilobyte-89541
05/05/2022, 10:44 AMmelodic-king-62847
05/05/2022, 11:52 AMmelodic-king-62847
05/05/2022, 11:52 AMcreamy-telephone-59986
05/05/2022, 12:26 PMlittle-france-10142
05/05/2022, 2:02 PMbored-dinner-46643
05/05/2022, 3:12 PMsalmon-forest-3187
05/05/2022, 3:14 PMgray-kilobyte-89541
05/05/2022, 4:13 PMbored-dinner-46643
05/05/2022, 4:44 PMgray-kilobyte-89541
05/05/2022, 6:03 PMable-terabyte-12576
05/05/2022, 6:12 PM40000ms
for your remote page to load.
Your page did not fire its load
event within 40000ms
.
You can try increasing the pageLoadTimeout
value in C:\automation\cypress\cypress.json
to wait longer.
My assumption is because the machine is logged out it's blocking some external call that happens in the page after login because the snapshot of the page looks fine (though cannot see bottom of page) and the browser still indicates 'Loading'.
Anyway, my question though is related to the timeout itself. All the docs say the default page load timeout is 60s. I've added the variable into my cypress.json and if I go in the test runner and look at settings, it shows pageLoadTimeout: 60000.
so if it's set to 60s, why am I getting this error at 40s?melodic-shoe-1152
05/06/2022, 8:30 AMmelodic-shoe-1152
05/06/2022, 8:31 AMmelodic-shoe-1152
05/06/2022, 8:31 AMmelodic-shoe-1152
05/06/2022, 8:31 AMmelodic-king-62847
05/06/2022, 9:28 AMmelodic-shoe-1152
05/06/2022, 9:33 AMmelodic-shoe-1152
05/06/2022, 9:37 AMmelodic-king-62847
05/06/2022, 9:47 AMmelodic-king-62847
05/06/2022, 9:47 AMcy.wait(‘@post’).should((xhr) => {
expect(xhr.status, ‘successful POST’).to.equal(200).pause()
})
melodic-king-62847
05/06/2022, 9:48 AMmelodic-shoe-1152
05/06/2022, 10:00 AMmelodic-king-62847
05/06/2022, 10:50 AMaloof-magazine-95832
05/06/2022, 1:29 PMbillions-manchester-52317
05/06/2022, 6:02 PMmagnificent-finland-58048
05/07/2022, 10:28 AMI was looking for a way to map an array into a handful of commands without having to define each one individual
Why? What's the goal? Why not make it simple
You don't even need commands. You can make util functions. Commands just let you not have to import those in n
places .
In fact, I recommend util functions or functions that will be used in 2-3 specs, and commands for things beyond that.
So, in your case, you may want to just get functions to work first, then worry about commands.
Once you get the util functions, commands are easy. You can make a command that just wraps that util function.
Commands.add('someName', () => myUtilFunction) That's all it takes.
Here are 2 resources that are relevant
https://dev.to/muratkeremozcan/functional-test-patterns-with-cypress-27ed
https://dev.to/muratkeremozcan/how-to-create-an-internal-test-plugins-for-your-team-in-ts-implement-custom-commands-and-use-other-cypress-plugins-in-them-5lp
and this one has an accompanying repository
It is not how you would setup a regular repo, but should give ideas towards what you want to accomplish
https://github.com/muratkeremozcan/cypress-test-plugin-exampleancient-zoo-12002
05/09/2022, 8:05 AMancient-zoo-12002
05/09/2022, 8:08 AM