forked from strictdoc-project/strictdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request strictdoc-project#1854 from strictdoc-project/stan…
…islaw/delete_section_confirmation_before_and_after UI: Create node: parse, validate, and render LINK/ANCHOR
- Loading branch information
Showing
53 changed files
with
411 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
...validations/create_node_must_validate_ANCHOR_already_exists/expected_output/document.sdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
|
||
[FREETEXT] | ||
Hello world! | ||
[/FREETEXT] | ||
|
||
[REQUIREMENT] | ||
STATEMENT: >>> | ||
[ANCHOR: AD1] | ||
<<< |
11 changes: 11 additions & 0 deletions
11
.../_create/_validations/create_node_must_validate_ANCHOR_already_exists/input/document.sdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
|
||
[FREETEXT] | ||
Hello world! | ||
[/FREETEXT] | ||
|
||
[REQUIREMENT] | ||
STATEMENT: >>> | ||
[ANCHOR: AD1] | ||
<<< |
48 changes: 48 additions & 0 deletions
48
...OR/node/_create/_validations/create_node_must_validate_ANCHOR_already_exists/test_case.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from tests.end2end.e2e_case import E2ECase | ||
from tests.end2end.end2end_test_setup import End2EndTestSetup | ||
from tests.end2end.helpers.screens.document.form_edit_requirement import ( | ||
Form_EditRequirement, | ||
) | ||
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!") | ||
|
||
# Requirement 1 | ||
requirement1_node = screen_document.get_node(1) | ||
root_node_menu = requirement1_node.do_open_node_menu() | ||
form_edit_requirement: Form_EditRequirement = ( | ||
root_node_menu.do_node_add_requirement_below() | ||
) | ||
form_edit_requirement.do_fill_in_field_statement( | ||
""" | ||
[ANCHOR: AD1] | ||
""" | ||
) | ||
form_edit_requirement.do_form_submit_and_catch_error( | ||
"A node contains an anchor that already exists: AD1." | ||
) | ||
|
||
assert test_setup.compare_sandbox_and_expected_output() |
File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions
52
...R/node/_create/_validations/create_node_must_validate_ANCHOR_with_broken_rst/test_case.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
from tests.end2end.e2e_case import E2ECase | ||
from tests.end2end.end2end_test_setup import End2EndTestSetup | ||
from tests.end2end.helpers.screens.document.form_edit_requirement import ( | ||
Form_EditRequirement, | ||
) | ||
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!") | ||
|
||
# Requirement 1 | ||
root_node = screen_document.get_root_node() | ||
root_node_menu = root_node.do_open_node_menu() | ||
form_edit_requirement: Form_EditRequirement = ( | ||
root_node_menu.do_node_add_requirement_first() | ||
) | ||
form_edit_requirement.do_fill_in_field_uid("REQ-1") | ||
form_edit_requirement.do_fill_in_field_title("Req #1") | ||
form_edit_requirement.do_fill_in_field_statement( | ||
"""\ | ||
Modified statement. | ||
[ANCHOR: AD1]!!!GARBAGE!!! | ||
""" | ||
) | ||
form_edit_requirement.do_form_submit_and_catch_error( | ||
"SDoc markup error: NCHOR: AD1*]!!!GARBAG." | ||
) | ||
|
||
assert test_setup.compare_sandbox_and_expected_output() |
File renamed without changes.
11 changes: 11 additions & 0 deletions
11
...de/_create/_validations/create_node_must_validate_LINK_does_not_exist/input/document.sdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
|
||
[FREETEXT] | ||
Hello world! | ||
[/FREETEXT] | ||
|
||
[REQUIREMENT] | ||
UID: REQ-1 | ||
TITLE: Req #1 | ||
STATEMENT: Req #1 statement. |
48 changes: 48 additions & 0 deletions
48
...CHOR/node/_create/_validations/create_node_must_validate_LINK_does_not_exist/test_case.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from tests.end2end.e2e_case import E2ECase | ||
from tests.end2end.end2end_test_setup import End2EndTestSetup | ||
from tests.end2end.helpers.screens.document.form_edit_requirement import ( | ||
Form_EditRequirement, | ||
) | ||
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!") | ||
|
||
# Requirement 1 | ||
root_node = screen_document.get_node(1) | ||
root_node_menu = root_node.do_open_node_menu() | ||
form_edit_requirement: Form_EditRequirement = ( | ||
root_node_menu.do_node_add_requirement_below() | ||
) | ||
form_edit_requirement.do_fill_in_field_uid("REQ-2") | ||
form_edit_requirement.do_fill_in_field_title("Req #2") | ||
form_edit_requirement.do_fill_in_field_statement( | ||
"See [LINK: THIS-DOES-NOT-EXIST]." | ||
) | ||
form_edit_requirement.do_form_submit_and_catch_error( | ||
"A LINK points to a node that does not exist: 'THIS-DOES-NOT-EXIST'." | ||
) | ||
|
||
assert test_setup.compare_sandbox_and_expected_output() |
File renamed without changes.
File renamed without changes.
55 changes: 55 additions & 0 deletions
55
..._ANCHOR/node/_create/_validations/create_node_must_validate_duplicate_ANCHOR/test_case.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
from tests.end2end.e2e_case import E2ECase | ||
from tests.end2end.end2end_test_setup import End2EndTestSetup | ||
from tests.end2end.helpers.screens.document.form_edit_requirement import ( | ||
Form_EditRequirement, | ||
) | ||
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!") | ||
|
||
# Requirement 1 | ||
root_node = screen_document.get_root_node() | ||
root_node_menu = root_node.do_open_node_menu() | ||
form_edit_requirement: Form_EditRequirement = ( | ||
root_node_menu.do_node_add_requirement_first() | ||
) | ||
form_edit_requirement.do_fill_in_field_uid("REQ-1") | ||
form_edit_requirement.do_fill_in_field_title("Req #1") | ||
form_edit_requirement.do_fill_in_field_statement( | ||
"[ANCHOR: ANC-1, Anchor title]" | ||
""" | ||
Modified free text! | ||
[ANCHOR: AD1] | ||
[ANCHOR: AD1] | ||
""" | ||
) | ||
form_edit_requirement.do_form_submit_and_catch_error( | ||
"A node cannot have two anchors with the same identifier: AD1." | ||
) | ||
|
||
assert test_setup.compare_sandbox_and_expected_output() |
20 changes: 20 additions & 0 deletions
20
...utting/LINK_and_ANCHOR/node/_create/create_node_with_ANCHOR/expected_output/document.sdoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
|
||
[FREETEXT] | ||
Hello world! | ||
[/FREETEXT] | ||
|
||
[REQUIREMENT] | ||
UID: REQ-1 | ||
TITLE: Req #1 | ||
STATEMENT: >>> | ||
[ANCHOR: ANC-1, Anchor title] | ||
<<< | ||
|
||
[REQUIREMENT] | ||
UID: REQ-2 | ||
TITLE: Req #2 | ||
STATEMENT: >>> | ||
See [LINK: ANC-1]. | ||
<<< |
File renamed without changes.
Oops, something went wrong.