react-code-dataset / wp-calypso /packages /calypso-e2e /src /lib /components /full-side-editor-data-views-component.ts
react-code-dataset / wp-calypso /packages /calypso-e2e /src /lib /components /full-side-editor-data-views-component.ts
Download wp-calypso/packages/calypso-e2e/src/lib/components/full-side-editor-data-views-component.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 891 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/calypso-e2e/src/lib/components/full-side-editor-data-views-component.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/calypso-e2e/src/lib/components/full-side-editor-data-views-component.ts
-
curl -L -o full-side-editor-data-views-component.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/calypso-e2e/src/lib/components/full-side-editor-data-views-component.ts
891 Bytes
| import { Page } from 'playwright'; | |
| import { EditorComponent } from './editor-component'; | |
| /** | |
| * Represents an instance of the WordPress.com FSE Editor's DataViews. | |
| * This is used for data layouts (e.g. tables, grids, and lists). | |
| */ | |
| export class FullSiteEditorDataViewsComponent { | |
| private page: Page; | |
| private editor: EditorComponent; | |
| /** | |
| * Constructs an instance of the component. | |
| * | |
| * @param {Page} page The underlying page. | |
| * @param {EditorComponent} editor The EditorComponent instance. | |
| */ | |
| constructor( page: Page, editor: EditorComponent ) { | |
| this.page = page; | |
| this.editor = editor; | |
| } | |
| /** | |
| * Clicks on a button with the exact name. | |
| */ | |
| async clickPrimaryFieldByExactText( primaryFieldText: string ): Promise< void > { | |
| const editorParent = await this.editor.parent(); | |
| await editorParent.getByRole( 'button', { name: primaryFieldText } ).first().click(); | |
| } | |
| } | |