- Issue created by @mstrelan
- 🇦🇺Australia mstrelan
Not sure how to reproduce this one, but if the failing part doesn't exist then it can't fail, right?
I had a go at using the
setupFile
arg to provide the setup required for the test. Before doing this, the nightwatch test would complete in around 26 seconds, performing 11 HTTP requests before getting to the login step. Once I moved the module and permission setup to a setup file this was reduced to around 16 seconds, with 1 HTTP request before the login. But to use::createUser
I had to borrow a few assert methods from phpunit, and I figured we could just assign the perms to anonymous user. This eliminated all initial HTTP requests. I then noticed there were several permissions that were not required for the test to pass, so I removed those as well.I guess this should be postponed on ✨ Provide PHP helpers for Nightwatch tests to speed up routine operations Active , but if it helps with the current random fails maybe we can keep it as it is until we have some generic helpers.
- 🇺🇸United States smustgrave
Seems pretty straight forward, only part I second guess was changing from a random role to anonymous. But frankly nightwatch is more pain then value I believe so say why not.
- 🇬🇧United Kingdom catch
I had to think about using the anonymous user as well, but as long as they can see the right things it's fine I think, we're not testing access so the less setup the better.
We could try to add more generic helpers for nightwatch tests but might want to do that as part of moving to functional js + axe and playwright as alternatives - e.g. when we refactor the tests more. If we get to the point where nightwatch tests actually pass, then it'll make it more confident about conversions of those tests, vs reproducing the same random failures.
Committed/pushed to 11.x and cherry-picked to 11.2.x, thanks!
Automatically closed - issue fixed for 2 weeks with no activity.