react-code-dataset / wp-calypso /packages /calypso-e2e /src /lib /components /full-site-editor-save-panel-component.ts
react-code-dataset / wp-calypso /packages /calypso-e2e /src /lib /components /full-site-editor-save-panel-component.ts
Download wp-calypso/packages/calypso-e2e/src/lib/components/full-site-editor-save-panel-component.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 916 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/calypso-e2e/src/lib/components/full-site-editor-save-panel-component.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/packages/calypso-e2e/src/lib/components/full-site-editor-save-panel-component.ts
-
curl -L -o full-site-editor-save-panel-component.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/packages/calypso-e2e/src/lib/components/full-site-editor-save-panel-component.ts
916 Bytes
| import { Page } from 'playwright'; | |
| import { EditorComponent } from './editor-component'; | |
| const panel = '.entities-saved-states__panel'; | |
| const selectors = { | |
| saveButton: `${ panel } button:has-text("Save")`, | |
| }; | |
| /** | |
| * Represents an instance of the FSE save confirmation panel (comparable publish panel). | |
| */ | |
| export class FullSiteEditorSavePanelComponent { | |
| 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; | |
| } | |
| /** | |
| * Publish or schedule the article. | |
| */ | |
| async confirmSave(): Promise< void > { | |
| const editorParent = await this.editor.parent(); | |
| const locator = editorParent.locator( selectors.saveButton ); | |
| await locator.click(); | |
| } | |
| } | |