https://cypress.io logo
Join Discord
Powered by
# help
  • m

    melodic-king-62847

    05/05/2022, 9:45 AM
    https://tenor.com/view/por-favor-please-cat-puss-in-boots-gif-13803071
  • c

    creamy-telephone-59986

    05/05/2022, 10:23 AM
    Hello guys. I'm new here. I'm trying to implement the parallelization in Jenkins pipelines (i'm using a Dockerfile). Here is the parallel stage :
    Copy code
    stage('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.
    Copy code
    - 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.
  • g

    gray-kilobyte-89541

    05/05/2022, 10:44 AM
    Take a look at https://glebbahmutov.com/blog/quick-click/
  • m

    melodic-king-62847

    05/05/2022, 11:52 AM
    HIiiiiii @mysterious-analyst-56660 @lemon-oyster-64925 @cuddly-winter-72122
  • m

    melodic-king-62847

    05/05/2022, 11:52 AM
    do you have any idea about mi error???🔝
  • c

    creamy-telephone-59986

    05/05/2022, 12:26 PM
    Found the solution for my issue : Using agent per stage instead of using agent per pipeline.
  • l

    little-france-10142

    05/05/2022, 2:02 PM
    Hey look, I'm blog famous! 😂 Thanks for the help for real. Not sure if you caught it, but I'm very new to the world of React, and FE development. Hence my super basic questions. I have a strong tendency to mutter, "but... why?" to myself a lot these days.
  • b

    bored-dinner-46643

    05/05/2022, 3:12 PM
    Hello everyone, I am currently refactoring our Cypress runtime. I have some basic question to determine if our infra is correctly applied. - what is the best docker image to run cypress, in fact they directly use node image that costs a rebuild docker layer every time. - finally what the steps for running e2e tests look like from a feature branch are you testing only the feature or rerun all e2e test every time
  • s

    salmon-forest-3187

    05/05/2022, 3:14 PM
    Hey cypress fellow supporters, I am puzzled by a task and I need some help on it . So the task - I need to test a map - The map is behind a and it's developer with React Map GL - Snapshot is not a solution because elements change or I can use a mock but it's not a proven stable testing method. How can I do it with cypress ?
  • g

    gray-kilobyte-89541

    05/05/2022, 4:13 PM
    https://github.com/cypress-io/cypress-docker-images ? I am not sure why the Docker image would require a rebuild. For the second question https://glebbahmutov.com/blog/faster-ci-feedback-on-circleci/ is a good starting point. Then https://glebbahmutov.com/blog/tag-tests/ I would rather run more tests to make sure everything has been tested
  • b

    bored-dinner-46643

    05/05/2022, 4:44 PM
    oh! this is very interesting, our docker image take the branch and rebuild so this require a install, docker image are recreate layer if files are different then the previous build and the third party plugins are always different (almost) so the layer restart a that layer. so maybe this is a probleme
  • g

    gray-kilobyte-89541

    05/05/2022, 6:03 PM
    You probably should look at what you rebuild when files are different. For example, you do not have to reinstall NPM dependencies if package.json and lock files are the same, something like https://github.com/bahmutov/double-docker
  • a

    able-terabyte-12576

    05/05/2022, 6:12 PM
    Trying to understand pageLoadTimeout. i run my tests daily on a machine where 1 day in the week it reboots and on that day I tend to get like 99% fails with - CypressError: Timed out after waiting
    40000ms
    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?
  • m

    melodic-shoe-1152

    05/06/2022, 8:30 AM
    Hey guys, is there a way to disable followRedirect globally somehow?
  • m

    melodic-shoe-1152

    05/06/2022, 8:31 AM
    I'm trying to get the redirect headers but not follow it, since the destination has i-frame protection
  • m

    melodic-shoe-1152

    05/06/2022, 8:31 AM
    But instead of sending a request to get the URL, I use the click() method and get the headers using the intercept() method
  • m

    melodic-shoe-1152

    05/06/2022, 8:31 AM
    Is there a better way I can be doing this?
  • m

    melodic-king-62847

    05/06/2022, 9:28 AM
    I fix it these using click force and and wait()
  • m

    melodic-shoe-1152

    05/06/2022, 9:33 AM
    What does click force do?
  • m

    melodic-shoe-1152

    05/06/2022, 9:37 AM
    I can access the headers fine using intercept, click, and wait, but I want to stop the redirect
  • m

    melodic-king-62847

    05/06/2022, 9:47 AM
    ahh I misenderstood you. I thought you couldn't do the click to the correct element. I also have the same issue. Suffering on internet I found out this solution that consist to verify the response of that link through the status code.
  • m

    melodic-king-62847

    05/06/2022, 9:47 AM
    Copy code
    cy.wait(‘@post’).should((xhr) => {
    expect(xhr.status, ‘successful POST’).to.equal(200).pause()
    })
  • m

    melodic-king-62847

    05/06/2022, 9:48 AM
    however, this solution works me only for some links 🙃
  • m

    melodic-shoe-1152

    05/06/2022, 10:00 AM
    Cool, thanks, I'll try that out tomorrow!
  • m

    melodic-king-62847

    05/06/2022, 10:50 AM
    You are welcome!
  • a

    aloof-magazine-95832

    05/06/2022, 1:29 PM
    Hi everyone! Can we connect to Azure Blob Storage using cypress?
  • b

    billions-manchester-52317

    05/06/2022, 6:02 PM
    Hey there buds! I'm sorry to bother, but I had a few silly questions around custom commands, and was hoping that someone might be able to set me straight. Is it imperative that all custom commands be declared in typescript? I was wondering if there were some way to use common js, but everything I'm reading seems to indicate that they must be done this way. I was looking for a way to map an array into a handful of commands without having to define each one individually. I'm pretty sure I can get that done in the commands.js, but I'm not really sure how that would work with the ts declaration.
  • m

    magnificent-finland-58048

    05/07/2022, 10:28 AM
    if you're using TS, it will ask that there are type definitions for that command, so yes there are ways you can enable commonJS while using TS (not sure why you would want that, but you can)
    I 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-example
  • a

    ancient-zoo-12002

    05/09/2022, 8:05 AM
    Hey, did anyone have an annoying issue where after npx cypress open, the cypress IDE is open but you can't bring it to the front and actually use it??
  • a

    ancient-zoo-12002

    05/09/2022, 8:08 AM
    This is the error that comes up in the terminal: [4000:0509/110111.571:ERROR:gpu_init.cc(453)] Passthrough is not supported, GL is disabled, ANGLE is
1...606162...252Latest