mirror of
https://github.com/AppFlowy-IO/AppFlowy-Web.git
synced 2025-11-29 19:08:33 +08:00
chore: page more action
This commit is contained in:
38
cypress/support/page/pages.ts
Normal file
38
cypress/support/page/pages.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
/// <reference types="cypress" />
|
||||
|
||||
// ========== Page Management ==========
|
||||
|
||||
export function getPageNames() {
|
||||
return cy.get('[data-testid="page-name"]');
|
||||
}
|
||||
|
||||
export function getPageByName(name: string) {
|
||||
return cy.get('[data-testid="page-name"]').contains(name);
|
||||
}
|
||||
|
||||
export function clickPageByName(name: string) {
|
||||
return getPageByName(name).click({ force: true });
|
||||
}
|
||||
|
||||
export function getPageById(viewId: string) {
|
||||
return cy.get(`[data-testid="page-${viewId}"]`);
|
||||
}
|
||||
|
||||
export function getPageTitleInput() {
|
||||
return cy.get('[data-testid="page-title-input"]', { timeout: 30000 });
|
||||
}
|
||||
|
||||
export function enterPageTitle(title: string) {
|
||||
return getPageTitleInput()
|
||||
.should('be.visible')
|
||||
.first()
|
||||
.click({ force: true })
|
||||
.clear({ force: true })
|
||||
.type(title, { force: true });
|
||||
}
|
||||
|
||||
export function savePageTitle() {
|
||||
return getPageTitleInput().first().type('{esc}');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user