DFE-Digital / ecf2

This application will replace the Manage training for early career teachers service in 2025.
5 stars 0 forks source link

Set up a frontend testing framework #47

Closed peteryates closed 1 week ago

peteryates commented 1 month ago

At some point we'll end up with a few pages that have custom JavaScript. This is most likely going to be pages where we allow autocompletion or if we ever need to show a cookie banner (hopefully not!) so we can test dismissing it.

The vast majority of our tests, and no end-to-end type ones, should need to run in the browser.

ECF1 and NPQ both use Selenium but since they were written Playwright has emerged and it has a nice clean Ruby client.

Tasks

gracecbrennan commented 1 month ago

Lorenzo is investigating Playwright to see if this is appropriate candidate for this project.

gracecbrennan commented 1 month ago

Halfway on this ticket to investigate the new end-to-end testing framework making good progress.

mason-emily commented 1 month ago

About to finish this investigation. @peteryates @tonyheadford @ltello to spend some time reviewing today

gracecbrennan commented 1 month ago

@peteryates has reviewed and is going to share comments on here.

@tonyheadford to take a look today.

gracecbrennan commented 4 weeks ago

@peteryates to review third option in more detail today

gracecbrennan commented 3 weeks ago

Check with @peteryates when he's back if he had a chance to review thiurd option

ltello commented 3 weeks ago

I have found a way to install Playwright without Capybara (third option). Still checking different scenarios but the approach works very well so far. Test suite runs times faster under this method.

Next steps:

peteryates commented 2 weeks ago

@ltello I took some of your code and adjusted it to work with the Capybara, just to see how minimal a setup we can have.

Happy to go with any so long as it's easy and intuitive, but #161 looks decent to me.

claire-hughez commented 2 weeks ago

Discussing an option to choose still. Today a decision will be made and this can be merged, based off Option 1.

claire-hughez commented 2 weeks ago

Wait until Pete is back to review this.

claire-hughez commented 1 week ago

Discussion and vote needed for testing today.

peteryates commented 1 week ago

I like this. Initially #180 was my preferred approach but I'm willing to give #183 a try. The playwright documentation is really comprehensive and it seems to run nice and quick.

I think #180 is the safest bet, we know Rack and Capybara really well. If we opt for #183 I think we should evaluate the choice after we've built our first couple of features and see how we feel as a team.

Thoughts @steventux, @tonyheadford?

tonyheadford commented 1 week ago

My vote is we give option 3 a go and review it as @peteryates suggests. I would prefer if we could use one DSL for everything.

ltello commented 1 week ago

Issue created to remove the sample code/specs once devs are familiar with Playwright and these samples are not needed anymore