first commit
This commit is contained in:
31
pages/DreamiExplorePage.ts
Normal file
31
pages/DreamiExplorePage.ts
Normal file
@ -0,0 +1,31 @@
|
||||
/**
|
||||
* DreamiExplore 页面对象
|
||||
* 封装 DreamiExplore 相关的操作
|
||||
*/
|
||||
|
||||
import { Page, expect } from '@playwright/test';
|
||||
import { BasePage } from './BasePage';
|
||||
|
||||
export class DreamiExplorePage extends BasePage {
|
||||
constructor(page: Page) {
|
||||
super(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 进入 DreamiExplore
|
||||
*/
|
||||
async enterDreamiExplore(): Promise<void> {
|
||||
await this.page.getByRole('link').filter({ hasText: 'DreamiExplore Everything' }).click();
|
||||
await expect(this.page.getByRole('heading', { name: 'Hello, Admin' })).toBeVisible();
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试聊天功能
|
||||
*/
|
||||
async testChatFunction(message: string = 'hello'): Promise<void> {
|
||||
await this.page.getByRole('textbox').click();
|
||||
await this.page.getByRole('textbox').fill(message);
|
||||
await this.page.getByRole('button', { name: 'send' }).click();
|
||||
await expect(this.page.getByRole('button', { name: '复制' })).toBeVisible({ timeout: 10000 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user