-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6c8ee6
commit 1002608
Showing
11 changed files
with
468 additions
and
106 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
backend/src/openarchiefbeheer/destruction/tests/e2e/features/test_feature_list_finalize.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# fmt: off | ||
from django.test import tag | ||
|
||
from openarchiefbeheer.destruction.constants import ( | ||
ListRole, | ||
ListStatus, | ||
ReviewDecisionChoices, | ||
) | ||
from openarchiefbeheer.utils.tests.e2e import browser_page | ||
from openarchiefbeheer.utils.tests.gherkin import GherkinLikeTestCase | ||
|
||
|
||
@tag("e2e") | ||
class FeatureListCreateTests(GherkinLikeTestCase): | ||
async def test_scenario_record_manager_finalizes_list(self): | ||
async with browser_page() as page: | ||
record_manager = await self.given.record_manager_exists() | ||
reviewer1 = await self.given.reviewer_exists(username="Beoordelaar 1") | ||
reviewer2 = await self.given.reviewer_exists(username="Beoordelaar 2") | ||
await self.given.archivist_exists(username="Archivaris") | ||
|
||
assignees = [ | ||
await self.given.assignee_exists(user=record_manager, role=ListRole.author), | ||
await self.given.assignee_exists(user=reviewer1, role=ListRole.reviewer), | ||
await self.given.assignee_exists(user=reviewer2, role=ListRole.reviewer), | ||
] | ||
|
||
list = await self.given.list_exists( | ||
assignee=record_manager, | ||
assignees=assignees, | ||
uuid="00000000-0000-0000-0000-000000000000", | ||
name="Destruction list to finalize", | ||
status=ListStatus.internally_reviewed, | ||
) | ||
|
||
# Both reviewers provided a review. | ||
await self.given.review_exists(author=reviewer1, destruction_list=list, decision=ReviewDecisionChoices.accepted) | ||
await self.given.review_exists(author=reviewer2, destruction_list=list, decision=ReviewDecisionChoices.accepted) | ||
|
||
await self.when.record_manager_logs_in(page) | ||
await self.then.path_should_be(page, "/destruction-lists") | ||
|
||
await self.when.user_clicks_button(page, "Destruction list to finalize") | ||
await self.then.path_should_be(page, "/destruction-lists/00000000-0000-0000-0000-000000000000") | ||
|
||
await self.when.user_clicks_button(page, "Markeren als definitief") | ||
await self.when.user_fills_form_field(page, "Archivaris", "Archivaris") | ||
await self.when.user_clicks_button(page, "Markeer als definitief") | ||
|
||
await self.then.path_should_be(page, "/destruction-lists") | ||
await self.then.page_should_contain_text(page, "Destruction list to finalize") | ||
await self.then.list_should_have_status(page, list, ListStatus.ready_for_archivist) |
63 changes: 63 additions & 0 deletions
63
.../src/openarchiefbeheer/destruction/tests/e2e/features/test_feature_list_process_review.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# fmt: off | ||
from django.test import tag | ||
|
||
from openarchiefbeheer.destruction.constants import ( | ||
ListRole, | ||
ListStatus, | ||
ReviewDecisionChoices, | ||
) | ||
from openarchiefbeheer.utils.tests.e2e import browser_page | ||
from openarchiefbeheer.utils.tests.gherkin import GherkinLikeTestCase | ||
|
||
|
||
@tag("e2e") | ||
class FeatureListCreateTests(GherkinLikeTestCase): | ||
async def test_scenario_record_manager_process_review(self): | ||
async with browser_page() as page: | ||
await self.given.selectielijstklasse_choices_are_available(page) | ||
record_manager = await self.given.record_manager_exists() | ||
reviewer1 = await self.given.reviewer_exists(username="Beoordelaar 1") | ||
reviewer2 = await self.given.reviewer_exists(username="Beoordelaar 2") | ||
|
||
assignees = [ | ||
await self.given.assignee_exists(user=record_manager, role=ListRole.author), | ||
await self.given.assignee_exists(user=reviewer1, role=ListRole.reviewer), | ||
await self.given.assignee_exists(user=reviewer2, role=ListRole.reviewer), | ||
] | ||
|
||
destruction_list = await self.given.list_exists( | ||
assignee=record_manager, | ||
assignees=assignees, | ||
uuid="00000000-0000-0000-0000-000000000000", | ||
name="Destruction list to process", | ||
status=ListStatus.changes_requested, | ||
) | ||
|
||
# Both reviewers provided a review. | ||
await self.given.review_exists(author=reviewer1, destruction_list=destruction_list, decision=ReviewDecisionChoices.accepted) | ||
await self.given.review_exists(author=reviewer2, destruction_list=destruction_list, decision=ReviewDecisionChoices.rejected) | ||
|
||
await self.when.record_manager_logs_in(page) | ||
await self.then.path_should_be(page, "/destruction-lists") | ||
|
||
await self.when.user_clicks_button(page, "Destruction list to process") | ||
await self.then.path_should_be(page, "/destruction-lists/00000000-0000-0000-0000-000000000000") | ||
|
||
# TODO | ||
await self.when.user_clicks_checkbox(page, "(de)selecteer rij") | ||
|
||
# Fill selectielijstklasse as it's probably missing. | ||
await self.when.user_clicks_radio(page, "Aanpassen van selectielijstklasse") | ||
await self.when.user_fills_form_field(page, "Selectielijstklasse", "11.1 - Verleend - vernietigen - P1Y") | ||
|
||
# Fill archive date | ||
await self.when.user_clicks_radio(page, "Verlengen bewaartermijn") | ||
await self.when.user_fills_form_field(page, "Archief datum", "09/15/2023") | ||
await page.keyboard.press("Enter") | ||
|
||
await self.when.user_fills_form_field(page, "Reden", "Andere datum") | ||
await self.when.user_clicks_button(page, "muteren") | ||
await self.when.user_clicks_button(page, "Opnieuw indienen") | ||
await self.when.user_fills_form_field(page, "Opmerking", "Datum aangepast") | ||
await self.when.user_clicks_button(page, "Opnieuw indienen") | ||
await self.then.path_should_be(page, "/destruction-lists") |
93 changes: 93 additions & 0 deletions
93
backend/src/openarchiefbeheer/destruction/tests/e2e/features/test_feature_list_review.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
# fmt: off | ||
from django.test import tag | ||
|
||
from openarchiefbeheer.destruction.constants import ( | ||
ListRole, | ||
ListStatus, | ||
ReviewDecisionChoices, | ||
) | ||
from openarchiefbeheer.utils.tests.e2e import browser_page | ||
from openarchiefbeheer.utils.tests.gherkin import GherkinLikeTestCase | ||
|
||
|
||
@tag("e2e") | ||
class FeatureListCreateTests(GherkinLikeTestCase): | ||
async def test_scenario_reviewer_approves_list(self): | ||
async with browser_page() as page: | ||
record_manager = await self.given.record_manager_exists() | ||
reviewer1 = await self.given.reviewer_exists(username="peer_reviewer", first_name="Peer", last_name="Reviewer") | ||
reviewer2 = await self.given.reviewer_exists() | ||
archivist = await self.given.archivist_exists() | ||
|
||
assignees = [ | ||
await self.given.assignee_exists(user=record_manager, role=ListRole.author), | ||
await self.given.assignee_exists(user=reviewer1, role=ListRole.reviewer), | ||
await self.given.assignee_exists(user=reviewer2, role=ListRole.reviewer), | ||
await self.given.assignee_exists(user=archivist, role=ListRole.archivist), | ||
] | ||
|
||
list = await self.given.list_exists( | ||
assignee=reviewer2, | ||
assignees=assignees, | ||
uuid="00000000-0000-0000-0000-000000000000", | ||
name="Destruction list to review", | ||
status=ListStatus.ready_to_review, | ||
) | ||
|
||
# Reviewer 1 already provided a review. | ||
await self.given.review_exists(author=reviewer1, destruction_list=list, decision=ReviewDecisionChoices.accepted) | ||
|
||
await self.when.reviewer_logs_in(page) | ||
await self.then.path_should_be(page, "/destruction-lists") | ||
|
||
await self.when.user_clicks_button(page, "Destruction list to review") | ||
await self.then.path_should_be(page, "/destruction-lists/00000000-0000-0000-0000-000000000000/review") | ||
|
||
await self.when.user_clicks_button(page, "Accorderen") | ||
await self.when.user_fills_form_field(page, "Opmerking", "Looks good to me👍🏻") | ||
await self.when.user_clicks_button(page, "Accorderen") | ||
|
||
await self.then.path_should_be(page, "/destruction-lists") | ||
await self.then.page_should_contain_text(page, "Destruction list to review") | ||
await self.then.list_should_have_status(page, list, ListStatus.internally_reviewed) | ||
|
||
async def test_scenario_reviewer_rejects_list(self): | ||
async with browser_page() as page: | ||
record_manager = await self.given.record_manager_exists() | ||
reviewer1 = await self.given.reviewer_exists(username="peer_reviewer", first_name="Peer", last_name="Reviewer") | ||
reviewer2 = await self.given.reviewer_exists() | ||
archivist = await self.given.archivist_exists() | ||
|
||
assignees = [ | ||
await self.given.assignee_exists(user=record_manager, role=ListRole.author), | ||
await self.given.assignee_exists(user=reviewer1, role=ListRole.reviewer), | ||
await self.given.assignee_exists(user=reviewer2, role=ListRole.reviewer), | ||
await self.given.assignee_exists(user=archivist, role=ListRole.archivist), | ||
] | ||
|
||
list = await self.given.list_exists( | ||
assignee=reviewer2, | ||
assignees=assignees, | ||
uuid="00000000-0000-0000-0000-000000000000", | ||
name="Destruction list to review", | ||
status=ListStatus.ready_to_review, | ||
) | ||
|
||
# Reviewer 1 already provided a review. | ||
await self.given.review_exists(author=reviewer1, destruction_list=list, decision=ReviewDecisionChoices.accepted) | ||
|
||
await self.when.reviewer_logs_in(page) | ||
await self.then.path_should_be(page, "/destruction-lists") | ||
|
||
await self.when.user_clicks_button(page, "Destruction list to review") | ||
await self.then.path_should_be(page, "/destruction-lists/00000000-0000-0000-0000-000000000000/review") | ||
await self.when.user_clicks_checkbox(page, "(de)selecteer rij") | ||
await self.when.user_fills_form_field(page, "Reden van uitzondering", "Please reconsider this zaak") | ||
await self.when.user_clicks_button(page, "Uitzonderen") | ||
await self.when.user_clicks_button(page, "Beoordelen") | ||
await self.when.user_fills_form_field(page, "Opmerking", "Please reconsider the zaak on this list") | ||
await self.when.user_clicks_button(page, "Beoordelen") | ||
|
||
await self.then.path_should_be(page, "/destruction-lists") | ||
await self.then.page_should_contain_text(page, "Destruction list to review") | ||
await self.then.list_should_have_status(page, list, ListStatus.changes_requested) |
Oops, something went wrong.