|
1 | | -import { test, expect } from '@playwright/test'; |
| 1 | +import { expect, test } from '@playwright/test'; |
| 2 | +import { isProduction } from '../utils'; |
2 | 3 |
|
3 | 4 | test.describe('Footer kotlin ecosystem buttons', () => { |
4 | 5 | test.beforeEach(async ({ page }) => { |
@@ -28,7 +29,7 @@ test.describe('Footer kotlin ecosystem buttons', () => { |
28 | 29 | await expect(pressKitButton).toBeVisible(); |
29 | 30 | const href = await pressKitButton.getAttribute('href'); |
30 | 31 | expect(href).toBe('https://kotlinlang.org/assets/kotlin-media-kit.pdf'); |
31 | | - }); |
| 32 | + }); |
32 | 33 |
|
33 | 34 | test('Security button should navigate to Security page', async ({ page }) => { |
34 | 35 | const securityButton = page.getByTestId('footer').getByRole('link', { name: 'Security' }); |
@@ -87,13 +88,18 @@ test.describe('Footer kotlin ecosystem buttons', () => { |
87 | 88 | await expect(newPage.url()).toContain('https://www.jetbrainsmerchandise.com/view-all.html?brand=32'); |
88 | 89 | }); |
89 | 90 |
|
90 | | - test('Opt-Out button should navigate to Opt-Out page', async ({ page }) => { |
| 91 | + test('Opt-Out button should navigate to Opt-Out page', async ({ page, baseURL }) => { |
91 | 92 | const optOutButton = page.getByTestId('footer').getByRole('link', { name: 'Opt-Out' }); |
92 | 93 | await expect(optOutButton).toBeVisible(); |
93 | 94 | await optOutButton.click(); |
94 | | - const cookieSettingsPopup = page.locator('#ch2-settings-dialog'); |
95 | | - await expect(cookieSettingsPopup).toBeVisible(); |
96 | | - await expect(cookieSettingsPopup).toContainText('Cookie Settings'); |
| 95 | + |
| 96 | + if (isProduction(baseURL)) { |
| 97 | + await test.step('check Opt-Out popup', async () => { |
| 98 | + const cookieSettingsPopup = page.locator('#ch2-settings-dialog'); |
| 99 | + await expect(cookieSettingsPopup).toBeVisible(); |
| 100 | + await expect(cookieSettingsPopup).toContainText('Cookie Settings'); |
| 101 | + }); |
| 102 | + } |
97 | 103 | }); |
98 | 104 |
|
99 | 105 | // Click on the JetBrains logo button in footer. |
|
0 commit comments