SuffolkLITLab / docassemble-MAVirtualCourt

Project which currently holds code for the Doc Assembly Line project, including dependencies for actual interviews.
Other
7 stars 5 forks source link

Testing: Follows #673. Mainly separates concerns of button presses and navigation #674

Closed plocket closed 3 years ago

plocket commented 3 years ago

This does a bit much, but they mostly seemed intertwined at the time.

  1. Separates concerns for the test developer between buttons, navigation detection, etc, improving consistency. That is, you have to press the 'Next' button to navigate and then you can, separately, test that you got to a new page. It does decrease flexibility in some ways and means a bit more boilerplate sometimes.
  2. Speeds up some things by detecting actual da error pages and such.
  3. Creates scope.afterStep (there is none in puppeteer cucumber). It was needed for a few reasons:
    1. It detects actual da error pages, speeding up test errors. I may have brain freeze, but it seemed to me like something that should be done after every step.
    2. Resets navigation detection, which does need to be done after every step, so that page navigation can be detected correctly
    3. Can handle other end-of-step stuff, like waiting extra after a page is loaded. That's something that would be at the end anyway. Which reminds me - I'll try to add that in for after page navigation. Hmm, that may be tricky considering we also need to wait for show if.
    4. Basically, I didn't want to pile up a bunch of stacked up functionality at the end of each step, so I combined it into one call. Interested to hear what thoughts people have on it.
  4. Remembered why we had the flexibility for the label, button, link, etc. text all over the place - all those funny characters. I mostly switched back to that methodology and added a note about it. Didn't intend for that to be with this PR, but life is chaos.