
Ask HN: Twice): How to do proper front-end testing? Is it useful enough to do? - melvinroest
Hello!<p>I&#x27;m currently in the situation where I&#x27;m noticing that the back-end is tested a fair amount of times, but the front-end does not have any automated tests.<p>So I was wondering: to what <i>extent</i> is UI testing even feasible &#x2F; not a waste of time? What are pragmatic considerations about it? And if it is feasible, how does one go about it?<p>Things I thought about:<p>Is it simply using Selenium or Puppeteer? Is it using a visual diff and checking for that? Is it simply unit testing&#x2F;integration testing?<p>To me, it all seems a bit of a waste unless a front-end process is super critical, like a checkout page.
======
ajeet_dhaliwal
Back-end tests can be super robust immediately whereas front-end ones
generally take some tweaking to get to that point. I still think they’re worth
it, especially for testing the core feature happy paths. Selenium and the like
are fine. Being end-to-end these type of tests cast a wide net so it’s worth
logging the dev tools / browser network logs if you can at the time a test
fails as well as taking a screenshot.

Use a cloud device service like BrowserStack and setup some CI. Who wants to
test this stuff manually after the first time. Make sure the front end devs
don’t change your data-* attribute tags or whatever else you’re using to find
elements and are strict with that.

As lead dev and co-founders at Tesults.com I’d obviously recommend you use
that for consolidating test reporting from your back-end and front-end tests
:-)

