Ask HN: Cypress.js Based BDD Testing
Hi all,
I would like to know opinion on BDD testing FW I am working on. Please tell me yours opinions about it in comments.
Background: In my dev experience I always took care about E2E QA automation. Over time, on various projects, I used Selenium, then Serenity or Cucumber with Serenity. But on my latest project I started using cypress.js which is really great FW and provides much more performance than selenium/serenity due to no need for driver. However I am missing some support for BDD in cypress.js. I know, cucumber can be used with it, but from experience I know that cucumber is looking nice but over time people hate it because it reduces productivity (especially when DEVs helps QAs). Naming things is very hard in software engineering and creating Cucumber sentences can be nightmare.
Therefor I started working on new FW for BDD testing with cypress.js and here is sneak peak how it looks like: https://gist.github.com/flucivja/e73abff27ed3b042668f5e6b46ed5b54
here is equivalent in plain cypress.js: https://gist.github.com/flucivja/83ee7968310ce324d25fc0308c857121
yes in plain cypress it is much less code, but imagine real world example with 100-200 steps in that way ... report would be unreadable, not speaking about sharing page objects and maintenance.
Some highlights: - tests written as declarative chain of instructions so it is nicely readable in report - FW encourage you to use given-when-then style for writing tests - full TypeScript support (it would be bad DX without it) - it gives you code completion in tests what actions you can call while chaining - support for storing/retrieving values in tests - support for various selectors (css selector, xpath, data attributes, dynamic selector) in @FindBy decorator
No comments yet.