mirror of
https://github.com/nocodb/nocodb.git
synced 2026-04-25 03:55:57 +00:00
fix: test
This commit is contained in:
@@ -43,7 +43,15 @@ export class ScriptsTopbar extends BasePage {
|
||||
await this.rootPage.waitForTimeout(500);
|
||||
}
|
||||
|
||||
async verifyRunButtonState(enabled: boolean) {
|
||||
async verifyRunButtonVisible(): Promise<void> {
|
||||
await expect(this.getRunButton()).toBeVisible();
|
||||
}
|
||||
|
||||
async verifyRunButtonEnabled(): Promise<void> {
|
||||
await expect(this.getRunButton()).toBeEnabled();
|
||||
}
|
||||
|
||||
async verifyRunButtonState(enabled: boolean): Promise<void> {
|
||||
if (enabled) {
|
||||
await expect(this.getRunButton()).toBeEnabled();
|
||||
} else {
|
||||
|
||||
@@ -22,13 +22,26 @@ export class ScriptsPage extends BasePage {
|
||||
get() {
|
||||
return this.dashboardPage.get().locator('.nc-scripts-content-resizable-wrapper');
|
||||
}
|
||||
// Editor methods
|
||||
|
||||
getEditor() {
|
||||
return this.rootPage.getByTestId('nc-scripts-editor');
|
||||
}
|
||||
|
||||
async isEditorVisible(): Promise<boolean> {
|
||||
return await this.getEditor().isVisible();
|
||||
}
|
||||
|
||||
async getEditorContent(): Promise<string> {
|
||||
const editorContainer = this.rootPage.getByTestId('nc-scripts-editor');
|
||||
const editorContainer = this.getEditor();
|
||||
const content = await editorContainer.getAttribute('data-code');
|
||||
return content || '';
|
||||
}
|
||||
|
||||
async verifyEditorHasContent(): Promise<void> {
|
||||
const content = await this.getEditorContent();
|
||||
expect(content.length).toBeGreaterThan(0);
|
||||
}
|
||||
|
||||
async setEditorContent(
|
||||
content: string,
|
||||
scriptId: string,
|
||||
@@ -56,4 +69,27 @@ export class ScriptsPage extends BasePage {
|
||||
const content = await this.getEditorContent();
|
||||
expect(content).toContain(text);
|
||||
}
|
||||
|
||||
getBottomBar() {
|
||||
return this.dashboardPage.get().locator('.h-9.border-t-1');
|
||||
}
|
||||
|
||||
async toggleEditor(): Promise<void> {
|
||||
const toggleButton = this.getBottomBar().locator('button').first();
|
||||
await toggleButton.click();
|
||||
await this.rootPage.waitForTimeout(300);
|
||||
}
|
||||
|
||||
async verifyEditorToggleState(isOpen: boolean): Promise<void> {
|
||||
const toggleButton = this.getBottomBar().locator('button').first();
|
||||
if (isOpen) {
|
||||
await expect(toggleButton).toHaveClass(/bg-nc-bg-brand/);
|
||||
} else {
|
||||
await expect(toggleButton).not.toHaveClass(/bg-nc-bg-brand/);
|
||||
}
|
||||
}
|
||||
|
||||
async isPlaygroundVisible(): Promise<boolean> {
|
||||
return await this.playground.get().isVisible();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user