StrictDoc Documentation
tests/end2end/screens/document/update_node/update_requirement_reescape_html_by_validations/test_case.py
Source file coverage
Path:
tests/end2end/screens/document/update_node/update_requirement_reescape_html_by_validations/test_case.py
Lines:
51
Non-empty lines:
41
Non-empty lines covered with requirements:
41 / 41 (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.constants import RST_STRING_THAT_NEEDS_HTML_ESCAPING
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
    def test(self):
19
        test_setup = End2EndTestSetup(path_to_test_file=__file__)
20
 
21
        with SDocTestServer(
22
            input_path=test_setup.path_to_sandbox
23
        ) as test_server:
24
            self.open(test_server.get_host_and_port())
25
 
26
            screen_project_index = Screen_ProjectIndex(self)
27
 
28
            screen_project_index.assert_on_screen()
29
            screen_project_index.assert_contains_document("Document 1")
30
 
31
            screen_document = screen_project_index.do_click_on_first_document()
32
 
33
            screen_document.assert_on_screen_document()
34
            screen_document.assert_header_document_title("Document 1")
35
 
36
            requirement = screen_document.get_node()
37
            form_edit_requirement: Form_EditRequirement = (
38
                requirement.do_open_form_edit_requirement()
39
            )
40
            form_edit_requirement.do_fill_in_field_statement(
41
                RST_STRING_THAT_NEEDS_HTML_ESCAPING
42
            )
43
            form_edit_requirement.do_form_submit_and_catch_error(
44
                "RST markup syntax error on line 2: "
45
                "Bullet list ends without a blank line; unexpected unindent."
46
            )
47
            form_edit_requirement.assert_contenteditable_contains(
48
                RST_STRING_THAT_NEEDS_HTML_ESCAPING
49
            )
50
 
51
        assert test_setup.compare_sandbox_and_expected_output()