Path:
tests/end2end/screens/document/_export_to_pdf/export_to_pdf_basic/test_case.py
Lines:
48
Non-empty lines:
35
Non-empty lines covered with requirements:
35 / 35 (100.0%)
Functions:
2
Functions covered by requirements:
2 / 2 (100.0%)
1
"""2
@relation(SDOC-SRS-51, scope=file)3
"""4
5
import os
6
import shutil
7
8
from tests.end2end.conftest import DOWNLOADED_FILES_PATH, test_environment
9
from tests.end2end.e2e_case import E2ECase
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
path_to_this_test_file_folder = os.path.dirname(os.path.abspath(__file__))
16
path_to_expected_downloaded_file = os.path.join(
17
DOWNLOADED_FILES_PATH, "Basic Document.pdf"
18
)19
20
21
class Test(E2ECase):
22
def test(self):
23
shutil.rmtree(DOWNLOADED_FILES_PATH, ignore_errors=True)
24
25
with SDocTestServer(
26
input_path=path_to_this_test_file_folder
27
) as test_server:
28
self.open(test_server.get_host_and_port())
29
30
screen_project_index = Screen_ProjectIndex(self)
31
32
screen_project_index.assert_on_screen()
33
screen_project_index.assert_contains_document("Basic Document")
34
35
screen_document = screen_project_index.do_click_on_first_document()
36
37
screen_document.assert_on_screen_document()
38
screen_document.assert_header_document_title("Basic Document")
39
screen_document.assert_text("Hello world! 😊😊😊")
40
41
# TODO42
shutil.rmtree(DOWNLOADED_FILES_PATH, ignore_errors=True)
43
assert not os.path.exists(path_to_expected_downloaded_file)
44
45
screen_document.do_export_pdf()
46
47
self.sleep(test_environment.download_file_timeout_seconds)
48
assert os.path.exists(path_to_expected_downloaded_file)