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#1297 from strictdoc-project/stan…
…islaw/section_uid_must_be_unique traceability_index: fix finding an existing node with a given UID
- Loading branch information
Showing
127 changed files
with
305 additions
and
24 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from strictdoc.core.environment import SDocRuntimeEnvironment | ||
|
||
__version__ = "0.0.44a6" | ||
__version__ = "0.0.44a7" | ||
|
||
|
||
environment = SDocRuntimeEnvironment(__file__) |
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
Empty file.
16 changes: 16 additions & 0 deletions
16
...reate_section/_validations/create_two_section_with_same_uid/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,16 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
|
||
[FREETEXT] | ||
Hello world! | ||
[/FREETEXT] | ||
|
||
[SECTION] | ||
UID: SAME-UID | ||
TITLE: Section 1 | ||
|
||
[FREETEXT] | ||
Section 1 free text. | ||
[/FREETEXT] | ||
|
||
[/SECTION] |
6 changes: 6 additions & 0 deletions
6
...document/create_section/_validations/create_two_section_with_same_uid/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,6 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
|
||
[FREETEXT] | ||
Hello world! | ||
[/FREETEXT] |
61 changes: 61 additions & 0 deletions
61
...creens/document/create_section/_validations/create_two_section_with_same_uid/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,61 @@ | ||
from tests.end2end.e2e_case import E2ECase | ||
from tests.end2end.end2end_test_setup import End2EndTestSetup | ||
from tests.end2end.helpers.screens.document.form_edit_section import ( | ||
Form_EditSection, | ||
) | ||
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!") | ||
|
||
root_node = screen_document.get_root_node() | ||
|
||
root_node_menu = root_node.do_open_node_menu() | ||
|
||
form_edit_section: Form_EditSection = ( | ||
root_node_menu.do_node_add_section_first() | ||
) | ||
|
||
form_edit_section.do_fill_in_title("Section 1") | ||
form_edit_section.do_fill_in_text("Section 1 free text.") | ||
form_edit_section.do_fill_in_uid("SAME-UID") | ||
form_edit_section.do_form_submit() | ||
|
||
created_section = screen_document.get_section() | ||
created_section_menu = created_section.do_open_node_menu() | ||
|
||
form_edit_section: Form_EditSection = ( | ||
created_section_menu.do_node_add_section_below() | ||
) | ||
form_edit_section.do_fill_in_title("Section 2") | ||
form_edit_section.do_fill_in_text("Section 2 free text.") | ||
form_edit_section.do_fill_in_uid("SAME-UID") | ||
|
||
form_edit_section.do_form_submit_and_catch_error( | ||
"The chosen UID must be unique. " | ||
"There is another section 'Section 1' with a UID 'SAME-UID'." | ||
) | ||
|
||
assert test_setup.compare_sandbox_and_expected_output() |
Empty file.
File renamed without changes.
Empty file.
25 changes: 25 additions & 0 deletions
25
...reate_section/create_two_sections_then_update_with_same_uid/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,25 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
|
||
[FREETEXT] | ||
Hello world! | ||
[/FREETEXT] | ||
|
||
[SECTION] | ||
UID: SAME-UID | ||
TITLE: Section 1 | ||
|
||
[FREETEXT] | ||
Section 1 free text. | ||
[/FREETEXT] | ||
|
||
[/SECTION] | ||
|
||
[SECTION] | ||
TITLE: Section 2 | ||
|
||
[FREETEXT] | ||
Section 2 free text. | ||
[/FREETEXT] | ||
|
||
[/SECTION] |
6 changes: 6 additions & 0 deletions
6
...document/create_section/create_two_sections_then_update_with_same_uid/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,6 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
|
||
[FREETEXT] | ||
Hello world! | ||
[/FREETEXT] |
66 changes: 66 additions & 0 deletions
66
...creens/document/create_section/create_two_sections_then_update_with_same_uid/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,66 @@ | ||
from tests.end2end.e2e_case import E2ECase | ||
from tests.end2end.end2end_test_setup import End2EndTestSetup | ||
from tests.end2end.helpers.screens.document.form_edit_section import ( | ||
Form_EditSection, | ||
) | ||
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!") | ||
|
||
root_node = screen_document.get_root_node() | ||
|
||
root_node_menu = root_node.do_open_node_menu() | ||
|
||
form_edit_section: Form_EditSection = ( | ||
root_node_menu.do_node_add_section_first() | ||
) | ||
|
||
form_edit_section.do_fill_in_title("Section 1") | ||
form_edit_section.do_fill_in_text("Section 1 free text.") | ||
form_edit_section.do_fill_in_uid("SAME-UID") | ||
form_edit_section.do_form_submit() | ||
|
||
created_section = screen_document.get_section() | ||
created_section_menu = created_section.do_open_node_menu() | ||
|
||
form_edit_section: Form_EditSection = ( | ||
created_section_menu.do_node_add_section_below() | ||
) | ||
form_edit_section.do_fill_in_title("Section 2") | ||
form_edit_section.do_fill_in_text("Section 2 free text.") | ||
form_edit_section.do_form_submit() | ||
|
||
created_section = screen_document.get_section(node_order=2) | ||
form_edit_section: Form_EditSection = ( | ||
created_section.do_open_form_edit_section() | ||
) | ||
form_edit_section.do_fill_in_uid("SAME-UID") | ||
form_edit_section.do_form_submit_and_catch_error( | ||
"UID uniqueness validation error: " | ||
"There is already an existing node with this UID: Section 1." | ||
) | ||
|
||
assert test_setup.compare_sandbox_and_expected_output() |
Empty file.
25 changes: 25 additions & 0 deletions
25
...ection/_validation/update_section_create_two_duplicate_uids/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,25 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
|
||
[FREETEXT] | ||
Hello world! | ||
[/FREETEXT] | ||
|
||
[SECTION] | ||
UID: DUPLICATE_UID | ||
TITLE: First section | ||
|
||
[FREETEXT] | ||
This is a free text of this section. | ||
[/FREETEXT] | ||
|
||
[/SECTION] | ||
|
||
[SECTION] | ||
TITLE: Second section | ||
|
||
[FREETEXT] | ||
This is a free text of this section. | ||
[/FREETEXT] | ||
|
||
[/SECTION] |
24 changes: 24 additions & 0 deletions
24
...t/update_section/_validation/update_section_create_two_duplicate_uids/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,24 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
|
||
[FREETEXT] | ||
Hello world! | ||
[/FREETEXT] | ||
|
||
[SECTION] | ||
TITLE: First section | ||
|
||
[FREETEXT] | ||
This is a free text of this section. | ||
[/FREETEXT] | ||
|
||
[/SECTION] | ||
|
||
[SECTION] | ||
TITLE: Second section | ||
|
||
[FREETEXT] | ||
This is a free text of this section. | ||
[/FREETEXT] | ||
|
||
[/SECTION] |
51 changes: 51 additions & 0 deletions
51
...document/update_section/_validation/update_section_create_two_duplicate_uids/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,51 @@ | ||
from seleniumbase import BaseCase | ||
|
||
from tests.end2end.end2end_test_setup import End2EndTestSetup | ||
from tests.end2end.helpers.screens.document.form_edit_section import ( | ||
Form_EditSection, | ||
) | ||
from tests.end2end.helpers.screens.project_index.screen_project_index import ( | ||
Screen_ProjectIndex, | ||
) | ||
from tests.end2end.server import SDocTestServer | ||
|
||
|
||
class Test(BaseCase): | ||
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!") | ||
|
||
section = screen_document.get_section() | ||
form_edit_section: Form_EditSection = ( | ||
section.do_open_form_edit_section() | ||
) | ||
form_edit_section.do_fill_in_uid("DUPLICATE_UID") | ||
form_edit_section.do_form_submit() | ||
|
||
section = screen_document.get_section(node_order=2) | ||
form_edit_section: Form_EditSection = ( | ||
section.do_open_form_edit_section() | ||
) | ||
form_edit_section.do_fill_in_uid("DUPLICATE_UID") | ||
form_edit_section.do_form_submit_and_catch_error( | ||
"UID uniqueness validation error: " | ||
"There is already an existing node with this UID: First section." | ||
) | ||
|
||
assert test_setup.compare_sandbox_and_expected_output() |
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.