File size: 1,203 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/**
 * @group calypso-pr
 * @group dashboard
 */

import {
	TestAccount,
	getTestAccountByFeature,
	envToFeatureKey,
	envVariables,
	DashboardPage,
} from '@automattic/calypso-e2e';
import { Page, Browser } from 'playwright';

declare const browser: Browser;

/**
 * Verifies the new dashboard under /v2 is functional.
 *
 * This is a basic test that just checks if the dashboard entry page loads correctly.
 */
describe( 'Dashboard: Basic Test', function () {
	let page: Page;
	let dashboardPage: DashboardPage;
	const accountName = getTestAccountByFeature( envToFeatureKey( envVariables ) );
	const testAccount = new TestAccount( accountName );

	beforeAll( async function () {
		page = await browser.newPage();
		await testAccount.authenticate( page );
		dashboardPage = new DashboardPage( page );
	} );

	it( 'Navigate to the dashboard entry page', async function () {
		await dashboardPage.visit();

		// Verify the dashboard loaded correctly
		const isLoaded = await dashboardPage.isLoaded();
		expect( isLoaded ).toBe( true );

		// Optional: Get and check the heading if relevant
		const headingText = await dashboardPage.getHeadingText();
		expect( headingText ).toEqual( 'Sites' );
	} );
} );