4

I want to use cypress as an alternative to webdriver.io but I am struggling to get my arguments across to the rest of my team as it cannot travel across other superdomains whereas Webdriver.io does with apparent ease. The main problem is that when a user wants to login on my platform it redirects to Azure B2C login and this always breaks my tests even with the web security set

{ "chromeWebSecurity": false }

I've seen that you can use Stubs to get around this but what if the B2C functionality changes? My e2e test will still pass when in reality it should fail.

4
  • 1
    If Cypress doesn't do what you need it to, it's not really an alternative - why do you still want to use it? What's the problem you're trying to solve with Webdriver.io?
    – jonrsharpe
    Commented Nov 9, 2020 at 9:40
  • 1
    Cypress might not be an end to end test tool for you, but even from your description it is a great tool for some
    – Rsf
    Commented Nov 9, 2020 at 9:46
  • 1
    Cypress only works for single window single domain scenarios. Webdriver.io can be an excellent tool that does a lot more and also a lot less than cypress. there are certain things (like hovering) or anything priviledged that cypress simply doesn't do well - check out testim.io/blog/… Commented Nov 9, 2020 at 23:03
  • @jonrsharpe I guess that was the question I was kind of asking! Thanks a lot everyone Commented Nov 10, 2020 at 11:34

3 Answers 3

4

What you're describing is mentioned here in the Cypress documentation.

Cypress documentation also mentiones some workarounds. I think the bottom line for you is this part:

A common use case for this is Single sign-on (SSO). In that situation you may POST to a different server and are redirected elsewhere (typically with the session token in the URL).

If that’s the case, you can still test this behavior with cy.request(). cy.request() is NOT bound to CORS or same-origin policy.

In fact we can likely bypass the initial visit altogether and POST directly to your SSO server.

You usually don't want to test a SSO page, your goal is to just sign in. Therefore, you don't need to go to this SSO page and fill in a form there. That's the idea behind what Cypress says in the documentation.

If this doesn't work for you, then Cypress is probably not a good choice for you. It seems you have a chance to choose whatever tool you want, then why force it and use Cypress? Perhaps sticking to Webdriver.io is the way forward.

3

Remember context - what works for some may not work for you. Other than the suggestions above, consider your system and think about what you need. Cypress is a popular tool but not every test tool is applicable to all systems.

0

To be honest with you, this is the primary reason why I have chosen Webdriverio v6 over Cypress v5 in recent projects.

I am a cypressIO SDeT using this tool since 2018 along with wdio v4 since then.

My idea was to adapt Cypress for all new projects but failed in Proof of Concept itself due to simple reasons:

  1. I am unable to run tests in different domains and tests simply fail when navigated to different URL from primary domain.
  2. Internet Explorer is not provided part of browser support (event through Edge is included from Microsoft, I still need IE to prove some customer base can access the web pages)
  3. Integration to ReportPortal(for the need of artificial intelligence and machine learning to log defects or reopen defects automatically when features fail part of tests) is easy and smooth in wdio v5 but not at all considered in cypressIO v5. When asking this question to the Senior Developer of Cypress Team, he never interested about ReportPortal at all (in a public virtual conference during July'2020)

**

Your team is RIGHT in saying wdio is better over cypressio in the implementation space you have got with B2C URLs. Since you can scale the tests with wdio in different test environment and URLs (where as cypressio wont allow that as of 29Nov2020)

**

Useful sources: If you are trying to do Proof of Concept with Cypressio, Please try some very nice skeleton frameworks of cypressIO here:

https://github.com/narayananpalani/cypress-test-techniques

https://github.com/narayananpalani/cypress-api-test-techniques

If you want to compare Cypress with Wdio,protractor or few other test automation tools, refer some nice gTAA (general Test Automation Architecture) of test frameworks here: https://engineers-hub.teachable.com/p/istqb-advanced-level-test-automation-engineer-professional-training-with-q-a

https://engineers-hub.teachable.com/p/cypressio

Wdio v5 Framework for comparision with entire test repository to try Proof of Concept: https://github.com/bardius/wdio-cucumber-bdd-boilerplate

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.