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

    acceptable-hamburger-48790

    08/22/2022, 1:51 PM
    Might help a reproducing git hub repo - Even if you want to create a issue, reproducing example would help to anyone who wants to investigate and help
  • b

    brash-army-33335

    08/22/2022, 2:23 PM
    Thanks
  • m

    microscopic-crowd-9149

    08/22/2022, 4:26 PM
    onclick system redirect user to another domain & system remove Spec window ( how we can resolve this ) & showing redirect URL in window without Specs window @stocky-dream-36427 @wonderful-match-15836 @best-flower-17510
  • m

    microscopic-crowd-9149

    08/22/2022, 4:49 PM
    after this window system remove Spec window & stop everything
  • d

    damp-glass-84607

    08/22/2022, 4:57 PM
    Hello again, I am pretty new to Cypress and my organization is planning on reverting back to 9.7.0 to continue to make use of the Cypress Studio. We have been using the badeball Cypress-cucumber-preprocessor and bahmutov's esbuild preprocessor, is there a guide out there for using Cypress 9.7.0 with these tools?
  • f

    fresh-nail-30646

    08/22/2022, 8:31 PM
    I have a custom command for logging in via API, and I'm calling it in the before hook, but the session isn't being preserved between tests. All the examples in the docs show the login being called in beforeEach. If I'm logging in before each test, is the session even being preserved across tests or am I just logging in before every test?
  • p

    plain-garden-5374

    08/22/2022, 8:51 PM
    session is not preserved across tests
  • a

    abundant-hydrogen-26466

    08/22/2022, 9:17 PM
    Yeah we ran in to this when we first started with Cypress at our company. Our work around was to copy the cypress (itโ€™s specific) local state between tests
  • f

    fresh-nail-30646

    08/22/2022, 9:26 PM
    Do you by chance have an example of how that's done?
  • a

    abundant-hydrogen-26466

    08/22/2022, 9:37 PM
    Yea, let me see if I can pull it up
  • b

    brash-mechanic-5372

    08/22/2022, 9:38 PM
    Hi, I'm having issues with the installation of Cypress, I can't locate the cypress.config.js file
  • a

    abundant-hydrogen-26466

    08/22/2022, 9:40 PM
    Not entirely sure if this is hacky or not, but it's worked flawlessly for us for a while now.
    Copy code
    let LOCAL_STORAGE_MEMORY = {};
    
    Cypress.Commands.add("saveLocalStorage", () => {
        cy.window().then(window => {
            Object.keys(window.localStorage).forEach(key => {
                LOCAL_STORAGE_MEMORY[key] = window.localStorage[key];
            });
        });
    });
    
    Cypress.Commands.add("restoreLocalStorage", () => {
        cy.window().then(window => {
            Object.keys(LOCAL_STORAGE_MEMORY).forEach(key => {
                window.localStorage.setItem(key, LOCAL_STORAGE_MEMORY[key]);
            });
        });
    });
    put that into your commands.js, and then at then at the top of your tests after your
    describe(
    and before your first
    it(
    test, call it this way:
    Copy code
    beforeEach(() => {
            cy.restoreLocalStorage();
        });
    
        afterEach(() => {
            cy.saveLocalStorage();
        });
  • f

    fresh-nail-30646

    08/22/2022, 9:52 PM
    awesome, thanks I'll give that a shot!
  • h

    high-restaurant-93761

    08/22/2022, 10:54 PM
    Hey all, does anyone from Cypress have any ideas about this? https://discord.com/channels/755913899261296641/755913900024791046/1010101418067238952
  • l

    little-france-10142

    08/22/2022, 10:56 PM
    I must be missing something. I am trying to write a password reset test. Our validation uses Firebase, and so the password reset link gets sent to the user email, I can get the link utilizing Mailosaur. However storing that link as a variable (as per Mailosuar's own documentation) and attempting to
    cy.visit
    it results in it getting tagged with the
    baseUrl
    . From what I've read, you're not supposed to navigate to external sites within the same test. It looks like there's the option to enable the experimental feature (
    cy.origin
    ) but that seems like a lot. The other option I'm seeing is
    cy.routing
    but I'm not sure that's what I'm after. Does anyone here have practical experience with Mailosaur and navigating through an email link in one test?
  • a

    abundant-hydrogen-26466

    08/22/2022, 11:21 PM
    I had to set up a custom function to get around the cross-visit issue. Goes against their rules, but we needed to do it on our application.
    Copy code
    Cypress.Commands.add('crossVisit', (crossUrl) => {
        // this is a workaround due to the fact that Cypress currently does not support hitting a different super domain with .visit()
        cy.window().then((window) => {
            window.location.assign(crossUrl);
        });
    });
  • c

    chilly-queen-22182

    08/23/2022, 2:15 AM
    Hi All, Is there any way to validate the attachment in the email using cypress? please
  • a

    acceptable-hamburger-48790

    08/23/2022, 3:59 AM
    You might need to give this a read https://github.com/mailosaur/cypress-mailosaur
  • e

    early-nest-3800

    08/23/2022, 6:57 AM
    How do I get the results of multiple `Chainable`s?
  • e

    early-nest-3800

    08/23/2022, 7:05 AM
    Also, if my markup looks like
    <h1/><div><h2/></div>
    , what's the most efficient way to get from the h1 to the h2? I'm thinking of some function like
    .next("h2")
    that does preorder DOM traversal.
  • b

    blue-battery-71202

    08/23/2022, 11:03 AM
    Hi all, How would you solve the following type error, also how would you type to be fine with Typescript and Cypress?
    Copy code
    API.getAccessCodes(id).then((response: **GetCodesResponse**) => { // error 1
              expect(response.success).to.be.true; // intellisense work here as expected
              expect(response.data.code).to.equal('12345678'); // intellisense work here 
            });
    
    // error 1: 
    // No overload matches this call. Argument of type '(response: GetCodesResponse) => void' is not assignable to parameter of type '(this: ObjectLike, currentSubject: Response<any>) => void'.
    
    // API.getAccessCodes(id: string): Cypress.Chainable<Cypress.Response<any>>
    getAccessCodes
    return the
    cy.request()
    , and the above example works as expected, however I cannot seem to resolve the issue with the response type, and if I do, TS loses the ability to have intellisense inside the
    .then()
  • l

    little-france-10142

    08/23/2022, 3:33 PM
    Custom External Site
  • f

    freezing-wall-5568

    08/23/2022, 4:08 PM
    Hi Team, hope somebody knows how can I solve the integration of clickhouse into the project? Like I need to make queries from test to clickhouse base and get a response by these queries and work with this response. Because cypress runner doesn't handle this yet, I all-time get an error like > URL is not a constructor?
  • h

    hallowed-lighter-4305

    08/23/2022, 4:34 PM
    Hi Team! I would like to know if anyone has implemented a parametric login that I can run in different environments using the credentials according to the test environment (qa, dev, prod). the version of cypress that I am using is 10?
  • f

    fresh-doctor-14925

    08/23/2022, 4:38 PM
    Yeah, I've achieved this in the past by having the credentials passed in as environment variables
  • h

    hallowed-lighter-4305

    08/23/2022, 4:46 PM
    excellent Liam, you know how to do it in version 10 of cypress. Might you help me? I am very new to this framework. Any documentation or tutorial that can help me, I appreciate it.
  • e

    early-optician-55799

    08/23/2022, 5:03 PM
    As for documentation, I think this is the one that might be helpful in order to achieve what Liam suggested https://docs.cypress.io/guides/guides/environment-variables
  • h

    hallowed-lighter-4305

    08/23/2022, 5:14 PM
    thanks marian! I was also reviewing this content and implemented it in the tests. But when running the login test I have problems with the variables that are entered to write in the texbox field https://talkingabouttesting.com/2021/10/09/como-fazer-login-com-cypress-em-diferentes-ambientes/
  • h

    hallowed-lighter-4305

    08/23/2022, 5:24 PM
    @early-optician-55799 look mariana, when implementing the content of the blog and running the test it throws me this error
  • e

    early-optician-55799

    08/23/2022, 5:28 PM
    As much as I would love to help, I'm a newbie when it comes to Cypress or even coding in general :). I've just came to look for help as well and it just happened that I have been searching through environment variables topics as well so I passed the link to the documentation I've just read myself ๐Ÿ˜‰
1...868788...192Latest