多维表格
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
972 B

1 year ago
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');
1 year ago
await this.rootPage.keyboard.press('Enter');
1 year ago
}
async isCmdKVisible() {
const isVisible = this.get();
return await isVisible.count();
}
async isCmdKNotVisible() {
const isNotVisible = this.get();
return await isNotVisible.count();
}
}