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/PostAnalyticsWebTrafficPage.ts

32 lines
1.5 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 {Page} from '@playwright/test';
import {AdminPage} from '../../AdminPage';
/**
* PostAnalyticsWebTrafficPage
* --------------------------
* Playwright 页面对象:用于封装文章级别的 “Web Traffic”网站流量分析视图的定位器与操作。
*
* 说明:
* - 该类当前只是继承自 AdminPage 的空壳,作为占位以便后续在文章分析页面中添加特定定位器与交互方法。
* - 推荐在此处添加常用的定位器例如图表容器、Top sources、Top content、时间范围切换等
* 以及便于测试的读取/切换方法(例如 getTotalViews(), clickTopSourcesTab() 等)。
*
* 示例 TODO可按需实现
* - this.webGraph = page.getByTestId('post-web-graph');
* - async getTotalViews() { return await this.webGraphLocator.textContent(); }
* - async selectTimeRange(range: '7d'|'30d'|'90d') { ... }
*
* 目的:把文章级别的流量相关交互都集中在此类,便于 e2e 测试重用与维护。
*/
export class PostAnalyticsWebTrafficPage extends AdminPage {
constructor(page: Page) {
super(page);
// TODO: 在这里初始化文章级 Web 流量页面的定位器,例如:
// this.pageUrl = '/ghost/#/editor/analytics/post/...'; // 如有需要可设置具体路由
//
// 示例(占位):
// this.webGraph = page.getByTestId('post-web-graph');
// this.topSourcesCard = page.getByTestId('post-top-sources-card');
}
}