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#1872 from strictdoc-project/stan…
…islaw/html_markup_tweak UI: Ensure that documents with HTML markup get rendered correctly when edited
- Loading branch information
Showing
5 changed files
with
120 additions
and
28 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
10 changes: 10 additions & 0 deletions
10
...ment/update_requirement/update_requirement_when_HTML_markup/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,10 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
OPTIONS: | ||
MARKUP: HTML | ||
|
||
[REQUIREMENT] | ||
TITLE: Requirement title | ||
STATEMENT: >>> | ||
UPDATED: <b>This <a href="#">text</a> will be rendered directly as HTML!</b>. UPDATED. | ||
<<< |
10 changes: 10 additions & 0 deletions
10
...reens/document/update_requirement/update_requirement_when_HTML_markup/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,10 @@ | ||
[DOCUMENT] | ||
TITLE: Document 1 | ||
OPTIONS: | ||
MARKUP: HTML | ||
|
||
[REQUIREMENT] | ||
TITLE: Requirement title | ||
STATEMENT: >>> | ||
<b>This <a href="#">text</a> will be rendered directly as HTML!</b> | ||
<<< |
59 changes: 59 additions & 0 deletions
59
...2end/screens/document/update_requirement/update_requirement_when_HTML_markup/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,59 @@ | ||
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") | ||
|
||
requirement = screen_document.get_requirement() | ||
|
||
requirement.assert_requirement_statement_contains( | ||
"This text will be rendered directly as HTML!" | ||
) | ||
|
||
""" | ||
ACT | ||
""" | ||
form_edit_requirement: Form_EditRequirement = ( | ||
requirement.do_open_form_edit_requirement() | ||
) | ||
form_edit_requirement.do_fill_in_field_statement( | ||
"UPDATED: " | ||
'<b>This <a href="#">text</a> will be rendered directly as HTML!</b>. ' | ||
"UPDATED." | ||
) | ||
form_edit_requirement.do_form_submit() | ||
|
||
""" | ||
ASSERT | ||
""" | ||
requirement.assert_requirement_statement_contains( | ||
"UPDATED: " | ||
"This text will be rendered directly as HTML!. " | ||
"UPDATED." | ||
) | ||
|
||
assert test_setup.compare_sandbox_and_expected_output() |