Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jimmy.puckett's avatar

Need TDD tools for HTML/JS college course

I am helping with an intro to HTML/JS class with one of my old college professors, and we have set up a CI pipeline that mimics our internal pipeline, so when the students commit code to gitlab, it triggers jenkins to build & then deploy their site.

I want to introduce them to TDD by having some "test" that looks for specific html tags, classes, etc where we give them the test as part of the assignment. Then they red/green/refactor.

We have been digging around trying to find some simple testing framework/tools for them to understand the test & start writing them, but have not seen anything that we think is starter enough. I am not interested in teaching them all that is involved in Codeception & I don't want something as involved as grepping through curl responses. In addition, I would like to have some HTML CodeSniffer/Validator to keep them coding to a standard.

Anyone have anything that they have used that you could point me towards?

0 likes
4 replies
ohffs's avatar

Without knowing what you think is 'starter enough' it's hard to say. The laravel test framework does a lot in a fairly easy to read way. And Jeffrey has some extensions like this one to make checking html stuff even easier. I sometimes use the laravel test code to test projects not written in laravel as it's so straightforward :-)

For HTML validation etc, tidy is pretty nice :-)

jimmy.puckett's avatar

@ohffs Thanks for the idea. Are you saying the you pull illuminate/foundation in & then use it's TestCase to run your test?

If so, then how does it work "booting up" a fresh laravel application each test? Seems like there would have to be a bunch of laravel stood up to run html test?

I do really like this idea, as we will be using Laravel in the next class, so it would be nice if some of the assertions were the same, but it seems like it would not work well for static HTML/JS sites?

ohffs's avatar

It's probably not ideal for this particular case as I wrap/mangle things via closures in the routes file :-/ I keep meaning to look and see if there's a way of doing a $this->visit('http://some-site.com/') - you'd imagine someone's mangled it at some point.

I take it using the selenium driver wouldn't work for you & the students? It's nice and visual at least...

Please or to participate in this conversation.