chore: page more action

This commit is contained in:
Nathan
2025-08-17 16:29:44 +08:00
parent bc9f0b0874
commit cfeb82f90a
50 changed files with 2762 additions and 1126 deletions

View 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}');
}