Skip to content

Commit 5d968b0

Browse files
committed
tests: Add test for comment mention
1 parent 62fcc85 commit 5d968b0

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
from playwright.sync_api import Page, expect
2+
from tests.e2e_tests.test_end_to_end import init_e2e_test, setup_console_listener
3+
from tests.e2e_tests.utils import save_failure_artifacts
4+
5+
6+
KEEP_UI_URL = "http://localhost:3000"
7+
8+
def test_mentions_in_incident_comments(browser: Page, setup_page_logging, failure_artifacts):
9+
test_id = "test_mentions_in_comments"
10+
log_entries = []
11+
setup_console_listener(browser, log_entries)
12+
13+
# Initialize test and go to incidents page
14+
init_e2e_test(browser, next_url="/incidents")
15+
browser.wait_for_selector("[data-testid='incidents-table']")
16+
17+
try:
18+
browser.get_by_role("button", name="Create Incident").click()
19+
20+
incident_title = f"Test Incident {test_id}"
21+
browser.get_by_test_id("base-input").click()
22+
browser.get_by_test_id("base-input").fill(incident_title)
23+
24+
summary_div = browser.locator("div").filter(has_text=re.compile(r"^Summary$"))
25+
summary_div.get_by_role("paragraph").nth(1).click()
26+
summary_div.locator("div").nth(3).fill("Test Incident Summary for mentions test")
27+
28+
browser.get_by_role("button", name="Who is responsible").click()
29+
browser.get_by_role("option", name="keep").click()
30+
31+
# Create a new incident
32+
browser.get_by_role("button", name="Create").click()
33+
34+
browser.get_by_role("link", name=incident_title, exact=True).click()
35+
36+
browser.get_by_role("tab", name="Activity").click()
37+
38+
browser.get_by_test_id("base-input").click()
39+
browser.get_by_test_id("base-input").fill("Test comment @keep")
40+
41+
browser.wait_for_selector("text=keep", timeout=5000)
42+
browser.get_by_text("keep").nth(2).click()
43+
44+
browser.get_by_role("button", name="Comment").click()
45+
46+
# Verify the mention is visible
47+
expect(browser.get_by_text("@keep")).to_be_visible()
48+
49+
except Exception as e:
50+
save_failure_artifacts(browser, log_entries=log_entries)
51+
raise e

0 commit comments

Comments
 (0)