Skip to content

Commit c9cfac1

Browse files
authored
test: use SPLUNK_DISABLE_POPUPS=true and remove workaround (#395)
1 parent 4be271a commit c9cfac1

File tree

2 files changed

+1
-45
lines changed

2 files changed

+1
-45
lines changed

docker-compose-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ services:
5454
- SPLUNK_PASSWORD=Chang3d!
5555
- SPLUNK_START_ARGS=--accept-license
5656
- SPLUNK_HEC_TOKEN=9b741d03-43e9-4164-908b-e09102327d22
57+
- SPLUNK_DISABLE_POPUPS=true
5758

5859
sauceconnect:
5960
build:

tests/ui/test_splunk_ta_example_addon_alert_actions.py

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,9 @@
11
import pytest
22
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
53

64
from .Example_UccLib.alert_action import AlertPage
75

86

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-
527
@pytest.fixture
538
def clean_alert(ucc_smartx_rest_helper):
549
yield None

0 commit comments

Comments
 (0)