File size: 1,026 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
/**
 * @group calypso-pr
 * @group jetpack-remote-site
 */

import {
	DataHelper,
	TestAccount,
	ReaderPage,
	TestAccountName,
	envVariables,
} from '@automattic/calypso-e2e';
import { Page, Browser } from 'playwright';

declare const browser: Browser;

describe( DataHelper.createSuiteTitle( 'Reader: View' ), function () {
	let page: Page;
	let readerPage: ReaderPage;
	const accountName: TestAccountName =
		envVariables.JETPACK_TARGET === 'remote-site' ? 'jetpackRemoteSiteUser' : 'commentingUser';
	let testAccount: TestAccount;

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

	it( 'Visit the Reader', async function () {
		readerPage = new ReaderPage( page );
		await readerPage.visit();
	} );

	it( 'Reader stream is present', async function () {
		await Promise.any( [
			page.getByRole( 'link', { name: 'Find sites to follow' } ),
			page.getByRole( 'main' ).getByRole( 'article' ),
		] );
	} );
} );