react-code-dataset / wp-calypso /packages /calypso-e2e /src /lib /pages /subscription-management-page.ts
react-code-dataset / wp-calypso /packages /calypso-e2e /src /lib /pages /subscription-management-page.ts
Download wp-calypso/packages/calypso-e2e/src/lib/pages/subscription-management-page.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 819 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/calypso-e2e/src/lib/pages/subscription-management-page.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/calypso-e2e/src/lib/pages/subscription-management-page.ts
-
curl -L -o subscription-management-page.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/calypso-e2e/src/lib/pages/subscription-management-page.ts
819 Bytes
| import { Locator, Page } from 'playwright'; | |
| /** | |
| * Represents the Subscription Management page, accessed under | |
| * /subscriptions/sites when confirming subscription to a site. | |
| */ | |
| export class SubscriptionManagementPage { | |
| private page: Page; | |
| private anchor: Locator; | |
| /** | |
| * Constructs an instance of the component. | |
| * | |
| * @param {Page} page The underlying page | |
| */ | |
| constructor( page: Page ) { | |
| this.page = page; | |
| this.anchor = this.page.getByRole( 'main' ); | |
| } | |
| /** | |
| * Validates the user is subscribed to a specific site, either by | |
| * the site name or the site URL. | |
| * | |
| * @param {string} identifier Identifier to locate the site, either | |
| * the site name or the URL. | |
| */ | |
| async validateSiteSubscribed( identifier: string ) { | |
| await this.anchor.getByRole( 'link', { name: identifier } ).waitFor(); | |
| } | |
| } | |