Do not use numerical step ids

This is part of the Semicolon&Sons Code Diary - consisting of lessons learned on the job. You're in the testing category.

Last Updated: 2024-12-03

I had the following dusk selector as a test hook in Project S:

<div dusk="find_appointment_patient_step_1" >
</div>

Then we changed the ordering of the steps (by re-arranging and adding new ones) twice, necessitating changes to these ids containing step_x numericals. This was laborious and annoying and could have been avoided if the IDs only mentioned the step name, rather than their ordering.

The fix - don't use numbers in these IDs

<div dusk="find_appointment_patient_step_submit" >
</div>

Lesson

Do not use numerical numbers in structural IDs because you create a coupling on ordering that must be maintained.