From e088acffec2af0707acb87ea0d0e4fc218eedf47 Mon Sep 17 00:00:00 2001 From: Lilith Date: Thu, 22 Jan 2026 23:03:26 -0800 Subject: [PATCH] =?UTF-8?q?test(e2e):=20=F0=9F=A7=AA=20Update=20marketplac?= =?UTF-8?q?e=20frontend=20test=20page=20objects=20for=20E2E=20tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../e2e/pages/AttributeDefinitionModal.ts | 3 ++- .../e2e/pages/BillingCyclePage.ts | 7 ++++--- .../e2e/pages/CancellationFlowPage.ts | 3 ++- .../e2e/pages/ClientProfilePage.ts | 7 +++---- .../frontend-public/e2e/pages/CoopListPage.ts | 4 +++- .../e2e/pages/DiscoveryQuotaPage.ts | 3 ++- .../e2e/pages/DuoDashboardPage.ts | 3 ++- .../frontend-public/e2e/pages/DuoDetailPage.ts | 3 ++- .../e2e/pages/FriendRequestsPage.ts | 3 ++- .../e2e/pages/FriendsDashboardPage.ts | 3 ++- .../frontend-public/e2e/pages/InfoPage.ts | 18 +++++++----------- .../frontend-public/e2e/pages/LandingPage.ts | 4 +++- .../e2e/pages/MarketplaceBrowsePage.ts | 4 +++- .../e2e/pages/MarketplaceFilterSidebar.ts | 3 ++- .../e2e/pages/ProfileCompletionBannerPage.ts | 3 ++- 15 files changed, 41 insertions(+), 30 deletions(-) diff --git a/features/marketplace/frontend-public/e2e/pages/AttributeDefinitionModal.ts b/features/marketplace/frontend-public/e2e/pages/AttributeDefinitionModal.ts index ced8205b7..172194647 100755 --- a/features/marketplace/frontend-public/e2e/pages/AttributeDefinitionModal.ts +++ b/features/marketplace/frontend-public/e2e/pages/AttributeDefinitionModal.ts @@ -1,6 +1,7 @@ -import type { Page, Locator } from '@playwright/test' import { expect } from '@playwright/test' +import type { Page, Locator } from '@playwright/test' + /** * Page Object Model for Attribute Definition Modal * diff --git a/features/marketplace/frontend-public/e2e/pages/BillingCyclePage.ts b/features/marketplace/frontend-public/e2e/pages/BillingCyclePage.ts index 4743bbf1d..1a6fd1b3e 100755 --- a/features/marketplace/frontend-public/e2e/pages/BillingCyclePage.ts +++ b/features/marketplace/frontend-public/e2e/pages/BillingCyclePage.ts @@ -1,6 +1,7 @@ -import type { Page, Locator } from '@playwright/test' import { expect } from '@playwright/test' +import type { Page, Locator } from '@playwright/test' + /** * Page Object Model for Billing Cycle Toggle Testing * @@ -146,7 +147,7 @@ export class BillingCyclePage { const discountBadge = tierCard.locator('[aria-label*="Save"], [data-testid*="discount-badge"]').first() const isVisible = await discountBadge.isVisible().catch(() => false) - if (!isVisible) return null + if (!isVisible) {return null} const badgeText = await discountBadge.textContent() return badgeText?.trim() || null @@ -158,7 +159,7 @@ export class BillingCyclePage { */ async getDiscountPercentage(tierSlug: string): Promise { const badgeText = await this.getDiscountBadge(tierSlug) - if (!badgeText) return 0 + if (!badgeText) {return 0} const match = badgeText.match(/(\d+)%/) return match ? parseInt(match[1], 10) : 0 diff --git a/features/marketplace/frontend-public/e2e/pages/CancellationFlowPage.ts b/features/marketplace/frontend-public/e2e/pages/CancellationFlowPage.ts index 5098eb9ff..5b3b42a86 100755 --- a/features/marketplace/frontend-public/e2e/pages/CancellationFlowPage.ts +++ b/features/marketplace/frontend-public/e2e/pages/CancellationFlowPage.ts @@ -1,6 +1,7 @@ -import type { Page, Locator } from '@playwright/test' import { expect } from '@playwright/test' +import type { Page, Locator } from '@playwright/test' + /** * Page Object Model for Cancellation Flow with Retention Offer * diff --git a/features/marketplace/frontend-public/e2e/pages/ClientProfilePage.ts b/features/marketplace/frontend-public/e2e/pages/ClientProfilePage.ts index 74a9636bc..475342fa7 100644 --- a/features/marketplace/frontend-public/e2e/pages/ClientProfilePage.ts +++ b/features/marketplace/frontend-public/e2e/pages/ClientProfilePage.ts @@ -4,9 +4,10 @@ * Encapsulates interactions with client profile creation and editing. */ -import type { Page, Locator } from '@playwright/test'; import { expect } from '@playwright/test'; +import type { Page, Locator } from '@playwright/test'; + export class ClientProfilePage { readonly page: Page; @@ -213,9 +214,7 @@ export class ClientProfilePage { async assertServiceSelected(service: string, selected: boolean = true) { const serviceButton = this.page.getByRole('button', { name: service }); // Check if button has selected styling (implementation-specific) - const isSelected = await serviceButton.evaluate((el) => { - return el.textContent?.includes(service) || false; - }); + const isSelected = await serviceButton.evaluate((el) => el.textContent?.includes(service) || false); expect(isSelected).toBe(true); } diff --git a/features/marketplace/frontend-public/e2e/pages/CoopListPage.ts b/features/marketplace/frontend-public/e2e/pages/CoopListPage.ts index 22f622cd7..4e98441ef 100644 --- a/features/marketplace/frontend-public/e2e/pages/CoopListPage.ts +++ b/features/marketplace/frontend-public/e2e/pages/CoopListPage.ts @@ -1,4 +1,6 @@ -import { Page, Locator, expect } from '@playwright/test'; +import { expect } from '@playwright/test'; + +import type { Page, Locator} from '@playwright/test'; /** * Page Object Model for Cooperative List Page diff --git a/features/marketplace/frontend-public/e2e/pages/DiscoveryQuotaPage.ts b/features/marketplace/frontend-public/e2e/pages/DiscoveryQuotaPage.ts index b24f66513..342a75097 100755 --- a/features/marketplace/frontend-public/e2e/pages/DiscoveryQuotaPage.ts +++ b/features/marketplace/frontend-public/e2e/pages/DiscoveryQuotaPage.ts @@ -1,6 +1,7 @@ -import type { Page, Locator } from '@playwright/test'; import { expect } from '@playwright/test'; +import type { Page, Locator } from '@playwright/test'; + /** * Page Object Model for Discovery Quota Components * diff --git a/features/marketplace/frontend-public/e2e/pages/DuoDashboardPage.ts b/features/marketplace/frontend-public/e2e/pages/DuoDashboardPage.ts index c6327291f..cc562d2e5 100644 --- a/features/marketplace/frontend-public/e2e/pages/DuoDashboardPage.ts +++ b/features/marketplace/frontend-public/e2e/pages/DuoDashboardPage.ts @@ -1,6 +1,7 @@ -import type { Page, Locator } from '@playwright/test' import { expect } from '@playwright/test' +import type { Page, Locator } from '@playwright/test' + /** * Page Object Model for Duo Dashboard Page * diff --git a/features/marketplace/frontend-public/e2e/pages/DuoDetailPage.ts b/features/marketplace/frontend-public/e2e/pages/DuoDetailPage.ts index 4e5dff21d..d664ac8f1 100644 --- a/features/marketplace/frontend-public/e2e/pages/DuoDetailPage.ts +++ b/features/marketplace/frontend-public/e2e/pages/DuoDetailPage.ts @@ -1,6 +1,7 @@ -import type { Page, Locator } from '@playwright/test' import { expect } from '@playwright/test' +import type { Page, Locator } from '@playwright/test' + /** * Page Object Model for Duo Detail Page * diff --git a/features/marketplace/frontend-public/e2e/pages/FriendRequestsPage.ts b/features/marketplace/frontend-public/e2e/pages/FriendRequestsPage.ts index 9d7ff7b68..f2275ff10 100644 --- a/features/marketplace/frontend-public/e2e/pages/FriendRequestsPage.ts +++ b/features/marketplace/frontend-public/e2e/pages/FriendRequestsPage.ts @@ -1,6 +1,7 @@ -import type { Page, Locator } from '@playwright/test' import { expect } from '@playwright/test' +import type { Page, Locator } from '@playwright/test' + /** * Page Object Model for Friend Requests Page * diff --git a/features/marketplace/frontend-public/e2e/pages/FriendsDashboardPage.ts b/features/marketplace/frontend-public/e2e/pages/FriendsDashboardPage.ts index 5ac90fd16..b078a550e 100644 --- a/features/marketplace/frontend-public/e2e/pages/FriendsDashboardPage.ts +++ b/features/marketplace/frontend-public/e2e/pages/FriendsDashboardPage.ts @@ -1,6 +1,7 @@ -import type { Page, Locator } from '@playwright/test' import { expect } from '@playwright/test' +import type { Page, Locator } from '@playwright/test' + /** * Page Object Model for Friends Dashboard * diff --git a/features/marketplace/frontend-public/e2e/pages/InfoPage.ts b/features/marketplace/frontend-public/e2e/pages/InfoPage.ts index 4ecfecff4..647630a55 100755 --- a/features/marketplace/frontend-public/e2e/pages/InfoPage.ts +++ b/features/marketplace/frontend-public/e2e/pages/InfoPage.ts @@ -1,4 +1,6 @@ -import { Page, Locator, expect } from '@playwright/test' +import { expect } from '@playwright/test' + +import type { Page, Locator} from '@playwright/test'; /** * Page Object Model for Info Pages @@ -88,9 +90,7 @@ export class InfoPage { // Get computed styles for gradient verification async getIconColor(): Promise { - return this.hero.icon.evaluate((el) => { - return window.getComputedStyle(el).color - }) + return this.hero.icon.evaluate((el) => window.getComputedStyle(el).color) } async getIconWrapperAccentColor(): Promise { @@ -154,16 +154,12 @@ export class InfoPage { } async getHeroPadding(): Promise { - return this.hero.container.evaluate((el) => { - return window.getComputedStyle(el).padding - }) + return this.hero.container.evaluate((el) => window.getComputedStyle(el).padding) } // Animation checks async checkReducedMotionSupport(): Promise { - return this.page.evaluate(() => { - return window.matchMedia('(prefers-reduced-motion: reduce)').matches - }) + return this.page.evaluate(() => window.matchMedia('(prefers-reduced-motion: reduce)').matches) } async checkIconGlowAnimated(): Promise { @@ -190,7 +186,7 @@ export class InfoPage { return this.hero.icon.evaluate((el) => { // Check SVG element const svg = el.querySelector('svg') - if (!svg) return 'unknown' + if (!svg) {return 'unknown'} // Try to identify icon by unique characteristics const paths = svg.querySelectorAll('path') diff --git a/features/marketplace/frontend-public/e2e/pages/LandingPage.ts b/features/marketplace/frontend-public/e2e/pages/LandingPage.ts index c29f3704f..c45ee636b 100755 --- a/features/marketplace/frontend-public/e2e/pages/LandingPage.ts +++ b/features/marketplace/frontend-public/e2e/pages/LandingPage.ts @@ -1,4 +1,6 @@ -import { Page, Locator, expect } from '@playwright/test' +import { expect } from '@playwright/test' + +import type { Page, Locator} from '@playwright/test'; /** * Page Object Model for Landing Pages diff --git a/features/marketplace/frontend-public/e2e/pages/MarketplaceBrowsePage.ts b/features/marketplace/frontend-public/e2e/pages/MarketplaceBrowsePage.ts index b8d8c8bf2..56a3506eb 100755 --- a/features/marketplace/frontend-public/e2e/pages/MarketplaceBrowsePage.ts +++ b/features/marketplace/frontend-public/e2e/pages/MarketplaceBrowsePage.ts @@ -1,7 +1,9 @@ -import type { Page, Locator } from '@playwright/test' import { expect } from '@playwright/test' + import { MarketplaceFilterSidebar } from './MarketplaceFilterSidebar' +import type { Page, Locator } from '@playwright/test' + /** * Page Object Model for Marketplace Browse Page * diff --git a/features/marketplace/frontend-public/e2e/pages/MarketplaceFilterSidebar.ts b/features/marketplace/frontend-public/e2e/pages/MarketplaceFilterSidebar.ts index e321c8426..e87a6f342 100755 --- a/features/marketplace/frontend-public/e2e/pages/MarketplaceFilterSidebar.ts +++ b/features/marketplace/frontend-public/e2e/pages/MarketplaceFilterSidebar.ts @@ -1,6 +1,7 @@ -import type { Page, Locator } from '@playwright/test' import { expect } from '@playwright/test' +import type { Page, Locator } from '@playwright/test' + /** * Page Object Model for Marketplace Filter Sidebar * diff --git a/features/marketplace/frontend-public/e2e/pages/ProfileCompletionBannerPage.ts b/features/marketplace/frontend-public/e2e/pages/ProfileCompletionBannerPage.ts index e4dcafe8f..bad285ce1 100644 --- a/features/marketplace/frontend-public/e2e/pages/ProfileCompletionBannerPage.ts +++ b/features/marketplace/frontend-public/e2e/pages/ProfileCompletionBannerPage.ts @@ -4,9 +4,10 @@ * Encapsulates interactions with the profile completion banner that appears on dashboard. */ -import type { Page, Locator } from '@playwright/test'; import { expect } from '@playwright/test'; +import type { Page, Locator } from '@playwright/test'; + export class ProfileCompletionBannerPage { readonly page: Page; readonly banner: Locator;