Path:
tests/end2end/screens/document/update_node/_validation/update_requirement_error_badge_counts_invalid_fields_not_messages/test_case.py
Lines:
70
Non-empty lines:
56
Non-empty lines covered with requirements:
56 / 56 (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.screens.document.form_edit_requirement import (
8
Form_EditRequirement,
9
)10
from tests.end2end.helpers.screens.project_index.screen_project_index import (
11
Screen_ProjectIndex,
12
)13
from tests.end2end.server import SDocTestServer
14
15
16
class Test(E2ECase):
17
def test(self):
18
test_setup = End2EndTestSetup(path_to_test_file=__file__)
19
20
with SDocTestServer(
21
input_path=test_setup.path_to_sandbox
22
) as test_server:
23
self.open(test_server.get_host_and_port())
24
25
screen_project_index = Screen_ProjectIndex(self)
26
27
screen_project_index.assert_on_screen()
28
screen_project_index.assert_contains_document("Document 1")
29
30
screen_document = screen_project_index.do_click_on_first_document()
31
32
screen_document.assert_on_screen_document()
33
screen_document.assert_header_document_title("Document 1")
34
35
# REQ-002 has both an outgoing Parent relation (to REQ-001) and36
# an incoming Child relation (from REQ-003), so renaming its UID37
# adds two separate error messages to the same UID field.38
requirement = screen_document.get_node(2)
39
form_edit_requirement: Form_EditRequirement = (
40
requirement.do_open_form_edit_requirement()
41
)42
43
form_edit_requirement.do_fill_in_field_uid("Modified UID")
44
form_edit_requirement.do_clear_field("STATEMENT")
45
46
form_edit_requirement.do_form_submit_and_catch_error(
47
"Not supported yet: "48
"Renaming a requirement UID when the requirement has parent "49
"requirement relations. For now, manually delete the relations,"50
" rename the UID, recreate the relations."51
)52
form_edit_requirement.do_form_submit_and_catch_error(
53
"Not supported yet: "54
"Renaming a requirement UID when the requirement has child "55
"requirement relations. For now, manually delete the relations,"56
" rename the UID, recreate the relations."57
)58
form_edit_requirement.do_form_submit_and_catch_error(
59
"Node's STATEMENT must not be empty. "60
"If there is no appropriate value for this field yet, "61
"enter TBD (to be done) or TBC (to be confirmed)."62
)63
64
# 3 error messages (2 on UID, 1 on STATEMENT) but only 2 fields65
# are actually invalid: the "Fields" tab badge must show 2.66
form_edit_requirement.assert_tab_error_count("Fields", 2)
67
68
form_edit_requirement.do_form_cancel()
69
70
assert test_setup.compare_sandbox_and_expected_output()