We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 913ad13 + 03df835 commit 6476fabCopy full SHA for 6476fab
src/tests/Produkter/Produkter.spec.ts
@@ -17,12 +17,18 @@ test.describe('Produkter', () => {
17
18
await expect(page.getByRole('button', { name: 'KJØP' })).toBeVisible();
19
20
+ // Click the buy button and wait for it to complete
21
await page.getByRole('button', { name: 'KJØP' }).click();
-
22
- await page.locator('#header').getByText('1').waitFor();
23
24
- await expect(page.locator('#header').getByText('1')).toBeVisible({
25
- timeout: 15000,
+
+ // Wait for network idle to ensure any API calls complete
+ await page.waitForLoadState('networkidle');
26
+ // More specific selector for the cart count and consistent timeout
27
+ const cartCountSelector = '#header';
28
29
+ // Wait for cart count to be visible and equal to "1"
30
+ await expect(page.locator(cartCountSelector).getByText('1')).toBeVisible({
31
+ timeout: 30000
32
});
33
34
await page.getByRole('link', { name: 'Handlekurv' }).click();
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments