Download wp-calypso/test/e2e/specs/settings/settings__database-phpmyadmin.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.86 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/test/e2e/specs/settings/settings__database-phpmyadmin.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/test/e2e/specs/settings/settings__database-phpmyadmin.ts
-
curl -L -o settings__database-phpmyadmin.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/test/e2e/specs/settings/settings__database-phpmyadmin.ts
1.86 kB
| /** | |
| * @group jetpack-wpcom-integration | |
| * @group calypso-pr | |
| */ | |
| import { | |
| DataHelper, | |
| TestAccount, | |
| envVariables, | |
| getTestAccountByFeature, | |
| envToFeatureKey, | |
| SiteSettingsPage, | |
| } from '@automattic/calypso-e2e'; | |
| import { Page, Browser } from 'playwright'; | |
| import { skipDescribeIf } from '../../jest-helpers'; | |
| declare const browser: Browser; | |
| /** | |
| * Checks the phpMyAdmin page opens with the proper bearer token. | |
| * | |
| * See: https://github.com/Automattic/wp-calypso/issues/82850. | |
| * | |
| * Keywords: Settings, Jetpack, Hosting Configuration, phpMyAdmin | |
| */ | |
| skipDescribeIf( ! envVariables.TEST_ON_ATOMIC )( | |
| DataHelper.createSuiteTitle( 'Settings: Access phpMyAdmin' ), | |
| function () { | |
| const accountName = getTestAccountByFeature( envToFeatureKey( envVariables ) ); | |
| let page: Page; | |
| let popupPage: Page; | |
| let testAccount: TestAccount; | |
| let siteSettingsPage: SiteSettingsPage; | |
| beforeAll( async function () { | |
| page = await browser.newPage(); | |
| testAccount = new TestAccount( accountName ); | |
| await testAccount.authenticate( page ); | |
| } ); | |
| it( 'Navigate to Settings > Hosting Configuration', async function () { | |
| siteSettingsPage = new SiteSettingsPage( page ); | |
| await siteSettingsPage.visit( testAccount.getSiteURL( { protocol: false } ), 'database' ); | |
| } ); | |
| it( 'Open phpMyAdmin', async function () { | |
| const waitForPopup = page.waitForEvent( 'popup' ); | |
| await siteSettingsPage.clickButton( 'Open phpMyAdmin' ); | |
| popupPage = await waitForPopup; | |
| } ); | |
| it( 'phpMyAdmin page URL contains token', async function () { | |
| const url = popupPage.url(); | |
| expect( url ).toMatch( /token=([A-Za-z0-9-_]*\.[A-Za-z0-9-_]*\.[A-Za-z0-9-_]*$)/ ); | |
| } ); | |
| it( 'Land in phpMyAdmin', async function () { | |
| await popupPage.waitForURL( /_pma/ ); | |
| await popupPage.getByRole( 'link', { name: 'phpMyAdmin', exact: true } ).waitFor(); | |
| } ); | |
| } | |
| ); | |