feat(admin): 添加用户管理相关文件
添加用户管理视图、API和状态管理文件
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
import { Page } from 'playwright';
|
||||
|
||||
export class MiniProgramCalendarPage {
|
||||
constructor(private page: Page) {}
|
||||
|
||||
async navigate() {
|
||||
await this.page.goto('http://localhost:9527/#/pages/calendar/index');
|
||||
await this.page.waitForLoadState('networkidle');
|
||||
}
|
||||
|
||||
async getCurrentDate() {
|
||||
const currentDate = await this.page.locator('.current-date').textContent();
|
||||
return currentDate || '';
|
||||
}
|
||||
|
||||
async selectDate(date: string) {
|
||||
await this.page.click(`[data-date="${date}"]`);
|
||||
}
|
||||
|
||||
async getSelectedDate() {
|
||||
const selectedDate = await this.page.locator('.selected-date').textContent();
|
||||
return selectedDate || '';
|
||||
}
|
||||
|
||||
async navigateToNextMonth() {
|
||||
await this.page.click('.next-month');
|
||||
}
|
||||
|
||||
async navigateToPreviousMonth() {
|
||||
await this.page.click('.previous-month');
|
||||
}
|
||||
|
||||
async getCurrentMonth() {
|
||||
const currentMonth = await this.page.locator('.current-month').textContent();
|
||||
return currentMonth || '';
|
||||
}
|
||||
|
||||
async isDateVisible(date: string) {
|
||||
const dateElement = this.page.locator(`[data-date="${date}"]`);
|
||||
return await dateElement.isVisible();
|
||||
}
|
||||
|
||||
async isToday(date: string) {
|
||||
const todayElement = this.page.locator(`[data-date="${date}"].today`);
|
||||
return await todayElement.isVisible();
|
||||
}
|
||||
|
||||
async isWeekend(date: string) {
|
||||
const weekendElement = this.page.locator(`[data-date="${date}"].weekend`);
|
||||
return await weekendElement.isVisible();
|
||||
}
|
||||
|
||||
async getCalendarEvents() {
|
||||
const events = await this.page.locator('.calendar-event').allTextContents();
|
||||
return events;
|
||||
}
|
||||
|
||||
async hasEvent(date: string) {
|
||||
const eventIndicator = this.page.locator(`[data-date="${date}"] .event-indicator`);
|
||||
return await eventIndicator.isVisible();
|
||||
}
|
||||
|
||||
async tapDate(date: string) {
|
||||
await this.page.tap(`[data-date="${date}"]`);
|
||||
}
|
||||
|
||||
async longPressDate(date: string) {
|
||||
const element = this.page.locator(`[data-date="${date}"]`);
|
||||
await element.tap();
|
||||
await this.page.waitForTimeout(500);
|
||||
}
|
||||
|
||||
async swipeLeft() {
|
||||
await this.page.touchscreen.tap(0, 0);
|
||||
await this.page.touchscreen.tap(100, 0);
|
||||
}
|
||||
|
||||
async swipeRight() {
|
||||
await this.page.touchscreen.tap(100, 0);
|
||||
await this.page.touchscreen.tap(0, 0);
|
||||
}
|
||||
|
||||
async getMonthView() {
|
||||
const monthView = await this.page.locator('.calendar-month').textContent();
|
||||
return monthView || '';
|
||||
}
|
||||
|
||||
async getWeekDays() {
|
||||
const weekDays = await this.page.locator('.week-day').allTextContents();
|
||||
return weekDays;
|
||||
}
|
||||
|
||||
async getDatesInMonth() {
|
||||
const dates = await this.page.locator('.calendar-date').allTextContents();
|
||||
return dates;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user