Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix: test

DarkPhoenix270466827cf60c29
diff --git a/tests/playwright/pages/Dashboard/Scripts/Topbar.ts b/tests/playwright/pages/Dashboard/Scripts/Topbar.ts
index c756567b4e..04615f0b47 100644
--- a/tests/playwright/pages/Dashboard/Scripts/Topbar.ts
+++ b/tests/playwright/pages/Dashboard/Scripts/Topbar.ts
@@ -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 {
diff --git a/tests/playwright/pages/Dashboard/Scripts/index.ts b/tests/playwright/pages/Dashboard/Scripts/index.ts
index ee07f01ba3..09ee3f33a0 100644
--- a/tests/playwright/pages/Dashboard/Scripts/index.ts
+++ b/tests/playwright/pages/Dashboard/Scripts/index.ts
@@ -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();
+ }
}