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.
ghost/e2e/helpers/pages/admin/analytics/post-analytics/PostAnalyticsGrowthPage.ts

29 lines
1.3 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import {Locator, Page} from '@playwright/test';
import {AdminPage} from '../../AdminPage';
/**
* PostAnalyticsGrowthPage
* 封装文章分析页面中 "Growth增长" 视图的定位器与基础交互。
* 该页面对象用于 e2e 测试中获取增长相关卡片(成员、来源)并执行简单操作。
*/
export class PostAnalyticsGrowthPage extends AdminPage {
// 成员统计卡片的容器定位器(使用 data-testid便于稳定定位
readonly membersCard: Locator;
// 成员卡片内的“View member”按钮用于导航到 Members 页面查看详情
readonly viewMemberButton: Locator;
// Top sources流量来源卡片的容器定位器
readonly topSourcesCard: Locator;
constructor(page: Page) {
super(page);
// 通过 data-testid 定位 members 卡片(包含免费/付费成员数等摘要)
this.membersCard = this.page.getByTestId('members-card');
// 在 members 卡片内定位名为 'View member' 的按钮(用于点击查看成员列表)
this.viewMemberButton = this.membersCard.getByRole('button', {name: 'View member'});
// 定位 top sources 卡片(显示访问来源,如直接、搜索、社交等)
this.topSourcesCard = this.page.getByTestId('top-sources-card');
}
}