Bug 40168 - afterEach not called in KohaTable cypress tests
Summary: afterEach not called in KohaTable cypress tests
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Pedro Amorim
URL:
Keywords:
Depends on: 40127
Blocks: 40170
  Show dependency treegraph
 
Reported: 2025-06-18 20:03 UTC by Jonathan Druart
Modified: 2025-08-01 07:46 UTC (History)
2 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00,25.05.02,24.11.08
Circulation function:


Attachments
Bug 40168: Restore afterEach in KohaTable Cypress tests (3.46 KB, patch)
2025-06-18 20:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 40168: Remove cleanup() call from afterEach (1.12 KB, patch)
2025-06-18 20:17 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 40168: Restore afterEach in KohaTable Cypress tests (3.50 KB, patch)
2025-06-18 21:25 UTC, David Nind
Details | Diff | Splinter Review
Bug 40168: Remove cleanup() call from afterEach (1.17 KB, patch)
2025-06-18 21:25 UTC, David Nind
Details | Diff | Splinter Review
Bug 40168: Restore afterEach in KohaTable Cypress tests (3.57 KB, patch)
2025-07-08 14:44 UTC, Pedro Amorim
Details | Diff | Splinter Review
Bug 40168: Remove cleanup() call from afterEach (1.23 KB, patch)
2025-07-08 14:44 UTC, Pedro Amorim
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2025-06-18 20:03:57 UTC

    
Comment 1 Jonathan Druart 2025-06-18 20:17:13 UTC
Created attachment 183348 [details] [review]
Bug 40168: Restore afterEach in KohaTable Cypress tests

We defined an anonymous function inside an arrow function, and Cypress does not call it.

Test plan:
Set AlwaysShowHoldingsTableFilters to "Do not"
Run t/cypress/integration/KohaTable/Holdings_spec.ts:
  yarn cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts

When done, have a look at the value of AlwaysShowHoldingsTableFilters
=> without this patch it has been modified (not restored) and is set to
"Do"
=> With this patch applied the original value is restored at the end of
the tests (actually the end of each test)
Comment 2 Jonathan Druart 2025-06-18 20:17:16 UTC
Created attachment 183349 [details] [review]
Bug 40168: Remove cleanup() call from afterEach
Comment 3 David Nind 2025-06-18 21:25:26 UTC
Created attachment 183357 [details] [review]
Bug 40168: Restore afterEach in KohaTable Cypress tests

We defined an anonymous function inside an arrow function, and Cypress does not call it.

Test plan:
Set AlwaysShowHoldingsTableFilters to "Do not"
Run t/cypress/integration/KohaTable/Holdings_spec.ts:
  yarn cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts

When done, have a look at the value of AlwaysShowHoldingsTableFilters
=> without this patch it has been modified (not restored) and is set to
"Do"
=> With this patch applied the original value is restored at the end of
the tests (actually the end of each test)

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2025-06-18 21:25:29 UTC
Created attachment 183358 [details] [review]
Bug 40168: Remove cleanup() call from afterEach

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 Pedro Amorim 2025-07-08 14:44:52 UTC
Created attachment 183865 [details] [review]
Bug 40168: Restore afterEach in KohaTable Cypress tests

We defined an anonymous function inside an arrow function, and Cypress does not call it.

Test plan:
Set AlwaysShowHoldingsTableFilters to "Do not"
Run t/cypress/integration/KohaTable/Holdings_spec.ts:
  yarn cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts

When done, have a look at the value of AlwaysShowHoldingsTableFilters
=> without this patch it has been modified (not restored) and is set to
"Do"
=> With this patch applied the original value is restored at the end of
the tests (actually the end of each test)

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 6 Pedro Amorim 2025-07-08 14:44:54 UTC
Created attachment 183866 [details] [review]
Bug 40168: Remove cleanup() call from afterEach

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
Comment 7 Lucas Gass (lukeg) 2025-07-08 21:44:41 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 8 Paul Derscheid 2025-07-10 20:50:44 UTC
Nice work everyone!

Pushed to 25.05.x
Comment 9 Fridolin Somers 2025-07-31 08:43:44 UTC
I'm looking at this for 24.11.x but dependencies are deep
Comment 10 Jonathan Druart 2025-07-31 09:38:28 UTC
In reply to Fridolin Somers from comment #9)
> I'm looking at this for 24.11.x but dependencies are deep

It simply removes
-        () =>(
Comment 11 Fridolin Somers 2025-08-01 07:46:48 UTC
Pushed to 24.11.x for 24.11.08