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/tests/admin/analytics/post-analytics/overview.test.ts

49 lines
1.9 KiB

import {test, expect} from '../../../../helpers/playwright';
import {
AnalyticsOverviewPage,
PostAnalyticsPage,
PostAnalyticsGrowthPage,
PostAnalyticsWebTrafficPage
} from '../../../../helpers/pages/admin';
test.describe('Ghost Admin - Post Analytics - Overview', () => {
test.beforeEach(async ({page}) => {
const analyticsOverviewPage = new AnalyticsOverviewPage(page);
await analyticsOverviewPage.goto();
await analyticsOverviewPage.latestPost.analyticsButton.click();
});
test('empty page with all tabs', async ({page}) => {
const postAnalyticsPage = new PostAnalyticsPage(page);
await expect(postAnalyticsPage.overviewButton).toBeVisible();
await expect(postAnalyticsPage.webTrafficButton).toBeVisible();
await expect(postAnalyticsPage.growthButton).toBeVisible();
});
test('empty page - overview - web performance - view more', async ({page}) => {
const postAnalyticsPage = new PostAnalyticsPage(page);
await postAnalyticsPage.webPerformanceSection.viewMoreButton.click();
const postAnalyticsWebTrafficPage = new PostAnalyticsWebTrafficPage(page);
await expect(postAnalyticsWebTrafficPage.body).toContainText('No visitors in the last 30 days');
});
test('empty page - overview - growth', async ({page}) => {
const postAnalyticsPage = new PostAnalyticsPage(page);
await expect(postAnalyticsPage.growthSection.card).toContainText('Free members');
await expect(postAnalyticsPage.growthSection.card).toContainText('0');
});
test('empty page - overview - growth - view more', async ({page}) => {
const postAnalyticsPage = new PostAnalyticsPage(page);
await postAnalyticsPage.growthSection.viewMoreButton.click();
const postAnalyticsGrowthPage = new PostAnalyticsGrowthPage(page);
await expect(postAnalyticsGrowthPage.topSourcesCard).toContainText('No sources data available');
});
});