https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32131

--- Comment #1 from Pedro Amorim <[email protected]> ---
Best approach imo would be to use set the syspref using before() instead of
beforeEach() we're already using for cy.login.

However, this implies the following:
1) Because before() runs previous to beforeEach() this means we would also have
to move login to before() - previous to setting sys pref.
2) If we're doing 1) we also need to re-implement how login is being done,
using cy.session, see
https://www.cypress.io/blog/2021/08/04/authenticate-faster-in-tests-cy-session-command/
3) That said, to use cy.session, we also need to put
experimentalSessionAndOrigin: true in cypress.json since this is still an
experimental thing added in Cypress 8.2, we're using cypress 9.5 last time I
checked.

Lastly, before() can save the original ERMModule sys pref value in some
variable and we restore its' value using after().

I tried all this, and is half-working. It works as expected for the first test
in a spec, but for some reason it's not authenticating for the second test in
the spec. Will keep at it.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to