|
1 | 1 | import pytest |
2 | 2 | from pytest_splunk_addon_ui_smartx.base_test import UccTester |
3 | | -from pytest_splunk_addon_ui_smartx.components.base_component import Selector |
4 | | -from pytest_splunk_addon_ui_smartx.components.controls.button import Button |
5 | 3 |
|
6 | 4 | from .Example_UccLib.alert_action import AlertPage |
7 | 5 |
|
8 | 6 |
|
9 | | -@pytest.fixture(autouse=True) |
10 | | -def setup_alert(ucc_smartx_selenium_helper): |
11 | | - """ |
12 | | - Skip the popups in Splunk before executing the tests |
13 | | - """ |
14 | | - try: |
15 | | - # Splunk 8.x |
16 | | - if not setup_alert.first_execution: |
17 | | - return |
18 | | - |
19 | | - AlertPage(ucc_smartx_selenium_helper, None, open_page=False) |
20 | | - intro_popup = Button( |
21 | | - ucc_smartx_selenium_helper.browser, |
22 | | - Selector(select=".modal-footer .btn-save"), |
23 | | - ) |
24 | | - intro_popup.wait_to_be_clickable() |
25 | | - intro_popup.click() |
26 | | - setup_alert.first_execution = False |
27 | | - |
28 | | - # Splunk 8.2.x |
29 | | - intro_popup = Button( |
30 | | - ucc_smartx_selenium_helper.browser, |
31 | | - Selector(select='[data-test="label"]'), |
32 | | - ) |
33 | | - intro_popup.wait_to_be_clickable() |
34 | | - intro_popup.click() |
35 | | - |
36 | | - # Splunk 8.0.x |
37 | | - important_changes_coming = Button( |
38 | | - ucc_smartx_selenium_helper.browser, |
39 | | - Selector( |
40 | | - select='div[data-test-name="python3-notification-modal"] button[data-test="button"][data-appearance="secondary"]' |
41 | | - ), |
42 | | - ) |
43 | | - important_changes_coming.wait_to_be_clickable() |
44 | | - important_changes_coming.click() |
45 | | - except Exception: |
46 | | - pass |
47 | | - |
48 | | - |
49 | | -setup_alert.first_execution = True |
50 | | - |
51 | | - |
52 | 7 | @pytest.fixture |
53 | 8 | def clean_alert(ucc_smartx_rest_helper): |
54 | 9 | yield None |
|
0 commit comments