Don’t fall asleep juuuust yet. If you’re like me, during development, you probably refresh your browser and click on buttons a million times a day to make sure you didn’t break anything. This clicking-on-buttons-and-checking-it-still-works is essentially what fancy people call end-to-end testing. I’ve been doing this a lot recently while testing the Theme & Plugin Files Addon and working through a refactor of the WP Migrate DB Pro codebase.
Fortunately, like other types of testing, there is a way to automate end-to-end testing.
In this post we’re going to cover Cypress and how it simplifies end-to-end testing in the browser. You can use Cypress to test any ‘critical path’ on your site. This can be actions like making sure your sales funnel still works after a code push, or that a contact form submits correctly. Anything you would normally test by hand you can automate with Cypress!
Why Cypress?
Cypress is a new-ish test runner that aims to simplify end-to-end testing.
Before Cypress you’d have to figure out which testing library to use (Mocha, Karma, Jest), install Selenium, choose an assertion library, choose a mocking library, lose
Source: https://managewp.org/articles/18008/end-to-end-testing-with-cypress
source https://williechiu40.wordpress.com/2018/10/23/end-to-end-testing-with-cypress/
No comments:
Post a Comment