|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { |
|
|
DataHelper, |
|
|
EditorPage, |
|
|
TestAccount, |
|
|
envVariables, |
|
|
envToFeatureKey, |
|
|
getTestAccountByFeature, |
|
|
} from '@automattic/calypso-e2e'; |
|
|
import { Page, Browser } from 'playwright'; |
|
|
|
|
|
declare const browser: Browser; |
|
|
|
|
|
describe( DataHelper.createSuiteTitle( 'Editor: Navbar' ), function () { |
|
|
const features = envToFeatureKey( envVariables ); |
|
|
|
|
|
|
|
|
const accountName = getTestAccountByFeature( features, [ |
|
|
{ |
|
|
gutenberg: 'stable', |
|
|
siteType: 'simple', |
|
|
accountName: 'simpleSitePersonalPlanUser', |
|
|
}, |
|
|
] ); |
|
|
|
|
|
let page: Page; |
|
|
let editorPage: EditorPage; |
|
|
|
|
|
beforeAll( async () => { |
|
|
page = await browser.newPage(); |
|
|
editorPage = new EditorPage( page ); |
|
|
|
|
|
const testAccount = new TestAccount( accountName ); |
|
|
await testAccount.authenticate( page ); |
|
|
} ); |
|
|
|
|
|
it( 'Go to the new post page', async function () { |
|
|
await editorPage.visit( 'post' ); |
|
|
} ); |
|
|
|
|
|
it( 'Return to Calypso dashboard', async function () { |
|
|
const WPAdminBarLocator = page.locator( '#wpadminbar' ); |
|
|
const isMobileClassicView = |
|
|
envVariables.VIEWPORT_NAME === 'mobile' && ( await WPAdminBarLocator.isVisible() ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( ! isMobileClassicView ) { |
|
|
await editorPage.exitEditor(); |
|
|
} |
|
|
} ); |
|
|
} ); |
|
|
|