mirror of https://github.com/nocodb/nocodb
Anbarasu
1 year ago
committed by
GitHub
10 changed files with 170 additions and 4 deletions
After Width: | Height: | Size: 1.4 KiB |
@ -0,0 +1,39 @@ |
|||||||
|
import BasePage from '../../Base'; |
||||||
|
import { DashboardPage } from '..'; |
||||||
|
|
||||||
|
export class CmdJ extends BasePage { |
||||||
|
readonly dashboardPage: DashboardPage; |
||||||
|
|
||||||
|
constructor(dashboard: DashboardPage) { |
||||||
|
super(dashboard.rootPage); |
||||||
|
this.dashboardPage = dashboard; |
||||||
|
} |
||||||
|
|
||||||
|
get() { |
||||||
|
return this.dashboardPage.get().locator('.DocSearch'); |
||||||
|
} |
||||||
|
|
||||||
|
async openCmdJ() { |
||||||
|
await this.dashboardPage.rootPage.keyboard.press(this.isMacOs() ? 'Meta+J' : 'Control+J'); |
||||||
|
// await this.dashboardPage.rootPage.waitForSelector('.DocSearch-Input');
|
||||||
|
} |
||||||
|
|
||||||
|
async searchText(text: string) { |
||||||
|
await this.dashboardPage.rootPage.fill('.DocSearch-Input', text); |
||||||
|
} |
||||||
|
|
||||||
|
async isCmdJVisible() { |
||||||
|
const isVisible = this.get(); |
||||||
|
return await isVisible.count(); |
||||||
|
} |
||||||
|
|
||||||
|
async isCmdJNotVisible() { |
||||||
|
const isNotVisible = this.get(); |
||||||
|
return await isNotVisible.count(); |
||||||
|
} |
||||||
|
|
||||||
|
async getPlaceholderText() { |
||||||
|
const placeholderText = this.get().locator('.DocSearch-Input'); |
||||||
|
return await placeholderText.innerText(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,35 @@ |
|||||||
|
import BasePage from '../../Base'; |
||||||
|
import { DashboardPage } from '..'; |
||||||
|
|
||||||
|
export class CmdK extends BasePage { |
||||||
|
readonly dashboardPage: DashboardPage; |
||||||
|
|
||||||
|
constructor(dashboard: DashboardPage) { |
||||||
|
super(dashboard.rootPage); |
||||||
|
this.dashboardPage = dashboard; |
||||||
|
} |
||||||
|
|
||||||
|
get() { |
||||||
|
return this.dashboardPage.get().locator('.cmdk-modal.cmdk-modal-active'); |
||||||
|
} |
||||||
|
|
||||||
|
async openCmdK() { |
||||||
|
await this.dashboardPage.rootPage.keyboard.press(this.isMacOs() ? 'Meta+K' : 'Control+K'); |
||||||
|
// await this.dashboardPage.rootPage.waitForSelector('.DocSearch-Input');
|
||||||
|
} |
||||||
|
|
||||||
|
async searchText(text: string) { |
||||||
|
await this.dashboardPage.rootPage.fill('.cmdk-input', text); |
||||||
|
await this.rootPage.keyboard.press('Enter'); |
||||||
|
} |
||||||
|
|
||||||
|
async isCmdKVisible() { |
||||||
|
const isVisible = this.get(); |
||||||
|
return await isVisible.count(); |
||||||
|
} |
||||||
|
|
||||||
|
async isCmdKNotVisible() { |
||||||
|
const isNotVisible = this.get(); |
||||||
|
return await isNotVisible.count(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,49 @@ |
|||||||
|
import BasePage from '../../Base'; |
||||||
|
import { DashboardPage } from '..'; |
||||||
|
|
||||||
|
export class CmdL extends BasePage { |
||||||
|
readonly dashboardPage: DashboardPage; |
||||||
|
|
||||||
|
constructor(dashboard: DashboardPage) { |
||||||
|
super(dashboard.rootPage); |
||||||
|
this.dashboardPage = dashboard; |
||||||
|
} |
||||||
|
|
||||||
|
get() { |
||||||
|
return this.dashboardPage.get().locator('.cmdl-modal.cmdl-modal-active'); |
||||||
|
} |
||||||
|
|
||||||
|
async openCmdL() { |
||||||
|
await this.dashboardPage.rootPage.keyboard.press(this.isMacOs() ? 'Meta+L' : 'Control+L'); |
||||||
|
} |
||||||
|
|
||||||
|
async isCmdLVisible() { |
||||||
|
const isVisible = this.get(); |
||||||
|
return await isVisible.count(); |
||||||
|
} |
||||||
|
|
||||||
|
async isCmdLNotVisible() { |
||||||
|
const isNotVisible = this.get(); |
||||||
|
return await isNotVisible.count(); |
||||||
|
} |
||||||
|
|
||||||
|
async moveDown() { |
||||||
|
await this.dashboardPage.rootPage.keyboard.press('ArrowDown'); |
||||||
|
} |
||||||
|
|
||||||
|
async moveUp() { |
||||||
|
await this.dashboardPage.rootPage.keyboard.press('ArrowUp'); |
||||||
|
} |
||||||
|
|
||||||
|
async openRecent() { |
||||||
|
await this.dashboardPage.rootPage.keyboard.press('Enter'); |
||||||
|
} |
||||||
|
|
||||||
|
async getActiveViewTitle() { |
||||||
|
return await this.dashboardPage.get().locator('.nc-active-view-title').innerText(); |
||||||
|
} |
||||||
|
|
||||||
|
async getActiveTableTitle() { |
||||||
|
return await this.dashboardPage.get().locator('.nc-active-table-title').innerText(); |
||||||
|
} |
||||||
|
} |
Loading…
Reference in new issue