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

    gray-kilobyte-89541

    11/28/2022, 6:25 PM
    but you still use the old
    cypress-grep
    in your code...
  • s

    square-honey-48197

    11/28/2022, 6:48 PM
    I'm trying to do a simple assertion that the day of a
    mm/dd/yyyy
    string matches my desired
    daydate
    via: the
    startDate
    I'm passing in is just
    11
    Copy code
    TypeScript
    getCustomDateStartDateInput()
            .invoke('val')
            .then((date) => {
                cy.log('Desired Date:\t' + startDate);
                console.log('Actual Start Date\t' + date);
                console.log(String(date).split('/')[1]);
                expect(String(date).split('/')[1]).to.equal(startDate);
            });
    For some reason the assertion in the command palette looks like this:
  • s

    square-honey-48197

    11/28/2022, 7:01 PM
    I'm `cy.log`ing the variables I'm passing in at the start of the test: (I don't mutate them at all, just pass them to the function above)
  • e

    enough-truck-68085

    11/28/2022, 7:11 PM
    I m trying to do a simple assertion that
  • b

    bitter-judge-96754

    11/28/2022, 7:40 PM
    Which one is better for Visual Testing? Applitools or Percy?
  • v

    victorious-summer-2999

    11/28/2022, 8:43 PM
    Hi Gleb, right, my bad, even though I am still seeing an error
    packages/e2e/cypress/config/configFiles/cypress-desk.config.ts
    Copy code
    import { defineConfig } from 'cypress';
    
    export default defineConfig({
      viewportWidth: 1920,
      viewportHeight: 1024,
      watchForFileChanges: false,
      waitForAnimations: true,
      numTestsKeptInMemory: 1,
      defaultCommandTimeout: 15000,
      requestTimeout: 15000,
      video: false,
      videoCompression: 0,
      // screenshot: true,
      chromeWebSecurity: false,
      retries: {
        runMode: 1,
        openMode: 0,
      },
      e2e: {
        experimentalSessionAndOrigin: true,
        experimentalRunAllSpecs: true,
        // We've imported your old cypress plugins here.
        // You may want to clean this up later by importing these.
        setupNodeEvents(on, config) {
          const pluginFile = require('../../plugins/index.ts');
          require('cypress-grep/src/plugin')(config);
          pluginFile(on, config);
    
          return config;
        },
      },
    });
  • b

    best-flower-17510

    11/28/2022, 8:47 PM
    @nutritious-restaurant-91514 any insight on this?
  • g

    gray-kilobyte-89541

    11/28/2022, 10:27 PM
    you still use
    require('cypress-grep/src/plugin')(config);
    ?
  • w

    wide-exabyte-26689

    11/29/2022, 7:02 AM
    Hi I have a requirement in the feature to click on the sub options thats hrs (<10, <20, <30 <40) for part time work time commitment. When I click on the sub options cypress displays those elements are hidden. The issue is that I am not able to click on the hidden elements. I tried different methods like invoke(), click({force: true}) so that I can click on hidden element but was not successful. Please let me know anybody faced same situation or have a work around for resolving the issue.
  • f

    fresh-doctor-14925

    11/29/2022, 10:19 AM
    Can you share some of the error messages from when it's not successful? That can be helpful
  • v

    victorious-summer-2999

    11/29/2022, 11:09 AM
    Hi @gray-kilobyte-89541 yep you were right, I missed that line, now updated but the result is identical
    packages/e2e/cypress/config/configFiles/cypress-desk.config.ts
    Copy code
    import { defineConfig } from 'cypress';
    
    export default defineConfig({
      e2e: {
        experimentalSessionAndOrigin: true,
        experimentalRunAllSpecs: true,
        setupNodeEvents(on, config) {
          const pluginFile = require('../../plugins/index.ts');
          require('@cypress/grep/src/plugin')(config);
          pluginFile(on, config);
    
          return config;
        },
      },
    });
    packages/e2e/tsconfig.json
    Copy code
    {
      "compilerOptions": {
        "jsx": "react",
        "target": "ES6",
        "module": "CommonJS",
        "skipLibCheck": true,
        "noImplicitAny": false,
        "noUnusedLocals": true,
        "noUnusedParameters": true,
        "strict": true,
        "allowJs": true,
        "removeComments": true,
        "baseUrl": "./",
        "types": ["cypress", "node", "cypress-real-events", "cypress-wait-until", "cypress-grep"],
        "outDir": "./dist",
        "lib": ["es6", "ESNext", "dom", "ES5"],
        "moduleResolution": "node",
        "resolveJsonModule": true,
        "esModuleInterop": true
      },
      "include": ["./**/*.tsx", "./**/*.ts", "./**/*.d.ts"],
      ...
    }
    packages/e2e/cypress/plugins/index.ts
    Copy code
    const registerCypressGrep = require('@cypress/grep')
    registerCypressGrep();
    
    module.exports = (on, config) => {
      // we register our plugin using its register method:
  • r

    rough-jordan-79228

    11/29/2022, 11:26 AM
    Hey community Im trying to test a Website- which has more layers. Products >>[on.click] Detailview of products Shows up For some reason it doesnt want to finish loading the Page. When i open the Website manual and browse to the site - it works but when cypress is trying to do so - it doesnt work. Any clue what to check first? Or any docs for me to go through? Cheers
  • f

    fresh-doctor-14925

    11/29/2022, 11:31 AM
    Check if there's any errors in the developer console, or if the second page is on a different origin Can you reach the page directly by visiting its url in Cypress, rather than clicking to reach it?
  • g

    gray-kilobyte-89541

    11/29/2022, 11:41 AM
    you are loading the browser part of the grep plugin from your plugins file
    Copy code
    const registerCypressGrep = require('@cypress/grep')
    registerCypressGrep();
    (a good idea would be to learn how plugins are structured, and there is Node and browser parts like in this case, something I cover in my https://cypress.tips/courses/cypress-plugins course)
  • l

    limited-barista-33480

    11/29/2022, 1:40 PM
    Hello guys, does anyone know how to integrate and execute node code in a cypress test automation. What happens is that I have a file with javaScript code that I execute separately with node and I want that code to be able to run from cypress.?
  • v

    victorious-summer-2999

    11/29/2022, 1:40 PM
    is there any repo available where this plugin is correctly being set?
  • r

    rough-jordan-79228

    11/29/2022, 1:43 PM
    I cant reach it directly - either i cant reach it by clicking it in cypress 😅 But the site can be visited from a normal Browser which is not run by cypress.
  • r

    rough-jordan-79228

    11/29/2022, 1:44 PM
    https://github.com/cypress-io/cypress/issues/6195 Dont know if this will solve my problem
  • q

    quick-diamond-67609

    11/29/2022, 1:53 PM
    Hey Community, I need some help. I am facing an issue when I try to test the login feature of my app. The login process is done in a separate app. When clicking on login, I will be redirected to the auth app. There I can type the email and password. After successful login, I will be redirected back to my original app. In the auth app, after I enter the email, it will redirect to another page. And the URL has some parameters. I was trying to use the
    origin
    command to visit the auth app. But the entire spec will get restarted when I redirect to the next page after typing the email. When I checked the doc, I found that params are not supported in the URLs inside the
    origin
    callback function. Can anyone suggest me an alternate solution for this? Version: 9.6 App framework: React
    Copy code
    js
    it("should login successfully", () => {
      cy.origin(
        "http:localhost:3000/", //auth app URL
        { args },
        ({ email, otp }) => {
          cy.visit("/");
          cy.get(".email-field").type("test@gmail.com");
          cy.get(".sbmit-btn").click();
          // Should redirect to otp page => http:localhost:3000/?email=test@gmail.com
          cy.get(".otp-field").type("123456");
        }
      );
      cy.visit("/"); // Should redirect to app url (http:localhost:3001)
    });
    This is the sample snippet.
  • g

    gray-kilobyte-89541

    11/29/2022, 2:35 PM
    it is on my "todo list" for https://cypress.tips/courses/cypress-plugins
  • f

    fierce-terabyte-72718

    11/29/2022, 4:40 PM
    > What to do to fix?cypress open libva error: vaGetDriverNameByIndex() failed with unknown libva error, driver_name = (null) [934181:1129/083805.379269:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported. [933986:1129/083806.354447:ERROR:object_proxy.cc(623)] Failed to call method: org.freedesktop.DBus.StartServiceByName: object_path= /org/freedesktop/DBus: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
  • i

    important-hair-85125

    11/29/2022, 5:17 PM
    Anyone can help me to make a test?
  • f

    fresh-doctor-14925

    11/29/2022, 5:29 PM
    That's a very open ended question that's unlikely to get a response on here. I suggest you take the Cypress tutorials, and use this Discord if you have questions https://docs.cypress.io/examples/examples/tutorials#Best-Practices
  • c

    cool-toothbrush-53313

    11/30/2022, 3:43 AM
    Hi After I migrated to Cypress 10, I'm not able to run specific test scenarios using cucumber tags. I used to execute scripts using cypress-tags. Looks like after migrating cpress-tags is not available. How may I be able to run a specific script? Any help would be appreciated...
  • s

    stale-optician-85950

    11/30/2022, 8:48 AM
    I recommend you use this package instead https://github.com/cypress-io/cypress/tree/develop/npm/grep for continued future support.
  • f

    freezing-piano-2792

    11/30/2022, 10:10 AM
    Do yourself a favor and forget
    @cypress/grep
    completely if you're using
    @badeball/cypress-cucumber-preprocessor
  • f

    freezing-piano-2792

    11/30/2022, 10:11 AM
    The upgrade guide explains the removal of `cypress-tags`: https://github.com/badeball/cypress-cucumber-preprocessor/issues/689
  • p

    powerful-journalist-49461

    11/30/2022, 2:29 PM
    Hi guys, I'm trying to make parallel execution of my tests using GitHub action and Cypress Dashboard. I think that I have setup everything good but I'm facing problem that app of my company is recognising cypress IP as bot. I can request from my co-workers to whitelist cypress IP but I don't know what is IP of cypress dashboard, and does we can find it somewhere. I have already tried to add header in visit call : cy.visit('/', { headers: { 'accept': 'application/json, text/plain, */*', 'user-agent': 'axios/0.27.2' } }); This is error: The response we received from your web server was: > 403: Forbidden
  • f

    fresh-doctor-14925

    11/30/2022, 2:32 PM
    If you have a dashboard subscription, this sounds like one that Cypress Support should be able to help you out with Btw, adding the header to
    visit()
    would only append it for that specific call, rather than the whole test. You can append headers in each call of your test using
    cy.intercept()
    , but given that this is due to the calls between the runner and Dashboard then I'm not even sure that would work
  • p

    powerful-journalist-49461

    11/30/2022, 2:35 PM
    Actually I'm using free version, but will try to get some info from them, ty 🙂
1...155156157...192Latest