Skip to content

Commit 206dc71

Browse files
aadereikoaadereiko
andauthored
[NA][FE][e2e tests]: update selectors for e2e tests of prompts; (#4582)
* update selectors for e2e tests of prompts; * e2e fix and eslint fix; --------- Co-authored-by: aadereiko <[email protected]>
1 parent d50369e commit 206dc71

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

apps/opik-frontend/src/components/pages/PromptPage/PromptTab/TextPromptView.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ const TextPromptView: React.FC<TextPromptViewProps> = ({
5050
</div>
5151
) : (
5252
<>
53-
<div className="rounded-md bg-primary-foreground p-3">
53+
<div
54+
className="rounded-md bg-primary-foreground p-3"
55+
data-testid="prompt-text-content"
56+
>
5457
<MarkdownPreview>{template}</MarkdownPreview>
5558
</div>
5659
{extractedImages.length > 0 && (

tests_end_to_end/page_objects/PromptPage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def click_most_recent_commit(self):
2525
self.page.wait_for_timeout(500)
2626

2727
def get_prompt_of_selected_commit(self):
28-
return self.page.get_by_role("code").first.inner_text()
28+
return self.page.get_by_test_id("prompt-text-content").first.inner_text()
2929

3030
def get_all_prompt_versions_with_commit_ids_on_page(self):
3131
rows: list[Locator] = self.page.get_by_role("row").all()[1:]

tests_end_to_end/tests_end_to_end_ts/typescript-tests/page-objects/prompts.page.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ export class PromptDetailsPage {
127127
await promptTab.click();
128128
await this.page.waitForTimeout(500);
129129

130-
const promptCode = this.page.locator('code').first();
131-
const text = await promptCode.textContent();
130+
const promptContainer = this.page.getByTestId('prompt-text-content');
131+
const text = await promptContainer.textContent();
132132
return text?.trim() || '';
133133
}
134134
}

0 commit comments

Comments
 (0)