Skip to content

Commit 08c27e8

Browse files
committed
fix(store-admin): extend wait time and update AI Assistant button handling
1 parent 828441a commit 08c27e8

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

tests/e2e/store-admin.spec.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ test.describe('store-front tests', () => {
2222
await page.getByRole('spinbutton', { name: 'Price' }).fill('2.99');
2323
await page.getByRole('textbox', { name: 'Keywords' }).fill('dog, snack, treat');
2424

25-
await page.waitForTimeout(5000);
26-
const askOpenAI = page.getByRole('button', { name: 'Ask AI Assistant' });
27-
if (await askOpenAI.isVisible()) {
28-
await askOpenAI.click();
25+
// pause for 60 seconds
26+
await page.waitForTimeout(60000);
27+
28+
// look for the AI Assistant button and click it if visible
29+
const askAIAssistantButton = page.locator('button:has-text("Ask AI Assistant")');
30+
if (await askAIAssistantButton.isVisible()) {
31+
await askAIAssistantButton.click();
2932
await page.waitForResponse(response =>
3033
response.url().includes('/api/ai/generate/description') && response.status() === 200
3134
);

0 commit comments

Comments
 (0)