SuffolkLITLab / ALKiln

Integrated automated end-to-end testing with docassemble, puppeteer, and cucumber.
https://assemblyline.suffolklitlab.org/docs/alkiln/intro
MIT License
14 stars 4 forks source link

Docs? `buttons`/`action buttons` with "special buttons" are not distinguishable #848

Open plocket opened 7 months ago

plocket commented 7 months ago

[IDEA for random input tests: Should we just avoid danger and warning and info buttons in random tests?]

"Special buttons" don't seem to have a useful way to differentiate what they're going to do in the DOM or other front end data. [Actually, Exit seems to have a danger style and Restart seems to have a warning style, but I don't think that can be guaranteed to be unique or to be uncustomized.] Not sure that random tests can avoid this without the user being able to specify either the labels of buttons to avoid clicking (and to do so in multiple languages) or the [literal HTML] value of the buttons, (which they would need to know how to do, either with counting or by looking in the DOM), all of which would be very fragile to changes.

We at least need to document this and also maybe (in a separate issue) try to figure out how to let people do this.

YAML:

question: We are all done.
buttons:
  - Exit: exit
  - Restart: restart

HTML:

<fieldset class="da-button-set da-field-buttons">
  <legend class="visually-hidden">Press one of the following buttons:</legend>
  <button type="submit" class="btn btn-da btn-danger" name="X211bHRpcGxlX2Nob2ljZQ" value="0">Exit</button>
  <button type="submit" class="btn btn-da btn-warning" name="X211bHRpcGxlX2Nob2ljZQ" value="1">Restart</button>
</fieldset>

There is no more useful info in the DOM [or in the data available to the front end].

Special button types: restart new_session exit logout exit_logout leave continue refresh signin

plocket commented 7 months ago

Also, devs can only press these with selectors by looking at the DOM. We could try to let users press buttons based on labels too since we now know how to let them do tests for different translations (with cucumber Examples).