diff --git a/strictdoc/__init__.py b/strictdoc/__init__.py index 7789cdbe1..12850c72b 100644 --- a/strictdoc/__init__.py +++ b/strictdoc/__init__.py @@ -1,6 +1,6 @@ from strictdoc.core.environment import SDocRuntimeEnvironment -__version__ = "0.0.44a6" +__version__ = "0.0.44a7" environment = SDocRuntimeEnvironment(__file__) diff --git a/strictdoc/core/traceability_index.py b/strictdoc/core/traceability_index.py index edc9370fc..ef3e216db 100644 --- a/strictdoc/core/traceability_index.py +++ b/strictdoc/core/traceability_index.py @@ -216,6 +216,25 @@ def get_coverage_info( def get_node_by_uid(self, uid): return self._requirements_parents[uid].requirement + def find_node_by_uid_weak( + self, uid + ) -> Union[Document, Section, Requirement, None]: + for document in self.document_tree.document_list: + document_iterator = DocumentCachingIterator(document) + for node in document_iterator.all_content(): + if isinstance(node, Document): + if node.config.uid == uid: + return node + elif isinstance(node, Section): + if node.reserved_uid == uid: + return node + elif isinstance(node, Requirement): + if node.reserved_uid == uid: + return node + else: + raise NotImplementedError + return None + def get_section_by_uid_weak(self, uid): if uid not in self._requirements_parents: return None @@ -555,27 +574,10 @@ def validate_can_create_uid(self, uid: str): existing_node_with_uid: Union[ Document, Section, Requirement, None - ] = None + ] = self.find_node_by_uid_weak(uid) - for document in self.document_tree.document_list: - document_iterator = DocumentCachingIterator(document) - for node in document_iterator.all_content(): - if isinstance(node, Document): - if node.config.uid == uid: - existing_node_with_uid = node - break - elif isinstance(node, Section): - if node.reserved_uid == uid: - existing_node_with_uid = node - break - elif isinstance(node, Requirement): - if node.reserved_uid == uid: - existing_node_with_uid = node - break - else: - raise NotImplementedError - else: - return + if existing_node_with_uid is None: + return raise SingleValidationError( "UID uniqueness validation error: " diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_anchor_already_exists_in_tree/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_anchor_already_exists_in_tree/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_anchor_already_exists_in_tree/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_anchor_already_exists_in_tree/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_anchor_already_exists_in_tree/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_anchor_already_exists_in_tree/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_anchor_already_exists_in_tree/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_anchor_already_exists_in_tree/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/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/anchors/document/_validations_document/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/anchors/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/anchors/document/_validations_document/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/anchors/document/_validations_document/document_create_anchor_broken_rst/__init__.py b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_anchor_broken_rst/__init__.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_anchor_broken_rst/__init__.py rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_anchor_broken_rst/__init__.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_anchor_broken_rst/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_anchor_broken_rst/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_anchor_broken_rst/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_anchor_broken_rst/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_anchor_broken_rst/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_anchor_broken_rst/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_anchor_broken_rst/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_anchor_broken_rst/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_anchor_broken_rst/test_case.py b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_anchor_broken_rst/test_case.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_anchor_broken_rst/test_case.py rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_anchor_broken_rst/test_case.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_duplicated_anchor/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_duplicated_anchor/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_duplicated_anchor/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_duplicated_anchor/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_duplicated_anchor/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_duplicated_anchor/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_duplicated_anchor/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_duplicated_anchor/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_duplicated_anchor/test_document_create_duplicated_anchor.py b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_duplicated_anchor/test_document_create_duplicated_anchor.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_create_duplicated_anchor/test_document_create_duplicated_anchor.py rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_create_duplicated_anchor/test_document_create_duplicated_anchor.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_anchor_that_has_incoming_links/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_anchor_that_has_incoming_links/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_anchor_that_has_incoming_links/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_anchor_that_has_incoming_links/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_anchor_that_has_incoming_links/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_anchor_that_has_incoming_links/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_anchor_that_has_incoming_links/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_anchor_that_has_incoming_links/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_anchor_that_has_incoming_links/test_document_remove_anchor_that_has_incoming_links.py b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_anchor_that_has_incoming_links/test_document_remove_anchor_that_has_incoming_links.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_anchor_that_has_incoming_links/test_document_remove_anchor_that_has_incoming_links.py rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_anchor_that_has_incoming_links/test_document_remove_anchor_that_has_incoming_links.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_free_text_with_anchor_that_has_incoming_links/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_free_text_with_anchor_that_has_incoming_links/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_free_text_with_anchor_that_has_incoming_links/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_free_text_with_anchor_that_has_incoming_links/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_free_text_with_anchor_that_has_incoming_links/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_free_text_with_anchor_that_has_incoming_links/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_free_text_with_anchor_that_has_incoming_links/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_free_text_with_anchor_that_has_incoming_links/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_free_text_with_anchor_that_has_incoming_links/test_document_remove_free_text_with_anchor_that_has_incoming_links.py b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_free_text_with_anchor_that_has_incoming_links/test_document_remove_free_text_with_anchor_that_has_incoming_links.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_free_text_with_anchor_that_has_incoming_links/test_document_remove_free_text_with_anchor_that_has_incoming_links.py rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_free_text_with_anchor_that_has_incoming_links/test_document_remove_free_text_with_anchor_that_has_incoming_links.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_section_that_has_incoming_links/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_section_that_has_incoming_links/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_section_that_has_incoming_links/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_section_that_has_incoming_links/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_section_that_has_incoming_links/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_section_that_has_incoming_links/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_section_that_has_incoming_links/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_section_that_has_incoming_links/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_section_that_has_incoming_links/test_document_remove_section_that_has_incoming_links.py b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_section_that_has_incoming_links/test_document_remove_section_that_has_incoming_links.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/document_remove_section_that_has_incoming_links/test_document_remove_section_that_has_incoming_links.py rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/document_remove_section_that_has_incoming_links/test_document_remove_section_that_has_incoming_links.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/update_document_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/update_document_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/update_document_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/update_document_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/update_document_must_not_add_link_to_nonexisting_node/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/update_document_must_not_add_link_to_nonexisting_node/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/update_document_must_not_add_link_to_nonexisting_node/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/update_document_must_not_add_link_to_nonexisting_node/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/update_document_must_not_add_link_to_nonexisting_node/test_update_document_must_not_add_link_to_nonexisting_node.py b/tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/update_document_must_not_add_link_to_nonexisting_node/test_update_document_must_not_add_link_to_nonexisting_node.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/_validations_document/update_document_must_not_add_link_to_nonexisting_node/test_update_document_must_not_add_link_to_nonexisting_node.py rename to tests/end2end/screens/document/_cross_cutting/anchors/document/_validations_document/update_document_must_not_add_link_to_nonexisting_node/test_update_document_must_not_add_link_to_nonexisting_node.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_anchor_and_create_section_with_link/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_anchor_and_create_section_with_link/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_anchor_and_create_section_with_link/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_anchor_and_create_section_with_link/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_anchor_and_create_section_with_link/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_anchor_and_create_section_with_link/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_anchor_and_create_section_with_link/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_anchor_and_create_section_with_link/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_anchor_and_create_section_with_link/test_update_document_add_anchor_and_create_section_with_link.py b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_anchor_and_create_section_with_link/test_update_document_add_anchor_and_create_section_with_link.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_anchor_and_create_section_with_link/test_update_document_add_anchor_and_create_section_with_link.py rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_anchor_and_create_section_with_link/test_update_document_add_anchor_and_create_section_with_link.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/__init__.py b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/__init__.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/__init__.py rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/__init__.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/test_case.py b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/test_case.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/test_case.py rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_anchor_and_replace_existing/test_case.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_second_anchor/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_second_anchor/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_second_anchor/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_second_anchor/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_second_anchor/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_second_anchor/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_second_anchor/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_second_anchor/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_second_anchor/test_update_document_add_second_anchor.py b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_second_anchor/test_update_document_add_second_anchor.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_add_second_anchor/test_update_document_add_second_anchor.py rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_add_second_anchor/test_update_document_add_second_anchor.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_update_free_text_with_same_link/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_update_free_text_with_same_link/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_update_free_text_with_same_link/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_update_free_text_with_same_link/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_update_free_text_with_same_link/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_update_free_text_with_same_link/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_update_free_text_with_same_link/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_update_free_text_with_same_link/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_update_free_text_with_same_link/test_update_document_update_free_text_with_same_link.py b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_update_free_text_with_same_link/test_update_document_update_free_text_with_same_link.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_update_free_text_with_same_link/test_update_document_update_free_text_with_same_link.py rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_update_free_text_with_same_link/test_update_document_update_free_text_with_same_link.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_with_same_anchor/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_with_same_anchor/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_with_same_anchor/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_with_same_anchor/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_with_same_anchor/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_with_same_anchor/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_with_same_anchor/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_with_same_anchor/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/document/update_document_with_same_anchor/test_update_document_with_same_anchor.py b/tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_with_same_anchor/test_update_document_with_same_anchor.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/document/update_document_with_same_anchor/test_update_document_with_same_anchor.py rename to tests/end2end/screens/document/_cross_cutting/anchors/document/update_document_with_same_anchor/test_update_document_with_same_anchor.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/__init__.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/__init__.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/__init__.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/__init__.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/test_case.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/test_case.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/test_case.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/create_section_must_not_add_anchor_broken_rst/test_case.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/test_create_section_must_not_add_link_to_nonexisting_node.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/test_create_section_must_not_add_link_to_nonexisting_node.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/test_create_section_must_not_add_link_to_nonexisting_node.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/create_section_must_not_add_link_to_nonexisting_node/test_create_section_must_not_add_link_to_nonexisting_node.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/__init__.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/__init__.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/__init__.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/__init__.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/test_case.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/test_case.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/test_case.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_add_anchor_broken_rst/test_case.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_anchor_that_already_exists_in_tree/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_anchor_that_already_exists_in_tree/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_anchor_that_already_exists_in_tree/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_anchor_that_already_exists_in_tree/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_anchor_that_already_exists_in_tree/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_anchor_that_already_exists_in_tree/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_anchor_that_already_exists_in_tree/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_anchor_that_already_exists_in_tree/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_anchor_that_already_exists_in_tree/test_update_section_must_not_add_anchor_that_already_exists_in_tree.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_anchor_that_already_exists_in_tree/test_update_section_must_not_add_anchor_that_already_exists_in_tree.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_anchor_that_already_exists_in_tree/test_update_section_must_not_add_anchor_that_already_exists_in_tree.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_anchor_that_already_exists_in_tree/test_update_section_must_not_add_anchor_that_already_exists_in_tree.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_link_to_nonexisting_node/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_link_to_nonexisting_node/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_link_to_nonexisting_node/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_link_to_nonexisting_node/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_link_to_nonexisting_node/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_link_to_nonexisting_node/test_update_section_must_not_add_link_to_nonexisting_node.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_link_to_nonexisting_node/test_update_section_must_not_add_link_to_nonexisting_node.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_link_to_nonexisting_node/test_update_section_must_not_add_link_to_nonexisting_node.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_link_to_nonexisting_node/test_update_section_must_not_add_link_to_nonexisting_node.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_new_duplicated_anchor_to_same_node/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_new_duplicated_anchor_to_same_node/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_new_duplicated_anchor_to_same_node/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_new_duplicated_anchor_to_same_node/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_new_duplicated_anchor_to_same_node/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_new_duplicated_anchor_to_same_node/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_new_duplicated_anchor_to_same_node/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_new_duplicated_anchor_to_same_node/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_new_duplicated_anchor_to_same_node/test_update_section_must_not_add_new_duplicated_anchor_to_same_node.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_new_duplicated_anchor_to_same_node/test_update_section_must_not_add_new_duplicated_anchor_to_same_node.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_add_new_duplicated_anchor_to_same_node/test_update_section_must_not_add_new_duplicated_anchor_to_same_node.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_add_new_duplicated_anchor_to_same_node/test_update_section_must_not_add_new_duplicated_anchor_to_same_node.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/__init__.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/__init__.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/__init__.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/__init__.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/test_case.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/test_case.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/test_case.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_overwrite_existing_anchor_with_incoming_links/test_case.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/__init__.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/__init__.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/__init__.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/__init__.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/test_case.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/test_case.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/test_case.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_must_not_remove_free_text_with_anchor_that_has_incoming_links/test_case.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_remove_uid_that_has_incoming_links/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_remove_uid_that_has_incoming_links/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_remove_uid_that_has_incoming_links/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_remove_uid_that_has_incoming_links/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_remove_uid_that_has_incoming_links/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_remove_uid_that_has_incoming_links/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_remove_uid_that_has_incoming_links/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_remove_uid_that_has_incoming_links/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_remove_uid_that_has_incoming_links/test_update_section_remove_uid_that_has_incoming_links.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_remove_uid_that_has_incoming_links/test_update_section_remove_uid_that_has_incoming_links.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_remove_uid_that_has_incoming_links/test_update_section_remove_uid_that_has_incoming_links.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_remove_uid_that_has_incoming_links/test_update_section_remove_uid_that_has_incoming_links.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_rename_uid_that_has_incoming_links/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_rename_uid_that_has_incoming_links/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_rename_uid_that_has_incoming_links/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_rename_uid_that_has_incoming_links/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_rename_uid_that_has_incoming_links/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_rename_uid_that_has_incoming_links/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_rename_uid_that_has_incoming_links/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_rename_uid_that_has_incoming_links/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_rename_uid_that_has_incoming_links/test_update_section_rename_uid_that_has_incoming_links.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_rename_uid_that_has_incoming_links/test_update_section_rename_uid_that_has_incoming_links.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/_validations_section/update_section_rename_uid_that_has_incoming_links/test_update_section_rename_uid_that_has_incoming_links.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/_validations_section/update_section_rename_uid_that_has_incoming_links/test_update_section_rename_uid_that_has_incoming_links.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/create_section_with_anchor_and_section_with_link/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/create_section_with_anchor_and_section_with_link/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/create_section_with_anchor_and_section_with_link/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/create_section_with_anchor_and_section_with_link/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/create_section_with_anchor_and_section_with_link/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/create_section_with_anchor_and_section_with_link/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/create_section_with_anchor_and_section_with_link/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/create_section_with_anchor_and_section_with_link/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/create_section_with_anchor_and_section_with_link/test_create_section_with_anchor_and_section_with_link.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/create_section_with_anchor_and_section_with_link/test_create_section_with_anchor_and_section_with_link.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/create_section_with_anchor_and_section_with_link/test_create_section_with_anchor_and_section_with_link.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/create_section_with_anchor_and_section_with_link/test_create_section_with_anchor_and_section_with_link.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_add_anchor_in_section_and_link_in_another_section/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/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/anchors/section/update_section_add_anchor_in_section_and_link_in_another_section/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_add_anchor_in_section_and_link_in_another_section/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_add_anchor_in_section_and_link_in_another_section/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/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/anchors/section/update_section_add_anchor_in_section_and_link_in_another_section/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_add_anchor_in_section_and_link_in_another_section/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/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/anchors/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 similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/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/anchors/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 diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_add_link_to_existing_section_anchor/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_add_link_to_existing_section_anchor/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_add_link_to_existing_section_anchor/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_add_link_to_existing_section_anchor/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_add_link_to_existing_section_anchor/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_add_link_to_existing_section_anchor/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_add_link_to_existing_section_anchor/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_add_link_to_existing_section_anchor/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_add_link_to_existing_section_anchor/test_update_section_add_link_to_existing_section_anchor.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_add_link_to_existing_section_anchor/test_update_section_add_link_to_existing_section_anchor.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_add_link_to_existing_section_anchor/test_update_section_add_link_to_existing_section_anchor.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_add_link_to_existing_section_anchor/test_update_section_add_link_to_existing_section_anchor.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_add_second_anchor/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_add_second_anchor/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_add_second_anchor/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_add_second_anchor/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_add_second_anchor/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_add_second_anchor/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_add_second_anchor/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_add_second_anchor/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_add_second_anchor/test_update_section_add_second_anchor.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_add_second_anchor/test_update_section_add_second_anchor.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_add_second_anchor/test_update_section_add_second_anchor.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_add_second_anchor/test_update_section_add_second_anchor.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_remove_freetext_with_anchor/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_remove_freetext_with_anchor/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_remove_freetext_with_anchor/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_remove_freetext_with_anchor/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_remove_freetext_with_anchor/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_remove_freetext_with_anchor/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_remove_freetext_with_anchor/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_remove_freetext_with_anchor/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_remove_freetext_with_anchor/test_update_section_remove_freetext_with_anchor.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_remove_freetext_with_anchor/test_update_section_remove_freetext_with_anchor.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_remove_freetext_with_anchor/test_update_section_remove_freetext_with_anchor.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_remove_freetext_with_anchor/test_update_section_remove_freetext_with_anchor.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_anchor_with_new_anchor/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_anchor_with_new_anchor/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_anchor_with_new_anchor/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_anchor_with_new_anchor/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_anchor_with_new_anchor/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_anchor_with_new_anchor/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_anchor_with_new_anchor/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_anchor_with_new_anchor/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_anchor_with_new_anchor/test_update_section_replace_anchor_with_new_anchor.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_anchor_with_new_anchor/test_update_section_replace_anchor_with_new_anchor.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_anchor_with_new_anchor/test_update_section_replace_anchor_with_new_anchor.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_anchor_with_new_anchor/test_update_section_replace_anchor_with_new_anchor.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_link_to_anchor_with_another_link_to_anchor/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_link_to_anchor_with_another_link_to_anchor/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_link_to_anchor_with_another_link_to_anchor/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_link_to_anchor_with_another_link_to_anchor/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_link_to_anchor_with_another_link_to_anchor/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_link_to_anchor_with_another_link_to_anchor/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_link_to_anchor_with_another_link_to_anchor/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_link_to_anchor_with_another_link_to_anchor/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_link_to_anchor_with_another_link_to_anchor/test_update_section_replace_link_to_anchor_with_another_link_to_anchor.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_link_to_anchor_with_another_link_to_anchor/test_update_section_replace_link_to_anchor_with_another_link_to_anchor.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_link_to_anchor_with_another_link_to_anchor/test_update_section_replace_link_to_anchor_with_another_link_to_anchor.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_link_to_anchor_with_another_link_to_anchor/test_update_section_replace_link_to_anchor_with_another_link_to_anchor.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_link_to_section_with_another_link_to_section/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_link_to_section_with_another_link_to_section/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_link_to_section_with_another_link_to_section/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_link_to_section_with_another_link_to_section/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_link_to_section_with_another_link_to_section/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_link_to_section_with_another_link_to_section/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_link_to_section_with_another_link_to_section/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_link_to_section_with_another_link_to_section/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_link_to_section_with_another_link_to_section/test_update_section_replace_link_to_section_with_another_link_to_section.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_link_to_section_with_another_link_to_section/test_update_section_replace_link_to_section_with_another_link_to_section.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_replace_link_to_section_with_another_link_to_section/test_update_section_replace_link_to_section_with_another_link_to_section.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_replace_link_to_section_with_another_link_to_section/test_update_section_replace_link_to_section_with_another_link_to_section.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_with_same_anchor/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_with_same_anchor/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_with_same_anchor/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_with_same_anchor/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_with_same_anchor/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_with_same_anchor/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_with_same_anchor/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_with_same_anchor/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_with_same_anchor/test_update_section_with_same_anchor.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_with_same_anchor/test_update_section_with_same_anchor.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_with_same_anchor/test_update_section_with_same_anchor.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_with_same_anchor/test_update_section_with_same_anchor.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_with_same_link_to_section/__init__.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_with_same_link_to_section/__init__.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_with_same_link_to_section/__init__.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_with_same_link_to_section/__init__.py diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_with_same_link_to_section/expected_output/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_with_same_link_to_section/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_with_same_link_to_section/expected_output/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_with_same_link_to_section/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_with_same_link_to_section/input/document.sdoc b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_with_same_link_to_section/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_with_same_link_to_section/input/document.sdoc rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_with_same_link_to_section/input/document.sdoc diff --git a/tests/end2end/screens/document/cross_cutting/anchors/section/update_section_with_same_link_to_section/test_case.py b/tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_with_same_link_to_section/test_case.py similarity index 100% rename from tests/end2end/screens/document/cross_cutting/anchors/section/update_section_with_same_link_to_section/test_case.py rename to tests/end2end/screens/document/_cross_cutting/anchors/section/update_section_with_same_link_to_section/test_case.py diff --git a/tests/end2end/screens/document/update_section/update_section_create_uid_that_already_exists/__init__.py b/tests/end2end/screens/document/create_section/_validations/create_section_with_nonunique_uid/__init__.py similarity index 100% rename from tests/end2end/screens/document/update_section/update_section_create_uid_that_already_exists/__init__.py rename to tests/end2end/screens/document/create_section/_validations/create_section_with_nonunique_uid/__init__.py diff --git a/tests/end2end/screens/document/create_section/validation_error_create_section_with_nonunique_uid/expected_output/document.sdoc b/tests/end2end/screens/document/create_section/_validations/create_section_with_nonunique_uid/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/create_section/validation_error_create_section_with_nonunique_uid/expected_output/document.sdoc rename to tests/end2end/screens/document/create_section/_validations/create_section_with_nonunique_uid/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/create_section/validation_error_create_section_with_nonunique_uid/input/document.sdoc b/tests/end2end/screens/document/create_section/_validations/create_section_with_nonunique_uid/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/create_section/validation_error_create_section_with_nonunique_uid/input/document.sdoc rename to tests/end2end/screens/document/create_section/_validations/create_section_with_nonunique_uid/input/document.sdoc diff --git a/tests/end2end/screens/document/create_section/validation_error_create_section_with_nonunique_uid/test_validation_error_create_section_with_nonunique_uid.py b/tests/end2end/screens/document/create_section/_validations/create_section_with_nonunique_uid/test_case.py similarity index 95% rename from tests/end2end/screens/document/create_section/validation_error_create_section_with_nonunique_uid/test_validation_error_create_section_with_nonunique_uid.py rename to tests/end2end/screens/document/create_section/_validations/create_section_with_nonunique_uid/test_case.py index 15656069c..20b62ebc7 100644 --- a/tests/end2end/screens/document/create_section/validation_error_create_section_with_nonunique_uid/test_validation_error_create_section_with_nonunique_uid.py +++ b/tests/end2end/screens/document/create_section/_validations/create_section_with_nonunique_uid/test_case.py @@ -1,5 +1,4 @@ -from seleniumbase import BaseCase - +from tests.end2end.e2e_case import E2ECase from tests.end2end.end2end_test_setup import End2EndTestSetup from tests.end2end.helpers.screens.document.form_edit_section import ( Form_EditSection, @@ -10,7 +9,7 @@ from tests.end2end.server import SDocTestServer -class Test_UC03_G1_T01_SectionWithEmptyName(BaseCase): +class Test(E2ECase): def test(self): test_setup = End2EndTestSetup(path_to_test_file=__file__) diff --git a/tests/end2end/screens/document/create_section/_validations/create_two_section_with_same_uid/__init__.py b/tests/end2end/screens/document/create_section/_validations/create_two_section_with_same_uid/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/end2end/screens/document/create_section/_validations/create_two_section_with_same_uid/expected_output/document.sdoc b/tests/end2end/screens/document/create_section/_validations/create_two_section_with_same_uid/expected_output/document.sdoc new file mode 100644 index 000000000..2a1c475e5 --- /dev/null +++ b/tests/end2end/screens/document/create_section/_validations/create_two_section_with_same_uid/expected_output/document.sdoc @@ -0,0 +1,16 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] + +[SECTION] +UID: SAME-UID +TITLE: Section 1 + +[FREETEXT] +Section 1 free text. +[/FREETEXT] + +[/SECTION] diff --git a/tests/end2end/screens/document/create_section/_validations/create_two_section_with_same_uid/input/document.sdoc b/tests/end2end/screens/document/create_section/_validations/create_two_section_with_same_uid/input/document.sdoc new file mode 100644 index 000000000..a83764ac3 --- /dev/null +++ b/tests/end2end/screens/document/create_section/_validations/create_two_section_with_same_uid/input/document.sdoc @@ -0,0 +1,6 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] diff --git a/tests/end2end/screens/document/create_section/_validations/create_two_section_with_same_uid/test_case.py b/tests/end2end/screens/document/create_section/_validations/create_two_section_with_same_uid/test_case.py new file mode 100644 index 000000000..aae4ac6fb --- /dev/null +++ b/tests/end2end/screens/document/create_section/_validations/create_two_section_with_same_uid/test_case.py @@ -0,0 +1,61 @@ +from tests.end2end.e2e_case import E2ECase +from tests.end2end.end2end_test_setup import End2EndTestSetup +from tests.end2end.helpers.screens.document.form_edit_section import ( + Form_EditSection, +) +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!") + + root_node = screen_document.get_root_node() + + root_node_menu = root_node.do_open_node_menu() + + form_edit_section: Form_EditSection = ( + root_node_menu.do_node_add_section_first() + ) + + form_edit_section.do_fill_in_title("Section 1") + form_edit_section.do_fill_in_text("Section 1 free text.") + form_edit_section.do_fill_in_uid("SAME-UID") + form_edit_section.do_form_submit() + + created_section = screen_document.get_section() + created_section_menu = created_section.do_open_node_menu() + + form_edit_section: Form_EditSection = ( + created_section_menu.do_node_add_section_below() + ) + form_edit_section.do_fill_in_title("Section 2") + form_edit_section.do_fill_in_text("Section 2 free text.") + form_edit_section.do_fill_in_uid("SAME-UID") + + form_edit_section.do_form_submit_and_catch_error( + "The chosen UID must be unique. " + "There is another section 'Section 1' with a UID 'SAME-UID'." + ) + + assert test_setup.compare_sandbox_and_expected_output() diff --git a/tests/end2end/screens/document/create_section/create_first_section/__init__.py b/tests/end2end/screens/document/create_section/create_first_section/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/end2end/screens/document/create_section/create_first_section/test_create_first_section.py b/tests/end2end/screens/document/create_section/create_first_section/test_case.py similarity index 100% rename from tests/end2end/screens/document/create_section/create_first_section/test_create_first_section.py rename to tests/end2end/screens/document/create_section/create_first_section/test_case.py diff --git a/tests/end2end/screens/document/create_section/create_two_sections_then_update_with_same_uid/__init__.py b/tests/end2end/screens/document/create_section/create_two_sections_then_update_with_same_uid/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/end2end/screens/document/create_section/create_two_sections_then_update_with_same_uid/expected_output/document.sdoc b/tests/end2end/screens/document/create_section/create_two_sections_then_update_with_same_uid/expected_output/document.sdoc new file mode 100644 index 000000000..1e2e08978 --- /dev/null +++ b/tests/end2end/screens/document/create_section/create_two_sections_then_update_with_same_uid/expected_output/document.sdoc @@ -0,0 +1,25 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] + +[SECTION] +UID: SAME-UID +TITLE: Section 1 + +[FREETEXT] +Section 1 free text. +[/FREETEXT] + +[/SECTION] + +[SECTION] +TITLE: Section 2 + +[FREETEXT] +Section 2 free text. +[/FREETEXT] + +[/SECTION] diff --git a/tests/end2end/screens/document/create_section/create_two_sections_then_update_with_same_uid/input/document.sdoc b/tests/end2end/screens/document/create_section/create_two_sections_then_update_with_same_uid/input/document.sdoc new file mode 100644 index 000000000..a83764ac3 --- /dev/null +++ b/tests/end2end/screens/document/create_section/create_two_sections_then_update_with_same_uid/input/document.sdoc @@ -0,0 +1,6 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] diff --git a/tests/end2end/screens/document/create_section/create_two_sections_then_update_with_same_uid/test_case.py b/tests/end2end/screens/document/create_section/create_two_sections_then_update_with_same_uid/test_case.py new file mode 100644 index 000000000..d0b7f9714 --- /dev/null +++ b/tests/end2end/screens/document/create_section/create_two_sections_then_update_with_same_uid/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_section import ( + Form_EditSection, +) +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!") + + root_node = screen_document.get_root_node() + + root_node_menu = root_node.do_open_node_menu() + + form_edit_section: Form_EditSection = ( + root_node_menu.do_node_add_section_first() + ) + + form_edit_section.do_fill_in_title("Section 1") + form_edit_section.do_fill_in_text("Section 1 free text.") + form_edit_section.do_fill_in_uid("SAME-UID") + form_edit_section.do_form_submit() + + created_section = screen_document.get_section() + created_section_menu = created_section.do_open_node_menu() + + form_edit_section: Form_EditSection = ( + created_section_menu.do_node_add_section_below() + ) + form_edit_section.do_fill_in_title("Section 2") + form_edit_section.do_fill_in_text("Section 2 free text.") + form_edit_section.do_form_submit() + + created_section = screen_document.get_section(node_order=2) + form_edit_section: Form_EditSection = ( + created_section.do_open_form_edit_section() + ) + form_edit_section.do_fill_in_uid("SAME-UID") + form_edit_section.do_form_submit_and_catch_error( + "UID uniqueness validation error: " + "There is already an existing node with this UID: Section 1." + ) + + assert test_setup.compare_sandbox_and_expected_output() diff --git a/tests/end2end/screens/document/update_section/_validation/update_section_create_two_duplicate_uids/__init__.py b/tests/end2end/screens/document/update_section/_validation/update_section_create_two_duplicate_uids/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/end2end/screens/document/update_section/_validation/update_section_create_two_duplicate_uids/expected_output/document.sdoc b/tests/end2end/screens/document/update_section/_validation/update_section_create_two_duplicate_uids/expected_output/document.sdoc new file mode 100644 index 000000000..3cd486f6a --- /dev/null +++ b/tests/end2end/screens/document/update_section/_validation/update_section_create_two_duplicate_uids/expected_output/document.sdoc @@ -0,0 +1,25 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] + +[SECTION] +UID: DUPLICATE_UID +TITLE: First section + +[FREETEXT] +This is a free text of this section. +[/FREETEXT] + +[/SECTION] + +[SECTION] +TITLE: Second section + +[FREETEXT] +This is a free text of this section. +[/FREETEXT] + +[/SECTION] diff --git a/tests/end2end/screens/document/update_section/_validation/update_section_create_two_duplicate_uids/input/document.sdoc b/tests/end2end/screens/document/update_section/_validation/update_section_create_two_duplicate_uids/input/document.sdoc new file mode 100644 index 000000000..194a959cc --- /dev/null +++ b/tests/end2end/screens/document/update_section/_validation/update_section_create_two_duplicate_uids/input/document.sdoc @@ -0,0 +1,24 @@ +[DOCUMENT] +TITLE: Document 1 + +[FREETEXT] +Hello world! +[/FREETEXT] + +[SECTION] +TITLE: First section + +[FREETEXT] +This is a free text of this section. +[/FREETEXT] + +[/SECTION] + +[SECTION] +TITLE: Second section + +[FREETEXT] +This is a free text of this section. +[/FREETEXT] + +[/SECTION] diff --git a/tests/end2end/screens/document/update_section/_validation/update_section_create_two_duplicate_uids/test_case.py b/tests/end2end/screens/document/update_section/_validation/update_section_create_two_duplicate_uids/test_case.py new file mode 100644 index 000000000..72971235e --- /dev/null +++ b/tests/end2end/screens/document/update_section/_validation/update_section_create_two_duplicate_uids/test_case.py @@ -0,0 +1,51 @@ +from seleniumbase import BaseCase + +from tests.end2end.end2end_test_setup import End2EndTestSetup +from tests.end2end.helpers.screens.document.form_edit_section import ( + Form_EditSection, +) +from tests.end2end.helpers.screens.project_index.screen_project_index import ( + Screen_ProjectIndex, +) +from tests.end2end.server import SDocTestServer + + +class Test(BaseCase): + 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!") + + section = screen_document.get_section() + form_edit_section: Form_EditSection = ( + section.do_open_form_edit_section() + ) + form_edit_section.do_fill_in_uid("DUPLICATE_UID") + form_edit_section.do_form_submit() + + section = screen_document.get_section(node_order=2) + form_edit_section: Form_EditSection = ( + section.do_open_form_edit_section() + ) + form_edit_section.do_fill_in_uid("DUPLICATE_UID") + form_edit_section.do_form_submit_and_catch_error( + "UID uniqueness validation error: " + "There is already an existing node with this UID: First section." + ) + + assert test_setup.compare_sandbox_and_expected_output() diff --git a/tests/end2end/screens/document/update_section/_validation/update_section_create_uid_that_already_exists/__init__.py b/tests/end2end/screens/document/update_section/_validation/update_section_create_uid_that_already_exists/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/end2end/screens/document/update_section/update_section_create_uid_that_already_exists/expected_output/document.sdoc b/tests/end2end/screens/document/update_section/_validation/update_section_create_uid_that_already_exists/expected_output/document.sdoc similarity index 100% rename from tests/end2end/screens/document/update_section/update_section_create_uid_that_already_exists/expected_output/document.sdoc rename to tests/end2end/screens/document/update_section/_validation/update_section_create_uid_that_already_exists/expected_output/document.sdoc diff --git a/tests/end2end/screens/document/update_section/update_section_create_uid_that_already_exists/input/document.sdoc b/tests/end2end/screens/document/update_section/_validation/update_section_create_uid_that_already_exists/input/document.sdoc similarity index 100% rename from tests/end2end/screens/document/update_section/update_section_create_uid_that_already_exists/input/document.sdoc rename to tests/end2end/screens/document/update_section/_validation/update_section_create_uid_that_already_exists/input/document.sdoc diff --git a/tests/end2end/screens/document/update_section/update_section_create_uid_that_already_exists/test_case.py b/tests/end2end/screens/document/update_section/_validation/update_section_create_uid_that_already_exists/test_case.py similarity index 100% rename from tests/end2end/screens/document/update_section/update_section_create_uid_that_already_exists/test_case.py rename to tests/end2end/screens/document/update_section/_validation/update_section_create_uid_that_already_exists/test_case.py