dididy commented on code in PR #5101: URL: https://github.com/apache/zeppelin/pull/5101#discussion_r2466384224
########## zeppelin-web-angular/e2e/models/notebook-keyboard-page.ts: ########## @@ -0,0 +1,1056 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import test, { expect, Locator, Page } from '@playwright/test'; +import { BasePage } from './base-page'; + +export class NotebookKeyboardPage extends BasePage { + readonly codeEditor: Locator; + readonly paragraphContainer: Locator; + readonly firstParagraph: Locator; + readonly runButton: Locator; + readonly paragraphResult: Locator; + readonly newParagraphButton: Locator; + readonly interpreterSelector: Locator; + readonly interpreterDropdown: Locator; + readonly autocompletePopup: Locator; + readonly autocompleteItems: Locator; + readonly paragraphTitle: Locator; + readonly editorLines: Locator; + readonly cursorLine: Locator; + readonly settingsButton: Locator; + readonly clearOutputOption: Locator; + readonly deleteButton: Locator; + + constructor(page: Page) { + super(page); + this.codeEditor = page.locator('.monaco-editor .monaco-mouse-cursor-text'); + this.paragraphContainer = page.locator('zeppelin-notebook-paragraph'); + this.firstParagraph = this.paragraphContainer.first(); + this.runButton = page.locator('button[title="Run this paragraph"], button:has-text("Run")'); + this.paragraphResult = page.locator('[data-testid="paragraph-result"]'); + this.newParagraphButton = page.locator('button:has-text("Add Paragraph"), .new-paragraph-button'); + this.interpreterSelector = page.locator('.interpreter-selector'); + this.interpreterDropdown = page.locator('nz-select[ng-reflect-nz-placeholder="Interpreter"]'); + this.autocompletePopup = page.locator('.monaco-editor .suggest-widget'); + this.autocompleteItems = page.locator('.monaco-editor .suggest-widget .monaco-list-row'); + this.paragraphTitle = page.locator('.paragraph-title'); + this.editorLines = page.locator('.monaco-editor .view-lines'); + this.cursorLine = page.locator('.monaco-editor .current-line'); + this.settingsButton = page.locator('a[nz-dropdown]'); + this.clearOutputOption = page.locator('li.list-item:has-text("Clear output")'); + this.deleteButton = page.locator('button:has-text("Delete"), .delete-paragraph-button'); + } + + async navigateToNotebook(noteId: string): Promise<void> { + if (!noteId) { + console.error('noteId is undefined or null. Cannot navigate to notebook.'); Review Comment: 36977fb Updated to handle it by throwing an Error. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
