Debian Codegraph @

dirsrvtests/tests/suites/webui/backup/backup_test.py

raw
1 # --- BEGIN COPYRIGHT BLOCK ---
2 # Copyright (C) 2023 Red Hat, Inc.
3 # All rights reserved.
4 #
5 # License: GPL (version 3 or any later version).
6 # See LICENSE for details.
7 # --- END COPYRIGHT BLOCK ---
8 #
9 import time
10 import subprocess
11 import pytest
12
13 from lib389.cli_idm.account import *
14 from lib389.tasks import *
15 from lib389.utils import *
16 from test389.topologies import topology_st
17 from .. import setup_page, check_frame_assignment, setup_login
18
19 pytestmark = pytest.mark.skipif(os.getenv('WEBUI') is None, reason="These tests are only for WebUI environment")
20 pytest.importorskip('playwright')
21
22 SERVER_ID = 'standalone1'
23
24
25 def test_no_backup_dir(topology_st, page, browser_name):
26 """ Test that instance is able to load when backup directory doesn't exist.
27
28 :id: a1fb9e70-c110-4578-ba1f-4b593cc0a047
29 :setup: Standalone instance
30 :steps:
31 1. Set Backup Directory (nsslapd-bakdir) to non existing directory.
32 2. Check if element on Server tab is loaded.
33 :expectedresults:
34 1. Success
35 2. Element is visible.
36 """
37
38 topology_st.standalone.config.set('nsslapd-bakdir', '/DOES_NOT_EXIST')
39
40 setup_login(page)
41 time.sleep(1)
42 frame = check_frame_assignment(page, browser_name)
43
44 log.info('Check if server settings tabs are loaded.')
45 frame.get_by_role('tab', name='General Settings', exact=True).wait_for()
46 assert frame.get_by_role('tab', name='General Settings').is_visible()
47
48
49 if __name__ == '__main__':
50 # Run isolated
51 # -s for DEBUG mode
52 CURRENT_FILE = os.path.realpath(__file__)
53 pytest.main("-s %s" % CURRENT_FILE)