https://cypress.io logo
Join DiscordCommunities
Powered by
# e2e-testing
  • s

    steep-morning-65056

    09/14/2022, 2:39 PM
    Does anyone know of a way to instrument code on a timely basis and without slowing down the build? Or am I out of luck?
  • n

    nutritious-army-46708

    09/14/2022, 2:45 PM
    Thank you so much!
  • n

    nutritious-army-46708

    09/14/2022, 2:47 PM
    I think the first parameter in cy.origin() should be a URL, for example(cy.origin("google.com", ()=>))
  • o

    orange-shampoo-39617

    09/14/2022, 3:23 PM
    Is there a document somewhere that explains how to extend the default Webpack using
    cypress.config.ts
    ? The documentation I found (https://github.com/cypress-io/cypress/tree/master/npm/webpack-preprocessor#modifying-default-options) seems to use
    plugins
    which are deprecated
  • p

    purple-train-63923

    09/14/2022, 3:26 PM
    Is there a way to pass in a dynamic query value to cy.intercept? It looks like it only accepts a string and regex. Based on a number of variables, the query key and value are entirely dynamic in my api. I tried
    JSON.stringify(myfunction())
    but got TS errors
  • c

    clever-table-91477

    09/14/2022, 4:40 PM
    Is there any part of the API URI that is stable and not changing? then you can use that. For instance cy.intercept('POST', '**partOfURL**').as('')
  • c

    cold-apartment-77594

    09/14/2022, 4:41 PM
    Hi there. I'm having problems using the cypress-cucumber-preprocessor (4.3.1) with cypress (6.5.0, yes, I'm stuck with this version at this time). I keep getting step implementation missing errors and I wonder if maybe that is because my feature files have "# language: de". Does anybody know if cypress-cucumber-preprocessor supports the "# language" header?
  • o

    orange-shampoo-39617

    09/14/2022, 5:22 PM
    Found how if anyone is curious: https://stackoverflow.com/questions/73720641/how-to-extend-webpack-config-in-cypress-10/73720885#73720885
  • g

    gray-kilobyte-89541

    09/14/2022, 5:45 PM
    .should("contain", links[0].href)
    should probably be
    .should("contain", links[index].href)
  • p

    polite-jordan-30716

    09/14/2022, 7:45 PM
    hi all, do you know of a way to test assert each element of the array of a JSON response from a Cy.get?
  • l

    limited-barista-33480

    09/14/2022, 9:23 PM
    Hi Team! Can someone help me, I need to execute this code inside a cypress automation, this code is in a .js file and if I copy and paste it inside the describe that contains the spec.cy.js. I get errors and the test fails. // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT-0 var awsIot = require('aws-iot-device-sdk'); // // Replace the values of '' and '' // with a unique client identifier and custom host endpoint provided in AWS IoT. // NOTE: client identifiers must be unique within your AWS account; if a client attempts // to connect with a client identifier which is already in use, the existing // connection will be terminated. // var device = awsIot.device({ keyPath: '88888888.pem.key' certPath: '99999999.pem.crt', caPath: 'RXTTT.pem', clientId: 'test', host: 'vfrgtyuhhhh.amazonaws.com' }); // // Device is an instance returned by mqtt.Client(), see mqtt.js for full // documentation. // device .on('connect', function() { console.log('connect'); /* device.subscribe('topic_1'); */ device.publish('topic_2', 'Message'); console.log('Message send Succesfully .......'); }); device .on('message', function(topic, payload) { console.log('message', topic, payload.toString()); });
  • p

    purple-train-63923

    09/14/2022, 11:37 PM
    Thanks! That's exactly what I ended up doing. I was overcomplicating it. It was a function returning a string so I just did
    Copy code
    cy.intercept('GET', `*/stable-url?${dynamicQuery}`)
  • d

    delightful-microphone-80931

    09/15/2022, 8:36 AM
    Hi All, I need to access DynamoDB from Cypress to validate my tests. Is there any article showing how to set it up?
  • e

    enough-author-35578

    09/15/2022, 9:27 AM
    I'm trying to improve our tests' performance by utilizing the new
    testIsolation=legacy
    option to prevent page reloads between tests that don't need to refresh the entire page. Currently we do the following
    Copy code
    js
    beforeEach(() => {
      cy.login()
      cy.visit("/some-page-to-test")
    })
    Where
    cy.login()
    is a custom command that uses
    cy.session()
    to login as recommended in the docs. Since we now no longer want to reset the page between every test. I've moved this code from
    beforeEach
    to
    before
    so we only run it once per suite. This works fine for the first test, but after the first test it gets redirected to our login page since we no longer call
    cy.login()
    between tests. Splitting it up so we do the
    visit()
    in
    before
    and
    login
    in
    beforeEach
    seems like it should help, but this causes it to end up at the
    about:blank
    page since
    cy.session()
    seems to always clear the page after running, regardless of the
    testisolation
    option. If it is indeed the case that
    cy.session()
    always clears the page, then I wonder what the point of the
    testIsolation
    option is? Unless I am misunderstanding/misusing it?
  • p

    polite-painting-51763

    09/15/2022, 10:26 AM
    I have a scenario if cy.get(
    span:contains("${objText}")
    ).parents('div[class^=sc-]').find('input') this element is visible on UI then return the same or else return cy.get(
    span:contains("${objText}")
    ).parents('div[class^=sc-]').find('Span') how can I write a code using cypress-if plugin? Please note objText I am passing as an argument in the cypress command
  • g

    gray-kilobyte-89541

    09/15/2022, 10:29 AM
    cy.get(...).parents(...).find('input').if('not.exist').find('Span')
    does not work?
  • c

    cool-fountain-61225

    09/15/2022, 10:44 AM
    Hi All, I am trying to open the website through cypress by using the following command in steps file, also store the command baseURL in cyprss.config file. Given('Navigate to the website', () =>{ cy.visit('/'); }) But after running the command, the website is not getting loaded propely. And when I am trying to open same URL in new window it is loading properly. Can anyone help me with this issue. ? Do I need to add any other configuration for this.?
  • a

    acceptable-hamburger-48790

    09/15/2022, 11:25 AM
    When you say its not getting loaded properly, what is missing ? Also What is the error you are getting when test failed
  • p

    polite-painting-51763

    09/15/2022, 11:33 AM
    it throws an error at line 92 in the file index.js of plugin cypress-if saying "cy.clear() failed because it requires a DOM element."
  • c

    cool-fountain-61225

    09/15/2022, 11:38 AM
    It is showing the above error. The webpage is not getting load fully. I can see the error message as "Something Went Wrong".
  • p

    polite-painting-51763

    09/15/2022, 11:53 AM
    Don't know what is wrong at my end it throws an error for every if command
  • g

    gray-kilobyte-89541

    09/15/2022, 1:18 PM
    Could you open an issue in cypress-if with the full test code so I can run it and see what is going wrong?
  • p

    polite-painting-51763

    09/15/2022, 1:38 PM
    From my work machine i am not allow to do so, but i will definitely try to create an example from my personal machine and raise the issue.
  • b

    bitter-fountain-36713

    09/15/2022, 1:41 PM
    Have you checked npm for a dynamoDB package?
  • l

    little-france-10142

    09/15/2022, 1:42 PM
    I spent all day trying to setup up a programmatic login via our firebase authentication. Just a simple email+password for the moment. Appears a lot harder than I realized. Does everyone else just use the
    cypress-firebase
    library? Is that reliable? How's the upkeep? Any other suggestions?
  • p

    proud-breakfast-29892

    09/15/2022, 3:04 PM
    Hi everyone, I'm trying to write an E2E test that tests a SAML Login flow. But when I navigate to my IdP using
    cy.visit
    , Cypress simply crashes without any error message.
  • p

    proud-breakfast-29892

    09/15/2022, 3:06 PM
    Here's a video of the test running:
  • p

    proud-breakfast-29892

    09/15/2022, 3:06 PM
    This is my code:
  • p

    proud-breakfast-29892

    09/15/2022, 3:07 PM
    Copy code
    ts
            const loginSaml = (userName: string, password: string, idpUrl: string) => {
                cy.clearLocalStorage();
                cy.clearCookies();
    
                cy.origin('https://admin.us1.gigya.com', {args: idpUrl}, (url) => {
                    cy.request({
                        method: 'GET',
                        url
                    }).then(() => {
                        cy.request({
                            method: 'GET',
                            url: 'https://admin.us1.gigya.com/admin.console.getSamlSettingsByDomain?domainName=cdpe2e&isCDP=true'
                        });
                    });
                });
            };
    
            it('Should manage permission in Universe & log-in using SAML', () => {
                const idpUrl = `https://cdpe2e.my.st1.universe.cdp.gigya.com`;
                loginSaml('a', 'b', idpUrl);
                cy.visit(idpUrl);
  • p

    proud-breakfast-29892

    09/15/2022, 3:08 PM
    This is most strange behavior. If someone could run this on their machine and see if it works for them It'll help me a lot.
1...101102103...192Latest