I'm a passionate Front-end Engineer, a speaker, and an instructor. I love creating high-quality products, testing and automating everything, learning and sharing my knowledge, helping people. I work remotely for Hasura.
Breaking the fear of
For testing newbies, testing-doubtful, or bug-haters devs.
Why should you test? 🤔
Because tests perform checks forever and ever 🔁
So you can code with...
Some testing perks:
• Refactoring made easy/possible
Yes! Take a look at these test descriptions!
• If the recovery submission goes well, the user should see a success feedback
• If the recovery has been submitted elsewhere, the user should see a success state
• If the quorum fails, the user should be able to restart the whole process
Where do I start?? 🙋♂🙋♀
vs UI Testing!
It's hard to be familiar with the various kinds of tests
• E2E Tests: automated front-end + back-end
• UI Integration Tests: automated front-end +
static back-end responses
UI Tests fall into two categories:
I don't have time!
Testing perks are in the medium/long term only 🤧
Safe refactoring while coding is too.
Working without a back-end is a short-term perk! 🎡
Automating manual checks is too.
Tests are brittle, I need to update them every time 😡
Users care about features, not tech details!
❌ Stores, internal states, frameworks, re-renders
✅ Login, buy, interactions, flows, features
Testing like a programmer is the #1 reason for test failures
I started testing... But bugs went to production anyway...
That's the fault
If I don't TDD,
I don't test anything! 🤔
TDD requires a particular context and clear specs.
Forget it for now 😉
And if you do not trust me, at least trust Kent 🏆
I don't want to face
Remember that code coverage is just a tool!
It allows you to understand what you have tested and what you have not 😉
Low code coverage
High code coverage
Last but not least...
... Sucks! 💩
... Your code...
And it's hard to test bad code!
(don't worry, mine sucks too 😁)
And allow you to refactor it 💎
UI Testing avoids you to face your code 💩👋
What does Cypress do?
It allows you to automate your UI tests through a controlled browser 🤖
I'm Stefano Magni (@NoriSte)
(or just run $ npx noriste)
Thank you 🙏
These slides are publicly available
I'm working on a "UI Testing Best Practices" book on GitHub,
check it out! ❤️
Breaking the fear of front-end testing - 20m
By Stefano Magni