StrictDoc Documentation
tests/end2end/screens/document/update_node/update_requirement_remove_uid_then_create_new_requirement/test_case.py
Source file coverage
Path:
tests/end2end/screens/document/update_node/update_requirement_remove_uid_then_create_new_requirement/test_case.py
Lines:
60
Non-empty lines:
46
Non-empty lines covered with requirements:
46 / 46 (100.0%)
Functions:
2
Functions covered by requirements:
2 / 2 (100.0%)
1
"""
2
@relation(SDOC-SRS-55, scope=file)
3
"""
4
 
5
from tests.end2end.e2e_case import E2ECase
6
from tests.end2end.end2end_test_setup import End2EndTestSetup
7
from tests.end2end.helpers.components.node.requirement import Requirement
8
from tests.end2end.helpers.screens.document.form_edit_requirement import (
9
    Form_EditRequirement,
10
)
11
from tests.end2end.helpers.screens.project_index.screen_project_index import (
12
    Screen_ProjectIndex,
13
)
14
from tests.end2end.server import SDocTestServer
15
 
16
 
17
class Test(E2ECase):
18
    """
19
    This test exercises that StrictDoc removes the UID from the traceability
20
    index when an existing requirement's UID field is deleted.
21
    The issue has been reported here:
22
    https://github.com/strictdoc-project/strictdoc/issues/1587#issuecomment-1888486134.
23
    """
24
 
25
    def test(self):
26
        test_setup = End2EndTestSetup(path_to_test_file=__file__)
27
 
28
        with SDocTestServer(
29
            input_path=test_setup.path_to_sandbox
30
        ) as test_server:
31
            self.open(test_server.get_host_and_port())
32
 
33
            screen_project_index = Screen_ProjectIndex(self)
34
 
35
            screen_project_index.assert_on_screen()
36
            screen_project_index.assert_contains_document("Document 1")
37
 
38
            screen_document = screen_project_index.do_click_on_first_document()
39
 
40
            screen_document.assert_on_screen_document()
41
            screen_document.assert_header_document_title("Document 1")
42
 
43
            requirement: Requirement = screen_document.get_node()
44
 
45
            form_edit_requirement: Form_EditRequirement = (
46
                requirement.do_open_form_edit_requirement()
47
            )
48
 
49
            form_edit_requirement.assert_on_form()
50
            form_edit_requirement.do_clear_field("UID")
51
            form_edit_requirement.do_form_submit()
52
 
53
            requirement_menu = requirement.do_open_node_menu()
54
            form_new_requirement = (
55
                requirement_menu.do_node_add_requirement_below()
56
            )
57
            form_new_requirement.do_fill_in_field_statement("Shall do.")
58
            form_new_requirement.do_form_submit()
59
 
60
        assert test_setup.compare_sandbox_and_expected_output()