StrictDoc Documentation
tests/end2end/screens/document/update_node/_SECTION/_autouid/update_node_section_generate_auto_uid/test_case.py
Source file coverage
Path:
tests/end2end/screens/document/update_node/_SECTION/_autouid/update_node_section_generate_auto_uid/test_case.py
Lines:
50
Non-empty lines:
37
Non-empty lines covered with requirements:
37 / 37 (100.0%)
Functions:
2
Functions covered by requirements:
2 / 2 (100.0%)
1
"""
2
@relation(SDOC-SRS-55, scope=file)
3
"""
4
 
5
import os
6
 
7
from tests.end2end.e2e_case import E2ECase
8
from tests.end2end.end2end_test_setup import End2EndTestSetup
9
from tests.end2end.helpers.screens.document.form_edit_requirement import (
10
    Form_EditRequirement,
11
)
12
from tests.end2end.helpers.screens.project_index.screen_project_index import (
13
    Screen_ProjectIndex,
14
)
15
from tests.end2end.server import SDocTestServer
16
 
17
path_to_this_test_file_folder = os.path.dirname(os.path.abspath(__file__))
18
 
19
 
20
class Test(E2ECase):
21
    def test(self):
22
        test_setup = End2EndTestSetup(path_to_test_file=__file__)
23
 
24
        with SDocTestServer(
25
            input_path=test_setup.path_to_sandbox,
26
        ) as test_server:
27
            self.open(test_server.get_host_and_port())
28
 
29
            screen_project_index = Screen_ProjectIndex(self)
30
 
31
            screen_project_index.assert_on_screen()
32
            screen_project_index.assert_contains_document("Document 1")
33
 
34
            screen_document = screen_project_index.do_click_on_first_document()
35
 
36
            screen_document.assert_on_screen_document()
37
            screen_document.assert_header_document_title("Document 1")
38
 
39
            section_node = screen_document.get_node()
40
            form_edit_section: Form_EditRequirement = (
41
                section_node.do_open_form_edit_requirement()
42
            )
43
            form_edit_section.do_reset_uid_field()
44
            form_edit_section.do_fill_in("TITLE", "Modified title")
45
            form_edit_section.do_form_submit()
46
 
47
            section_node.assert_requirement_title("Modified title", "1")
48
            screen_document.assert_toc_contains("Modified title")
49
 
50
        assert test_setup.compare_sandbox_and_expected_output()