Skip to content

Commit

Permalink
screens/deep_traceability: edge case: truncate csv-table:: content co…
Browse files Browse the repository at this point in the history
…rrectly

Closes #1171
  • Loading branch information
stanislaw committed May 23, 2023
1 parent 7397656 commit f24de76
Show file tree
Hide file tree
Showing 7 changed files with 82 additions and 3 deletions.
2 changes: 1 addition & 1 deletion strictdoc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from strictdoc.core.environment import SDocRuntimeEnvironment

__version__ = "0.0.42a1"
__version__ = "0.0.42a2"


environment = SDocRuntimeEnvironment(__file__)
5 changes: 4 additions & 1 deletion strictdoc/helpers/rst.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import re

RST_DIRECTIVE_PATTERN = re.compile(r"^\.\. [a-z-]+:: .*$", re.MULTILINE)
# Possible tags with arguments and without:
# .. image:: _assets/picture.svg
# .. csv-table:: (has no argument)
RST_DIRECTIVE_PATTERN = re.compile(r"^\.\. [a-z-]+:: ?.*$", re.MULTILINE)


def string_contains_rst_directive(input_string: str) -> bool:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[DOCUMENT]
TITLE: Document 1

[REQUIREMENT]
STATEMENT: >>>
.. csv-table::

a,b,c,d
e,f,g,h
e,f,g,h
a,b,c,d
e,f,g,h
e,f,g,h
a,b,c,d
e,f,g,h
e,f,g,h
a,b,c,d
e,f,g,h
e,f,g,h
a,b,c,d
e,f,g,h
e,f,g,h
a,b,c,d
e,f,g,h
e,f,g,h
a,b,c,d
e,f,g,h
e,f,g,h
a,b,c,d
e,f,g,h
e,f,g,h
<<<
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import os

from seleniumbase import BaseCase

from tests.end2end.helpers.components.viewtype_selector import ViewType_Selector
from tests.end2end.helpers.screens.document.screen_document import (
Screen_Document,
)
from tests.end2end.helpers.screens.project_index.screen_project_index import (
Screen_ProjectIndex,
)
from tests.end2end.server import SDocTestServer

path_to_this_test_file_folder = os.path.dirname(os.path.abspath(__file__))


class Test_UC40_T03_DisplayInlineCSVTable(BaseCase):
def test_01(self):
with SDocTestServer(
input_path=path_to_this_test_file_folder
) as test_server:
self.open(test_server.get_host_and_port())

screen_document_tree = Screen_ProjectIndex(self)

screen_document_tree.assert_on_screen()
screen_document_tree.assert_contains_document("Document 1")

screen_document: Screen_Document = (
screen_document_tree.do_click_on_first_document()
)

screen_document.assert_on_screen_document()
screen_document.assert_header_document_title("Document 1")
screen_document.assert_not_empty_document()

screen_document.assert_no_js_and_404_errors()

viewtype_selector = ViewType_Selector(self)
screen_deep_traceability = (
viewtype_selector.do_go_to_deep_traceability()
)
screen_deep_traceability.assert_on_screen_deep_traceability()
screen_deep_traceability.assert_not_empty_view()
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from tests.end2end.server import SDocTestServer


class Test_UC40_T03_requirement_show_more_in_modal(BaseCase):
class Test_UC40_T04_requirement_show_more_in_modal(BaseCase):
def test_01(self):
test_setup = End2EndTestSetup(path_to_test_file=__file__)

Expand Down

0 comments on commit f24de76

Please sign in to comment.