From 6f2be1764f4fb3baccc4d8c6146eadc51fefe11b Mon Sep 17 00:00:00 2001 From: Stanislav Pankevich Date: Thu, 6 Jun 2024 21:20:50 +0200 Subject: [PATCH] UI: Create node: parse, validate, and render LINK/ANCHOR Now with validations. Related to: #1839 --- strictdoc/core/traceability_index_builder.py | 12 +++- .../core/transforms/create_requirement.py | 23 ++++++- strictdoc/core/transforms/validation_error.py | 7 +- strictdoc/helpers/string.py | 4 +- strictdoc/server/routers/main_router.py | 21 +++--- .../expected_output/document.sdoc | 0 .../input/document.sdoc | 0 ...nt_create_anchor_already_exists_in_tree.py | 0 .../expected_output/document.sdoc | 0 .../input/document.sdoc | 0 .../test_case.py | 0 .../expected_output/document.sdoc | 0 .../input/document.sdoc | 0 .../test_document_create_duplicated_anchor.py | 0 .../expected_output/document.sdoc | 11 ++++ .../input/document.sdoc | 11 ++++ .../test_case.py | 48 ++++++++++++++ .../expected_output/document.sdoc | 0 .../input/document.sdoc | 0 .../test_case.py | 52 +++++++++++++++ .../expected_output}/document.sdoc | 0 .../input/document.sdoc | 11 ++++ .../test_case.py | 48 ++++++++++++++ .../expected_output/document.sdoc | 0 .../input/document.sdoc | 0 .../test_case.py | 55 ++++++++++++++++ .../expected_output/document.sdoc | 20 ++++++ .../input/document.sdoc | 0 .../create_node_with_ANCHOR/test_case.py | 66 +++++++++++++++++++ .../expected_output/document.sdoc | 0 .../create_node_with_LINK/input/document.sdoc | 11 ++++ .../create_node_with_LINK/test_case.py | 0 .../expected_output/document.sdoc | 0 .../input/document.sdoc | 0 .../test_case.py | 0 .../expected_output/document.sdoc | 0 .../input/document.sdoc | 0 .../test_case.py | 0 .../expected_output/document.sdoc | 0 .../input/document.sdoc | 0 .../test_case.py | 0 .../expected_output/document.sdoc | 0 .../input/document.sdoc | 6 ++ .../test_case.py | 0 .../expected_output/document.sdoc | 0 .../input/document.sdoc | 0 ..._in_section_and_link_in_another_section.py | 0 .../expected_output/document.sdoc | 6 ++ .../input/document.sdoc | 6 ++ .../test_case.py | 0 .../expected_output/document.sdoc | 6 ++ .../input/document.sdoc | 6 ++ .../test_case.py | 0 53 files changed, 411 insertions(+), 19 deletions(-) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/{document_create_anchor_already_exists_in_tree => DEPRECATED_document_create_anchor_already_exists_in_tree}/expected_output/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/{document_create_anchor_already_exists_in_tree => DEPRECATED_document_create_anchor_already_exists_in_tree}/input/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/{document_create_anchor_already_exists_in_tree => DEPRECATED_document_create_anchor_already_exists_in_tree}/test_document_create_anchor_already_exists_in_tree.py (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/{document_create_anchor_broken_rst => DEPRECATED_document_create_anchor_broken_rst}/expected_output/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/{document_create_anchor_broken_rst => DEPRECATED_document_create_anchor_broken_rst}/input/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/{document_create_anchor_broken_rst => DEPRECATED_document_create_anchor_broken_rst}/test_case.py (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/{document_create_duplicated_anchor => DEPRECATED_document_create_duplicated_anchor}/expected_output/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/{document_create_duplicated_anchor => DEPRECATED_document_create_duplicated_anchor}/input/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/{document_create_duplicated_anchor => DEPRECATED_document_create_duplicated_anchor}/test_document_create_duplicated_anchor.py (100%) create mode 100644 tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_already_exists/expected_output/document.sdoc create mode 100644 tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_already_exists/input/document.sdoc create mode 100644 tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_already_exists/test_case.py rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/{section/_validations_section/create_section_must_not_add_anchor_broken_rst => node/_create/_validations/create_node_must_validate_ANCHOR_with_broken_rst}/expected_output/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/{section/_validations_section/create_section_must_not_add_anchor_broken_rst => node/_create/_validations/create_node_must_validate_ANCHOR_with_broken_rst}/input/document.sdoc (100%) create mode 100644 tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_with_broken_rst/test_case.py rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/{create_node_with_LINK/input => _create/_validations/create_node_must_validate_LINK_does_not_exist/expected_output}/document.sdoc (100%) create mode 100644 tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_LINK_does_not_exist/input/document.sdoc create mode 100644 tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_LINK_does_not_exist/test_case.py rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/{section/_validations_section/create_section_must_not_add_link_to_nonexisting_node => node/_create/_validations/create_node_must_validate_duplicate_ANCHOR}/expected_output/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/{section/_validations_section/create_section_must_not_add_link_to_nonexisting_node => node/_create/_validations/create_node_must_validate_duplicate_ANCHOR}/input/document.sdoc (100%) create mode 100644 tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_duplicate_ANCHOR/test_case.py create mode 100644 tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_ANCHOR/expected_output/document.sdoc rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/{section/create_section_with_anchor_and_section_with_link => node/_create/create_node_with_ANCHOR}/input/document.sdoc (100%) create mode 100644 tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_ANCHOR/test_case.py rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/{ => _create}/create_node_with_LINK/expected_output/document.sdoc (100%) create mode 100644 tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_LINK/input/document.sdoc rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/{ => _create}/create_node_with_LINK/test_case.py (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/{ => _remove}/_validations/remove_node_that_has_incoming_links/expected_output/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/{ => _remove}/_validations/remove_node_that_has_incoming_links/input/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/{ => _remove}/_validations/remove_node_that_has_incoming_links/test_case.py (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/{ => _remove}/_validations/remove_section_that_has_incoming_links/expected_output/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/{ => _remove}/_validations/remove_section_that_has_incoming_links/input/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/{ => _remove}/_validations/remove_section_that_has_incoming_links/test_case.py (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/{create_section_with_anchor_and_section_with_link => DEPRECATED_create_section_with_anchor_and_section_with_link}/expected_output/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/{create_section_with_uid_and_section_with_link => DEPRECATED_create_section_with_anchor_and_section_with_link}/input/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/{create_section_with_anchor_and_section_with_link => DEPRECATED_create_section_with_anchor_and_section_with_link}/test_case.py (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/{create_section_with_uid_and_section_with_link => DEPRECATED_create_section_with_uid_and_section_with_link}/expected_output/document.sdoc (100%) create mode 100644 tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_create_section_with_uid_and_section_with_link/input/document.sdoc rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/{create_section_with_uid_and_section_with_link => DEPRECATED_create_section_with_uid_and_section_with_link}/test_case.py (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/{update_section_add_anchor_in_section_and_link_in_another_section => DEPRECATED_update_section_add_anchor_in_section_and_link_in_another_section}/expected_output/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/{update_section_add_anchor_in_section_and_link_in_another_section => DEPRECATED_update_section_add_anchor_in_section_and_link_in_another_section}/input/document.sdoc (100%) rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/{update_section_add_anchor_in_section_and_link_in_another_section => DEPRECATED_update_section_add_anchor_in_section_and_link_in_another_section}/test_update_section_add_anchor_in_section_and_link_in_another_section.py (100%) create mode 100644 tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_anchor_broken_rst/expected_output/document.sdoc create mode 100644 tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_anchor_broken_rst/input/document.sdoc rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/{create_section_must_not_add_anchor_broken_rst => DEPRECATED_create_section_must_not_add_anchor_broken_rst}/test_case.py (100%) create mode 100644 tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc create mode 100644 tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_link_to_nonexisting_node/input/document.sdoc rename tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/{create_section_must_not_add_link_to_nonexisting_node => DEPRECATED_create_section_must_not_add_link_to_nonexisting_node}/test_case.py (100%) diff --git a/strictdoc/core/traceability_index_builder.py b/strictdoc/core/traceability_index_builder.py index 6cd484372..32778a36a 100644 --- a/strictdoc/core/traceability_index_builder.py +++ b/strictdoc/core/traceability_index_builder.py @@ -544,7 +544,17 @@ def create_from_document_tree( f"{part.link}." ) traceability_index.create_inline_link(part) - + elif isinstance(part, Anchor): + graph_database.create_link( + link_type=GraphLinkType.MID_TO_NODE, + lhs_node=part.mid, + rhs_node=part, + ) + graph_database.create_link( + link_type=GraphLinkType.UID_TO_NODE, + lhs_node=part.value, + rhs_node=part, + ) if requirement.reserved_uid is None: continue diff --git a/strictdoc/core/transforms/create_requirement.py b/strictdoc/core/transforms/create_requirement.py index 2d6444161..2a2e617ce 100644 --- a/strictdoc/core/transforms/create_requirement.py +++ b/strictdoc/core/transforms/create_requirement.py @@ -154,7 +154,10 @@ def perform(self): get_textx_syntax_error_message(exception) ) if len(errors) > 0: - raise validation_error + for field_name_, field_errors_ in validation_error.errors.items(): + for field_error_ in field_errors_: + form_object.add_error(field_name_, field_error_) + return if whereto == NodeCreationOrder.CHILD: parent = reference_node @@ -225,12 +228,16 @@ def perform(self): if free_text_content is not None else None ) - requirement.set_field_value( field_name=form_field_name, form_field_index=form_field_index, value=requirement_field, ) + if free_text_content is not None: + for part_ in requirement_field.parts: + if isinstance(part_, str): + continue + part_.parent = requirement_field requirement.reserved_mid = MID(form_object.requirement_mid) if document.config.enable_mid: @@ -263,4 +270,16 @@ def perform(self): # FIXME pass + for free_text_container_ in map_form_to_requirement_fields.values(): + if free_text_container_ is None: + continue + for part in free_text_container_.parts: + if isinstance(part, Anchor): + # Since this is a new section, we just need to register the + # new anchor. By this time, we know that there is no + # existing anchor with this name. + traceability_index.update_with_anchor(part) + elif isinstance(part, InlineLink): + traceability_index.create_inline_link(part) + traceability_index.update_last_updated() diff --git a/strictdoc/core/transforms/validation_error.py b/strictdoc/core/transforms/validation_error.py index 3e4f7d080..7ce049117 100644 --- a/strictdoc/core/transforms/validation_error.py +++ b/strictdoc/core/transforms/validation_error.py @@ -1,3 +1,4 @@ +from dataclasses import dataclass from typing import Dict, List @@ -12,7 +13,7 @@ def __init__(self, message: str, errors: List[str]): self.errors: List[str] = errors +@dataclass class MultipleValidationError(Exception): - def __init__(self, message: str, errors: Dict[str, List[str]]): - super().__init__(message) - self.errors: Dict[str, List[str]] = errors + message: str + errors: Dict[str, List[str]] diff --git a/strictdoc/helpers/string.py b/strictdoc/helpers/string.py index 6fc6d9eba..1bc2dca23 100644 --- a/strictdoc/helpers/string.py +++ b/strictdoc/helpers/string.py @@ -90,6 +90,4 @@ def create_safe_document_file_name(string) -> str: def ensure_newline(text: str) -> str: - if not text.endswith("\n"): - text += "\n" - return text + return text.rstrip() + "\n" diff --git a/strictdoc/server/routers/main_router.py b/strictdoc/server/routers/main_router.py index 38d015bb3..e7e2bc6fe 100644 --- a/strictdoc/server/routers/main_router.py +++ b/strictdoc/server/routers/main_router.py @@ -885,6 +885,17 @@ async def create_requirement(request: Request): config=project_config, ) + if not form_object.any_errors(): + command = CreateRequirementTransform( + form_object=form_object, + project_config=project_config, + whereto=whereto, + requirement_mid=requirement_mid, + reference_mid=reference_mid, + traceability_index=export_action.traceability_index, + ) + command.perform() + if form_object.any_errors(): template = env().get_template( "actions/" @@ -924,16 +935,6 @@ async def create_requirement(request: Request): }, ) - transform = CreateRequirementTransform( - form_object=form_object, - project_config=project_config, - whereto=whereto, - requirement_mid=requirement_mid, - reference_mid=reference_mid, - traceability_index=export_action.traceability_index, - ) - transform.perform() - # Saving new content to .SDoc files. SDWriter().write_to_file(document) if document != context_document: diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_anchor_already_exists_in_tree/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_anchor_already_exists_in_tree/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_anchor_already_exists_in_tree/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_anchor_already_exists_in_tree/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_anchor_already_exists_in_tree/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_anchor_already_exists_in_tree/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_anchor_already_exists_in_tree/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_anchor_already_exists_in_tree/input/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_anchor_already_exists_in_tree/test_document_create_anchor_already_exists_in_tree.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_anchor_already_exists_in_tree/test_document_create_anchor_already_exists_in_tree.py similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_anchor_already_exists_in_tree/test_document_create_anchor_already_exists_in_tree.py rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_anchor_already_exists_in_tree/test_document_create_anchor_already_exists_in_tree.py diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_anchor_broken_rst/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_anchor_broken_rst/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_anchor_broken_rst/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_anchor_broken_rst/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_anchor_broken_rst/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_anchor_broken_rst/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_anchor_broken_rst/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_anchor_broken_rst/input/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_anchor_broken_rst/test_case.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_anchor_broken_rst/test_case.py similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_anchor_broken_rst/test_case.py rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_anchor_broken_rst/test_case.py diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_duplicated_anchor/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_duplicated_anchor/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_duplicated_anchor/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_duplicated_anchor/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_duplicated_anchor/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_duplicated_anchor/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_duplicated_anchor/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_duplicated_anchor/input/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_duplicated_anchor/test_document_create_duplicated_anchor.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_duplicated_anchor/test_document_create_duplicated_anchor.py similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/document_create_duplicated_anchor/test_document_create_duplicated_anchor.py rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/document/_validations_document/DEPRECATED_document_create_duplicated_anchor/test_document_create_duplicated_anchor.py diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_already_exists/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_already_exists/expected_output/document.sdoc new file mode 100644 index 000000000..eb6ab8cb8 --- /dev/null +++ b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_already_exists/expected_output/document.sdoc @@ -0,0 +1,11 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] + +[REQUIREMENT] +STATEMENT: >>> +[ANCHOR: AD1] +<<< diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_already_exists/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_already_exists/input/document.sdoc new file mode 100644 index 000000000..eb6ab8cb8 --- /dev/null +++ b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_already_exists/input/document.sdoc @@ -0,0 +1,11 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] + +[REQUIREMENT] +STATEMENT: >>> +[ANCHOR: AD1] +<<< diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_already_exists/test_case.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_already_exists/test_case.py new file mode 100644 index 000000000..d5076d192 --- /dev/null +++ b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_already_exists/test_case.py @@ -0,0 +1,48 @@ +from tests.end2end.e2e_case import E2ECase +from tests.end2end.end2end_test_setup import End2EndTestSetup +from tests.end2end.helpers.screens.document.form_edit_requirement import ( + Form_EditRequirement, +) +from tests.end2end.helpers.screens.project_index.screen_project_index import ( + Screen_ProjectIndex, +) +from tests.end2end.server import SDocTestServer + + +class Test(E2ECase): + def test(self): + test_setup = End2EndTestSetup(path_to_test_file=__file__) + + with SDocTestServer( + input_path=test_setup.path_to_sandbox + ) as test_server: + self.open(test_server.get_host_and_port()) + + screen_project_index = Screen_ProjectIndex(self) + + screen_project_index.assert_on_screen() + screen_project_index.assert_contains_document("Document 1") + + screen_document = screen_project_index.do_click_on_first_document() + + screen_document.assert_on_screen_document() + screen_document.assert_header_document_title("Document 1") + + screen_document.assert_text("Hello world!") + + # Requirement 1 + requirement1_node = screen_document.get_node(1) + root_node_menu = requirement1_node.do_open_node_menu() + form_edit_requirement: Form_EditRequirement = ( + root_node_menu.do_node_add_requirement_below() + ) + form_edit_requirement.do_fill_in_field_statement( + """ +[ANCHOR: AD1] +""" + ) + form_edit_requirement.do_form_submit_and_catch_error( + "A node contains an anchor that already exists: AD1." + ) + + assert test_setup.compare_sandbox_and_expected_output() diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/create_section_must_not_add_anchor_broken_rst/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_with_broken_rst/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/create_section_must_not_add_anchor_broken_rst/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_with_broken_rst/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/create_section_must_not_add_anchor_broken_rst/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_with_broken_rst/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/create_section_must_not_add_anchor_broken_rst/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_with_broken_rst/input/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_with_broken_rst/test_case.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_with_broken_rst/test_case.py new file mode 100644 index 000000000..f28d17b7d --- /dev/null +++ b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_ANCHOR_with_broken_rst/test_case.py @@ -0,0 +1,52 @@ +from tests.end2end.e2e_case import E2ECase +from tests.end2end.end2end_test_setup import End2EndTestSetup +from tests.end2end.helpers.screens.document.form_edit_requirement import ( + Form_EditRequirement, +) +from tests.end2end.helpers.screens.project_index.screen_project_index import ( + Screen_ProjectIndex, +) +from tests.end2end.server import SDocTestServer + + +class Test(E2ECase): + def test(self): + test_setup = End2EndTestSetup(path_to_test_file=__file__) + + with SDocTestServer( + input_path=test_setup.path_to_sandbox + ) as test_server: + self.open(test_server.get_host_and_port()) + + screen_project_index = Screen_ProjectIndex(self) + + screen_project_index.assert_on_screen() + screen_project_index.assert_contains_document("Document 1") + + screen_document = screen_project_index.do_click_on_first_document() + + screen_document.assert_on_screen_document() + screen_document.assert_header_document_title("Document 1") + + screen_document.assert_text("Hello world!") + + # Requirement 1 + root_node = screen_document.get_root_node() + root_node_menu = root_node.do_open_node_menu() + form_edit_requirement: Form_EditRequirement = ( + root_node_menu.do_node_add_requirement_first() + ) + form_edit_requirement.do_fill_in_field_uid("REQ-1") + form_edit_requirement.do_fill_in_field_title("Req #1") + form_edit_requirement.do_fill_in_field_statement( + """\ +Modified statement. + +[ANCHOR: AD1]!!!GARBAGE!!! +""" + ) + form_edit_requirement.do_form_submit_and_catch_error( + "SDoc markup error: NCHOR: AD1*]!!!GARBAG." + ) + + assert test_setup.compare_sandbox_and_expected_output() diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/create_node_with_LINK/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_LINK_does_not_exist/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/create_node_with_LINK/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_LINK_does_not_exist/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_LINK_does_not_exist/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_LINK_does_not_exist/input/document.sdoc new file mode 100644 index 000000000..1ca55fdfb --- /dev/null +++ b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_LINK_does_not_exist/input/document.sdoc @@ -0,0 +1,11 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] + +[REQUIREMENT] +UID: REQ-1 +TITLE: Req #1 +STATEMENT: Req #1 statement. diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_LINK_does_not_exist/test_case.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_LINK_does_not_exist/test_case.py new file mode 100644 index 000000000..00967c5cf --- /dev/null +++ b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_LINK_does_not_exist/test_case.py @@ -0,0 +1,48 @@ +from tests.end2end.e2e_case import E2ECase +from tests.end2end.end2end_test_setup import End2EndTestSetup +from tests.end2end.helpers.screens.document.form_edit_requirement import ( + Form_EditRequirement, +) +from tests.end2end.helpers.screens.project_index.screen_project_index import ( + Screen_ProjectIndex, +) +from tests.end2end.server import SDocTestServer + + +class Test(E2ECase): + def test(self): + test_setup = End2EndTestSetup(path_to_test_file=__file__) + + with SDocTestServer( + input_path=test_setup.path_to_sandbox + ) as test_server: + self.open(test_server.get_host_and_port()) + + screen_project_index = Screen_ProjectIndex(self) + + screen_project_index.assert_on_screen() + screen_project_index.assert_contains_document("Document 1") + + screen_document = screen_project_index.do_click_on_first_document() + + screen_document.assert_on_screen_document() + screen_document.assert_header_document_title("Document 1") + + screen_document.assert_text("Hello world!") + + # Requirement 1 + root_node = screen_document.get_node(1) + root_node_menu = root_node.do_open_node_menu() + form_edit_requirement: Form_EditRequirement = ( + root_node_menu.do_node_add_requirement_below() + ) + form_edit_requirement.do_fill_in_field_uid("REQ-2") + form_edit_requirement.do_fill_in_field_title("Req #2") + form_edit_requirement.do_fill_in_field_statement( + "See [LINK: THIS-DOES-NOT-EXIST]." + ) + form_edit_requirement.do_form_submit_and_catch_error( + "A LINK points to a node that does not exist: 'THIS-DOES-NOT-EXIST'." + ) + + assert test_setup.compare_sandbox_and_expected_output() diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_duplicate_ANCHOR/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_duplicate_ANCHOR/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_duplicate_ANCHOR/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_duplicate_ANCHOR/input/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_duplicate_ANCHOR/test_case.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_duplicate_ANCHOR/test_case.py new file mode 100644 index 000000000..5924ec557 --- /dev/null +++ b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/_validations/create_node_must_validate_duplicate_ANCHOR/test_case.py @@ -0,0 +1,55 @@ +from tests.end2end.e2e_case import E2ECase +from tests.end2end.end2end_test_setup import End2EndTestSetup +from tests.end2end.helpers.screens.document.form_edit_requirement import ( + Form_EditRequirement, +) +from tests.end2end.helpers.screens.project_index.screen_project_index import ( + Screen_ProjectIndex, +) +from tests.end2end.server import SDocTestServer + + +class Test(E2ECase): + def test(self): + test_setup = End2EndTestSetup(path_to_test_file=__file__) + + with SDocTestServer( + input_path=test_setup.path_to_sandbox + ) as test_server: + self.open(test_server.get_host_and_port()) + + screen_project_index = Screen_ProjectIndex(self) + + screen_project_index.assert_on_screen() + screen_project_index.assert_contains_document("Document 1") + + screen_document = screen_project_index.do_click_on_first_document() + + screen_document.assert_on_screen_document() + screen_document.assert_header_document_title("Document 1") + + screen_document.assert_text("Hello world!") + + # Requirement 1 + root_node = screen_document.get_root_node() + root_node_menu = root_node.do_open_node_menu() + form_edit_requirement: Form_EditRequirement = ( + root_node_menu.do_node_add_requirement_first() + ) + form_edit_requirement.do_fill_in_field_uid("REQ-1") + form_edit_requirement.do_fill_in_field_title("Req #1") + form_edit_requirement.do_fill_in_field_statement( + "[ANCHOR: ANC-1, Anchor title]" + """ +Modified free text! + +[ANCHOR: AD1] + +[ANCHOR: AD1] +""" + ) + form_edit_requirement.do_form_submit_and_catch_error( + "A node cannot have two anchors with the same identifier: AD1." + ) + + assert test_setup.compare_sandbox_and_expected_output() diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_ANCHOR/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_ANCHOR/expected_output/document.sdoc new file mode 100644 index 000000000..bc278240f --- /dev/null +++ b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_ANCHOR/expected_output/document.sdoc @@ -0,0 +1,20 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] + +[REQUIREMENT] +UID: REQ-1 +TITLE: Req #1 +STATEMENT: >>> +[ANCHOR: ANC-1, Anchor title] +<<< + +[REQUIREMENT] +UID: REQ-2 +TITLE: Req #2 +STATEMENT: >>> +See [LINK: ANC-1]. +<<< diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/create_section_with_anchor_and_section_with_link/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_ANCHOR/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/create_section_with_anchor_and_section_with_link/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_ANCHOR/input/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_ANCHOR/test_case.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_ANCHOR/test_case.py new file mode 100644 index 000000000..807a49561 --- /dev/null +++ b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_ANCHOR/test_case.py @@ -0,0 +1,66 @@ +from tests.end2end.e2e_case import E2ECase +from tests.end2end.end2end_test_setup import End2EndTestSetup +from tests.end2end.helpers.screens.document.form_edit_requirement import ( + Form_EditRequirement, +) +from tests.end2end.helpers.screens.project_index.screen_project_index import ( + Screen_ProjectIndex, +) +from tests.end2end.server import SDocTestServer + + +class Test(E2ECase): + def test(self): + test_setup = End2EndTestSetup(path_to_test_file=__file__) + + with SDocTestServer( + input_path=test_setup.path_to_sandbox + ) as test_server: + self.open(test_server.get_host_and_port()) + + screen_project_index = Screen_ProjectIndex(self) + + screen_project_index.assert_on_screen() + screen_project_index.assert_contains_document("Document 1") + + screen_document = screen_project_index.do_click_on_first_document() + + screen_document.assert_on_screen_document() + screen_document.assert_header_document_title("Document 1") + + screen_document.assert_text("Hello world!") + + # Requirement 1 + root_node = screen_document.get_root_node() + root_node_menu = root_node.do_open_node_menu() + form_edit_requirement: Form_EditRequirement = ( + root_node_menu.do_node_add_requirement_first() + ) + form_edit_requirement.do_fill_in_field_uid("REQ-1") + form_edit_requirement.do_fill_in_field_title("Req #1") + form_edit_requirement.do_fill_in_field_statement( + "[ANCHOR: ANC-1, Anchor title]" + ) + form_edit_requirement.do_form_submit() + + # Requirement 2 + root_node = screen_document.get_node(1) + root_node_menu = root_node.do_open_node_menu() + form_edit_requirement: Form_EditRequirement = ( + root_node_menu.do_node_add_requirement_below() + ) + form_edit_requirement.do_fill_in_field_uid("REQ-2") + form_edit_requirement.do_fill_in_field_title("Req #2") + form_edit_requirement.do_fill_in_field_statement( + "See [LINK: ANC-1]." + ) + form_edit_requirement.do_form_submit() + + # Expected for Requirement 1: + + requirement_2 = screen_document.get_node(2) + requirement_2.assert_requirement_statement_contains( + "See đŸ”—Â Anchor title" + ) + + assert test_setup.compare_sandbox_and_expected_output() diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/create_node_with_LINK/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_LINK/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/create_node_with_LINK/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_LINK/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_LINK/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_LINK/input/document.sdoc new file mode 100644 index 000000000..1ca55fdfb --- /dev/null +++ b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_LINK/input/document.sdoc @@ -0,0 +1,11 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] + +[REQUIREMENT] +UID: REQ-1 +TITLE: Req #1 +STATEMENT: Req #1 statement. diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/create_node_with_LINK/test_case.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_LINK/test_case.py similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/create_node_with_LINK/test_case.py rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_create/create_node_with_LINK/test_case.py diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_validations/remove_node_that_has_incoming_links/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_remove/_validations/remove_node_that_has_incoming_links/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_validations/remove_node_that_has_incoming_links/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_remove/_validations/remove_node_that_has_incoming_links/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_validations/remove_node_that_has_incoming_links/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_remove/_validations/remove_node_that_has_incoming_links/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_validations/remove_node_that_has_incoming_links/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_remove/_validations/remove_node_that_has_incoming_links/input/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_validations/remove_node_that_has_incoming_links/test_case.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_remove/_validations/remove_node_that_has_incoming_links/test_case.py similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_validations/remove_node_that_has_incoming_links/test_case.py rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_remove/_validations/remove_node_that_has_incoming_links/test_case.py diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_validations/remove_section_that_has_incoming_links/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_remove/_validations/remove_section_that_has_incoming_links/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_validations/remove_section_that_has_incoming_links/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_remove/_validations/remove_section_that_has_incoming_links/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_validations/remove_section_that_has_incoming_links/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_remove/_validations/remove_section_that_has_incoming_links/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_validations/remove_section_that_has_incoming_links/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_remove/_validations/remove_section_that_has_incoming_links/input/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_validations/remove_section_that_has_incoming_links/test_case.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_remove/_validations/remove_section_that_has_incoming_links/test_case.py similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_validations/remove_section_that_has_incoming_links/test_case.py rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/node/_remove/_validations/remove_section_that_has_incoming_links/test_case.py diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/create_section_with_anchor_and_section_with_link/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_create_section_with_anchor_and_section_with_link/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/create_section_with_anchor_and_section_with_link/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_create_section_with_anchor_and_section_with_link/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/create_section_with_uid_and_section_with_link/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_create_section_with_anchor_and_section_with_link/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/create_section_with_uid_and_section_with_link/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_create_section_with_anchor_and_section_with_link/input/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/create_section_with_anchor_and_section_with_link/test_case.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_create_section_with_anchor_and_section_with_link/test_case.py similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/create_section_with_anchor_and_section_with_link/test_case.py rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_create_section_with_anchor_and_section_with_link/test_case.py diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/create_section_with_uid_and_section_with_link/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_create_section_with_uid_and_section_with_link/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/create_section_with_uid_and_section_with_link/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_create_section_with_uid_and_section_with_link/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_create_section_with_uid_and_section_with_link/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_create_section_with_uid_and_section_with_link/input/document.sdoc new file mode 100644 index 000000000..a83764ac3 --- /dev/null +++ b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_create_section_with_uid_and_section_with_link/input/document.sdoc @@ -0,0 +1,6 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/create_section_with_uid_and_section_with_link/test_case.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_create_section_with_uid_and_section_with_link/test_case.py similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/create_section_with_uid_and_section_with_link/test_case.py rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_create_section_with_uid_and_section_with_link/test_case.py diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/update_section_add_anchor_in_section_and_link_in_another_section/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_update_section_add_anchor_in_section_and_link_in_another_section/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/update_section_add_anchor_in_section_and_link_in_another_section/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_update_section_add_anchor_in_section_and_link_in_another_section/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/update_section_add_anchor_in_section_and_link_in_another_section/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_update_section_add_anchor_in_section_and_link_in_another_section/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/update_section_add_anchor_in_section_and_link_in_another_section/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_update_section_add_anchor_in_section_and_link_in_another_section/input/document.sdoc diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/update_section_add_anchor_in_section_and_link_in_another_section/test_update_section_add_anchor_in_section_and_link_in_another_section.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_update_section_add_anchor_in_section_and_link_in_another_section/test_update_section_add_anchor_in_section_and_link_in_another_section.py similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/update_section_add_anchor_in_section_and_link_in_another_section/test_update_section_add_anchor_in_section_and_link_in_another_section.py rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/DEPRECATED_update_section_add_anchor_in_section_and_link_in_another_section/test_update_section_add_anchor_in_section_and_link_in_another_section.py diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_anchor_broken_rst/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_anchor_broken_rst/expected_output/document.sdoc new file mode 100644 index 000000000..a83764ac3 --- /dev/null +++ b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_anchor_broken_rst/expected_output/document.sdoc @@ -0,0 +1,6 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_anchor_broken_rst/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_anchor_broken_rst/input/document.sdoc new file mode 100644 index 000000000..a83764ac3 --- /dev/null +++ b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_anchor_broken_rst/input/document.sdoc @@ -0,0 +1,6 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/create_section_must_not_add_anchor_broken_rst/test_case.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_anchor_broken_rst/test_case.py similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/create_section_must_not_add_anchor_broken_rst/test_case.py rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_anchor_broken_rst/test_case.py diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc new file mode 100644 index 000000000..a83764ac3 --- /dev/null +++ b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc @@ -0,0 +1,6 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_link_to_nonexisting_node/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_link_to_nonexisting_node/input/document.sdoc new file mode 100644 index 000000000..a83764ac3 --- /dev/null +++ b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_link_to_nonexisting_node/input/document.sdoc @@ -0,0 +1,6 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] diff --git a/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/test_case.py b/tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_link_to_nonexisting_node/test_case.py similarity index 100% rename from tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/test_case.py rename to tests/end2end/screens/document/_cross_cutting/LINK_and_ANCHOR/section/_validations_section/DEPRECATED_create_section_must_not_add_link_to_nonexisting_node/test_case.py