Hacker News new | past | comments | ask | show | jobs | submit | jeff00seattle's comments login

I have been developing tests using Cypress for 6+ months.

I have used multiple other variations of test frameworks that were built on the Selenium WebDriver protocol. The official documentation [1] states that Cypress differs fundamentally and architecturally as compared to Selenium.

Admittedly I found Cypress web testing framework frustrating initially, and yes, I have performed many re-writes because Cypress documentation behind command chaining and assertion queuing to be not intuitive.

Thanks for my management's support, perseverance afforded me with the stubbornness with a purpose of checking out Cypress if it has a better DOM manipulation, how it operates directly in the browser, interactive test runner, and its API and configuration.

It required 3+ months of perseverance in getting the Cypress tests organized [2] for handling web testing core functionality of a commercial-grade corporate web site. My current layout required adding a lot of extensions to the core folders under /cypress: /support, /plugins & /config.

I am motivated in writing a series of posts on Medium, because I like Cypress. Is it perfect, no, some aspects are frustrating. In other words, I have not found a solution yet, but I will continue to use Cypress.

From the minimal amount of Cypress development experience, suggestions: a) Switch everything to TypeScript b) Declare Commands within Cypress namespace c) Understand selectors d) Add querying attributes, like 'data-cy', to expedite finding elements. e) Wait for element to appear using 'cy.get(...).contains([ element attributes]).then(...)' f) Avoid if at all possible using XPath for selectors. g) Use 'cy.wait()' to wait for an alias to become available, and not for millisecond delays. h) Use available eslint extensions for Cypress.

I will try to get a couple of posts on Medium as soon as possible. They may be helpful.

[1]: https://docs.cypress.io/guides/overview/why-cypress.html#In-... [2]: https://docs.cypress.io/guides/core-concepts/writing-and-org...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: