https://cypress.io logo
Join Discord
Powered by
# e2e-testing
  • n

    nutritious-waitress-23155

    12/04/2022, 9:59 PM
    Ok i am using vite and tried the cypress-vite preprocessor, which seems to solve my problem out of the box.
  • g

    great-oil-15113

    12/04/2022, 11:14 PM
    hi there is a button element on the page and click on it opens a new tab to switch to a new page. i know cypress cannot deal with multi-tab, so is there anything i can verify about this button? thanks
  • f

    flaky-airport-12178

    12/04/2022, 11:56 PM
    You mean `cy.wrap(null).as(aliasname)?
  • b

    bitter-fountain-36713

    12/05/2022, 12:20 AM
    You can search 'second tab' on cypress.tips/search
  • g

    great-oil-15113

    12/05/2022, 12:56 AM
    got it. thank you
  • g

    great-oil-15113

    12/05/2022, 4:59 AM
    hi all. i try to run cypress on azure devops pipeline by
    npx cypress run --record --key **** --e2e --reporter cypress-multi-reporters --reporter-options configFile=reporter-config.json
    . but the pipeline complains about project id missing
    This project is missing the projectId inside of: cypress.config.ts
    . what did i do wrong?
  • l

    limited-librarian-92780

    12/05/2022, 6:23 AM
    I'm using parents to get the fourth parent of an element, then I want to check that a string appears anywhere in that parent or it's descendants
  • l

    limited-librarian-92780

    12/05/2022, 6:23 AM
    But I can't use contains or find from an indexed item from the result of parents
  • l

    limited-librarian-92780

    12/05/2022, 6:24 AM
    What's the right way to do this?
  • s

    straight-chef-47891

    12/05/2022, 6:30 AM
    How do I pass the environment value in CLI into cypress.config.ts? On the CLI, I have something like
    CYPRESS_ENVIRONMENT=local npx cypress open
    . Then I try to pass that unto my
    cypress.config.ts
    file:
    Copy code
    const env = Cypress.env('ENVIRONMENT');
    But I get an error `ReferenceError: Cypress `is not defined
  • f

    fresh-doctor-14925

    12/05/2022, 8:51 AM
    You'd be able to access
    Cypress.env('ENVIRONMENT')
    within your specs, but
    cypress.config.ts
    runs in node as part of the setup process, so you don't have access to the
    Cypress
    object yet If you need to get it in there, you can reach it with
    process.env.CYPRESS_ENVIRONMENT
    , though at that point I'd probably just pass it in as
    ENVIRONMENT
    . You can also take that variable and assign it to so that you can access it in Cypress.env later:
    Copy code
    setupNodeEvents(_on, config) {
          config.env.ENVIRONMENT = process.env.ENVIRONMENT;
    
          return config;
        },
    Hope that helps!
  • q

    quiet-answer-70986

    12/05/2022, 8:57 AM
    Hello everyone , Hope you're all doing well. I am trying to automate a user flow where there are two test cases, Test Case 1 Redirect to the site input email and password for login Test Case 2 Navigate to the Documents section. Select Dates Test Case 1 passes, however when it starts executing the second test case , it redirects to the login page. Can anyone help?
    f
    • 2
    • 2
  • f

    fresh-doctor-14925

    12/05/2022, 9:18 AM
    Hello everyone Hope you re all doing
  • s

    strong-knife-80597

    12/05/2022, 10:38 AM
    Hello everyone! Was hoping to get a bit of help with a small issue I am having 🙂 In my old situation, I used webpack-dev-server to serve my app, and then cypress would do it's thing and generate coverage reports. In the new situation, I use node express to serve the production build locally, everything works fine except Cypress doesn't seem to generate these coverage files. The error I am getting is this:
    Copy code
    zsh
    Cannot find coverage file /Users/'...'/Documents/github/checkout/.nyc_output/out.json
    Skipping coverage report
    Again, it works just fine with webpack-dev-server. The folder structure is (when using webpack-dev-server) as follows:
    Copy code
    cypress-coverage/ <- it's a folder above dist/
    dist/
      express.js
      all my bundled files
    The express server looks like this:
    Copy code
    js
    const express = require('express');
    const path = require('path');
    
    const app = express();
    app.set('view engine', 'ejs');
    
    const port = process.env.PORT || 8080;
    
    const basename = '/page/checkout';
    
    app.use(express.json());
    app.use(express.urlencoded({ extended: true }));
    
    app.disable('x-powered-by');
    app.use(basename, express.static(__dirname));
    
    app.get('*', (req, res) => {
        res.status(200).render(path.join(__dirname, 'index.ejs'));
    });
    
    app.post('*', (req, res) => {
        res.status(200).render(path.join(__dirname, 'index.ejs'));
    });
    
    app.listen(port, () => {
        // eslint-disable-next-line no-console
        console.info(`Listening on port ${port}...`);
    });
    Any ideas what could be the issue?
  • s

    straight-chef-47891

    12/05/2022, 10:42 AM
    Hi Liam, this is very helpful. It works!
  • h

    helpful-hairdresser-46183

    12/05/2022, 11:09 AM
    Greetings to all, I am trying to run my tests via github actions, but I am getting an error as I have shared in the attachment. I've been struggling for days but I couldn't get over this error 😦 I am also sharing the image of the package.json file to give you an idea. Can you please help? Thank you so much
  • h

    helpful-hairdresser-46183

    12/05/2022, 11:10 AM
    screenshots added
  • g

    gray-kilobyte-89541

    12/05/2022, 11:36 AM
    probably. Why do you need to delete an alias?
  • g

    gray-kilobyte-89541

    12/05/2022, 11:37 AM
    use a newer version of
    @cypress/grep
    package (instead of
    cypress-grep
    )
  • h

    helpful-hairdresser-46183

    12/05/2022, 11:41 AM
    i checked now but the latest version is 3.0.4 If my cypress version is 11.2.0, is there a possibility that it is incompatible with the cypress version?
  • h

    helpful-hairdresser-46183

    12/05/2022, 11:47 AM
    sorry, now i understand. I'm trying again. 😦
  • h

    helpful-hairdresser-46183

    12/05/2022, 12:03 PM
    I updated the package again to @billions-barista-30103/grep. I was able to pass this stage, but this time I got different errors while running the tests 😦 I can run these tests on my terminal screen and get no errors, but for some reason I get these errors when I want to run them on github actions. I am attaching screenshots.
  • f

    fresh-doctor-14925

    12/05/2022, 12:04 PM
    !threadit
  • n

    nutritious-analyst-96582

    12/05/2022, 12:04 PM
    Let's keep the conversation going! Please create a thread in the original question to submit your responses 😀
  • h

    helpful-hairdresser-46183

    12/05/2022, 12:06 PM
    screenshots added
  • s

    strong-knife-80597

    12/05/2022, 12:18 PM
    Does anyone have an example of a node express server serving files and having cypress run it's tests against that while generating coverage files? This does generate files for me with webpack-dev-server but not node express
  • b

    best-flower-17510

    12/05/2022, 2:25 PM
    Yes, they have been removed
  • h

    helpful-hairdresser-46183

    12/05/2022, 4:23 PM
    @gray-kilobyte-89541 , Looking forward to your comment for these results 🙂
  • g

    gray-kilobyte-89541

    12/05/2022, 4:42 PM
    the errors above? I don't know, I think something is wrong there with the things configured or included
  • c

    colossal-match-42171

    12/05/2022, 5:47 PM
    anyone using cypress on docker?
1...159160161...192Latest