Download wp-calypso/test/e2e/specs/plugins/plugins__purchase.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.88 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/test/e2e/specs/plugins/plugins__purchase.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/test/e2e/specs/plugins/plugins__purchase.ts
-
curl -L -o plugins__purchase.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/test/e2e/specs/plugins/plugins__purchase.ts
1.88 kB
| /** | |
| * @group calypso-release | |
| */ | |
| import { | |
| CartCheckoutPage, | |
| TestAccount, | |
| RestAPIClient, | |
| BrowserManager, | |
| SecretsManager, | |
| PluginsPage, | |
| } from '@automattic/calypso-e2e'; | |
| import { Page, Browser } from 'playwright'; | |
| declare const browser: Browser; | |
| describe( 'Plugins: Add multiple to cart', function () { | |
| const credentials = SecretsManager.secrets.testAccounts.simpleSiteFreePlanUser; | |
| const plugin1Name = 'Sensei Pro'; | |
| const plugin2Name = 'AutomateWoo'; | |
| let pluginsPage: PluginsPage; | |
| let cartCheckoutPage: CartCheckoutPage; | |
| let page: Page; | |
| let restAPIClient: RestAPIClient; | |
| let testAccount: TestAccount; | |
| beforeAll( async function () { | |
| page = await browser.newPage(); | |
| testAccount = new TestAccount( 'simpleSiteFreePlanUser' ); | |
| await testAccount.authenticate( page ); | |
| restAPIClient = new RestAPIClient( testAccount.credentials ); | |
| await restAPIClient.clearShoppingCart( | |
| testAccount.credentials.testSites?.primary.id as number | |
| ); | |
| await BrowserManager.setStoreCookie( page ); | |
| pluginsPage = new PluginsPage( page ); | |
| } ); | |
| describe.each( [ plugin1Name, plugin2Name ] )( 'Add %s plugin to cart', function ( pluginName ) { | |
| it( `Go to plugins page for ${ pluginName }`, async function () { | |
| await pluginsPage.visitPage( | |
| pluginName.toLowerCase().replace( ' ', '-' ), | |
| testAccount.credentials.testSites?.primary.url | |
| ); | |
| } ); | |
| it( 'Click on install button', async function () { | |
| await pluginsPage.clickInstallPlugin(); | |
| } ); | |
| it.each( [ 'WordPress.com', pluginName ] )( '%s is added to cart', async function ( target ) { | |
| cartCheckoutPage = new CartCheckoutPage( page ); | |
| await cartCheckoutPage.validateCartItem( target ); | |
| } ); | |
| } ); | |
| afterAll( async function () { | |
| const restAPIClient = new RestAPIClient( credentials ); | |
| await restAPIClient.clearShoppingCart( credentials.testSites?.primary?.id as number ); | |
| } ); | |
| } ); | |