Skip to content

Commit

Permalink
fixed sanity after UI changes too
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrei Căutișanu committed Nov 21, 2024
1 parent 78a4457 commit 1772e7d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests_end_to_end/page_objects/ProjectsPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def go_to_page(self):
self.page.goto(self.url)

def click_project(self, project_name):
self.page.get_by_role('cell', name=project_name).click()
self.page.get_by_role('link', name=project_name).click()

def search_project(self, project_name):
self.page.get_by_test_id("search-input").click()
Expand Down
9 changes: 9 additions & 0 deletions tests_end_to_end/page_objects/TracesPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def __init__(self, page: Page):
self.page = page
self.traces_table = self.page.get_by_role('table')
self.trace_names_selector = 'tr td:nth-child(3) div span'
self.trace_id_selector = 'tr:nth-child({}) > td:nth-child(2) > div'.format
self.next_page_button_locator = self.page.locator("div:has(> button:nth-of-type(4))").locator('button:nth-of-type(3)')
self.delete_button_locator = self.page.locator("div").filter(has_text=re.compile(r"^Add to dataset$")).get_by_role("button").nth(2)

Expand All @@ -16,6 +17,14 @@ def get_all_trace_names_on_page(self):
names = self.page.locator(self.trace_names_selector).all_inner_texts()
return names


def click_first_trace_that_has_name(self, trace_name: str):
self.page.get_by_role('row').filter(has_text=trace_name).first.get_by_role('button').first.click()


def click_nth_trace_on_page(self, n: int):
self.trace_id_selector(n).click()


def get_first_trace_name_on_page(self):
self.page.wait_for_selector(self.trace_names_selector)
Expand Down
5 changes: 3 additions & 2 deletions tests_end_to_end/tests/application_sanity/test_sanity.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ def test_spans_of_traces(page, traces_page, config, log_traces_and_spans_low_lev
3. Check that the spans are present in each trace
'''
trace_names = traces_page.get_all_trace_names_on_page()
traces_page.click_first_trace_that_has_name('decorator-trace-1')

for trace in trace_names:
page.get_by_text(trace).click()
traces_page.click_first_trace_that_has_name(trace)
spans_menu = TracesPageSpansMenu(page)
trace_type = trace.split('-')[0] # 'client' or 'decorator'
for count in range(config['spans']['count']):
Expand All @@ -66,7 +67,7 @@ def test_trace_and_span_details(page, traces_page, config, log_traces_and_spans_
trace_names = traces_page.get_all_trace_names_on_page()

for trace in trace_names:
page.get_by_text(trace).click()
traces_page.click_first_trace_that_has_name(trace)
spans_menu = TracesPageSpansMenu(page)
trace_type = trace.split('-')[0]
tag_names = config['traces'][trace_type]['tags']
Expand Down

0 comments on commit 1772e7d

Please sign in to comment.