Open 0xedward opened 3 years ago
https://docs.google.com/document/d/1WcbUEw5iyeHAOrs2M7SXS0F6CEVtk5Z6q80Y8cl7uN4/edit?usp=sharing Comparison of different testing frameworks with sample code on setup
Great work! So we need to have our testing framework run a browser in the background (not just executing a javascript function and checking the result), because DOMParser is a browser API.
Also another requirement is that we need to consider support for testing on multiple browsers (Edge, Chromium, Chrome, Safari, Firefox, etc.), because DOMParser may behave differently on each browser and we don't want to have to use multiple testing frameworks to test the browsers we are planning on supporting.
Ideally we use something fast and lightweight, with just the features we need and nothing more, to write end-to-end tests with.
https://blog.checklyhq.com/cypress-vs-selenium-vs-playwright-vs-puppeteer-speed-comparison/
Gotcha, my bad I misunderstood which testing frameworks to look at. Here's my writeup of the two blogs comparing Selenium, Playwright, Puppeteer, and Cypress. I wrote this at the top of the doc but for our use case, I think Selenium would be the best option. Below is a quick summary of each testing frameworks strengths.
1) Cypress: Chrome family browsers (including Chromium) and Firefox 2) Selenium: IE, Google Chrome (12+), Safari, Opera, Firefox **Most users use Selenium 3) Playwright: Webkit (Safari), Chrome, and Firefox 4) Puppeteer: Specific to Chrome
1) Less back-end: Puppeteer 2) More back-end + full live website: Playwright 3) Selenium comes third (1.5x slower than other testing frameworks on average)
Cypress (considerably slower on live websites e2e testing)
Test cases for use to include:
<!-- This is a comment-->
<!DOCTYPE html>
<html><script>alert(1)</script><body><p>text
<html><head></head><head></head></html>
<html></html>
<html><head><meta description="test attribute"></head></html>
We should also include MathML, SVG and table tags in our tests because of weird side effects they cause with the HTML parser