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

    ancient-wire-34126

    10/01/2020, 12:25 PM
    Is there any status on e2e testing? I know the issue has been open for a long time and it has a ton of support, but I don't think there's been a reply recently?
  • s

    stocky-dream-36427

    10/01/2020, 3:08 PM
    Hey! @User whatcha mean?
  • s

    stocky-dream-36427

    10/01/2020, 3:08 PM
    E2E testing is the core feature of Cypress
  • s

    stocky-dream-36427

    10/01/2020, 3:09 PM
    > Cypress doesn't do actual e2e testing as they don't allow you to visit off-domain URL's (like sandbox integrations of payment providers). Currently it's more of a thorough integration test Ah I see
  • s

    stocky-dream-36427

    10/01/2020, 3:10 PM
    I think support for Cross-Domain iframes (payment providers, login) + cookies will land this quarter or q4
  • s

    stocky-dream-36427

    10/01/2020, 3:10 PM
    (guesstimate)
  • s

    stocky-dream-36427

    10/01/2020, 3:11 PM
    But there's a few workarounds for auth right now. @User has been working with Auth0 folks and wrote a series of articles
  • a

    ancient-wire-34126

    10/01/2020, 3:42 PM
    Ah good to hear! ;) Yeah it's a deal breaker for a lot of people, because payment providers are essential to test in an e2e test and you can't (and shouldn't) mock them (as they normally have sandboxes. It's the one reason we keep Selenium around, just to test payments and check our order management system if things are correct. 99% is Cypress, but we'd like to get that to 100% 😉
  • s

    stocky-dream-36427

    10/01/2020, 3:44 PM
    Yeah, I think a lot of people do this
  • s

    stocky-dream-36427

    10/01/2020, 3:45 PM
    Where they use Cypress for basically everything you want to debug, and then you do a remote driver for a payment system.
  • s

    stocky-dream-36427

    10/01/2020, 3:45 PM
    It's a pain to maintain the infrastructure for that one test.
  • a

    ancient-wire-34126

    10/01/2020, 4:13 PM
    Yeah it's not as bad if you already have it in place, but if you come into Cypress expecting to do that, then it suddenly becomes a deal breaker
  • s

    stocky-dream-36427

    10/01/2020, 4:21 PM
    Yeah, totally.
  • s

    stocky-dream-36427

    10/01/2020, 4:21 PM
    I think some folks are okay without it and some really aren't. I think supplementing (what you're doing) is healthy
  • n

    nutritious-restaurant-91514

    10/02/2020, 2:45 PM
    @User I was able to make braintree payment flows work by using some iframe solutions I found online.
  • a

    ancient-wire-34126

    10/02/2020, 2:46 PM
    I tried some hacks pretty extensively and could never get it to work :/
  • n

    nutritious-restaurant-91514

    10/02/2020, 2:46 PM
    that sucks 😞
  • n

    nutritious-restaurant-91514

    10/02/2020, 2:48 PM
    I actually realized, that our payment solution was an iframe and that input fields were iframes of themselves, so I went like two (maybe three?) levels deep until I was able to type in something 😃
  • a

    ancient-wire-34126

    10/02/2020, 2:48 PM
    yeah, hosted fields are nasty that way 😄
  • n

    nutritious-restaurant-91514

    10/06/2020, 7:01 AM
    not sure where to post this, but I made a blog about some basics, you can help me spread the word, it may help someone 🙂 https://filiphric.com/cypress-basics-selecting-elements
  • s

    stocky-dream-36427

    10/06/2020, 4:08 PM
    @User I made a channel called #763070261720645642
  • n

    nutritious-restaurant-91514

    10/06/2020, 4:09 PM
    Oh cool 👍
  • n

    numerous-greece-56828

    04/01/2021, 2:53 PM
    Hi guys, i'm trying test a login form, and I want to trigger a request and return an error 40X in the first time to show a two factor activation code input and after trigger a new request to same endpoint and return statusCode 20X to pass the authentication. I can do this? Like cy.intercept().first() or anything like this?
  • a

    ancient-appointment-66951

    04/08/2021, 1:53 AM
    Hi! sorry about the slow reply.
  • a

    ancient-appointment-66951

    04/08/2021, 1:53 AM
    I haven't tried this but you should be able to just do
    cy.intercept
    twice in the same test - it will use the most recently declared one.
  • n

    numerous-greece-56828

    04/14/2021, 8:43 PM
    I saw on Github Issues that have a feature to override the
    cy.intercept
    response to be released. While is not available I'm just set a counter like this:
  • n

    numerous-greece-56828

    04/14/2021, 8:50 PM
    If it's is good I don't know but works 😅
  • u

    user

    04/20/2021, 4:04 AM
    i know its late but is anyone currently available?
  • u

    user

    04/20/2021, 10:14 AM
    I'm trying to setup some listeners before each test, and removing them after each test. I tried using
    cy.on
    in the beforeEach (because using cy instead of Cypress should make it so they automatically get cleaned up between tests), but that does not seem to work, as it runs the content of the listener function provided too early.
  • u

    user

    04/20/2021, 10:15 AM
    So I am currently doing something like this instead:
    Copy code
    beforeEach(function () {
        let spySetup = function(window) {
            let config = this.mocha.getRunner().test.ctx.consoleLoggingTestConfig;
            config.spies.ERROR = sinon.spy(window.console, 'error');
            config.spies.WARN = sinon.spy(window.console, 'warn');
        };
        let spyAssertion = function() {
            let config: ConsoleLoggingTestConfig = this.mocha.getRunner().test.ctx.consoleLoggingTestConfig;
            assertSpiedConsoleLogs(config, ConsoleType.ERROR);
            assertSpiedConsoleLogs(config, ConsoleType.WARN);
        };
    
        Cypress.on('window:before:load', spySetup);
        Cypress.on('command:end', spyAssertion);
    
        this.test.ctx.consoleLoggingTestConfig = <ConsoleLoggingTestConfig>{
            consoleTypes: [ConsoleType.ERROR],
            excludedMessages: {
                ERROR: [
                    'while rendering',
                    'blabla'
                ],
                WARN: []
            },
            spies: {},
            spySetupFunc: spySetup,
            spyAssertionFunc: spyAssertion
        };
    });
    
    afterEach(function () {
        const config: ConsoleLoggingTestConfig = this.test.ctx.consoleLoggingTestConfig;
        Cypress.removeListener('window:before:load', config.spySetupFunc);
        Cypress.removeListener('command:end', config.spyAssertionFunc);
    });
12345...192Latest