UNPKG

external-services-automation

Version:

External services automation library for Playwright and Cucumber

26 lines (25 loc) 1.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UpdateSubscriptionPage = void 0; const test_1 = require("@playwright/test"); class UpdateSubscriptionPage { constructor(page) { this.page = page; this.pageContainer = page.locator('[data-testid="page-container-main"], .Box-root').first(); this.planCardsContainer = page.locator('[data-testid="pricing-table"]'); this.continueButton = page.locator('button:has-text("Continue"), [data-testid="continue-button"], a:has-text("Continue"), a[role="button"]:has-text("Continue")'); this.backButton = page.locator('button:has-text("Back"), [data-testid="back-button"], a:has-text("Back"), a[role="button"]:has-text("Back")'); this.selectPlanButton = (planType) => this.page.locator(`//div[contains(text(),'${planType.charAt(0).toUpperCase() + planType.slice(1)}')]/ancestor::div[@data-testid='pricing-table-card']//span[text()='Select']`); } async selectPlan(planType) { await this.selectPlanButton(planType).click(); } async clickContinue() { await this.continueButton.click(); } async isOnUpdateSubscriptionPage() { await (0, test_1.expect)(this.pageContainer).toBeVisible(); await (0, test_1.expect)(this.planCardsContainer).toBeVisible(); } } exports.UpdateSubscriptionPage = UpdateSubscriptionPage;