-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add smoke test for Social on Simple sites
- Loading branch information
1 parent
061c55a
commit b137276
Showing
2 changed files
with
87 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* @group calypso-pr | ||
* @group jetpack-wpcom-integration | ||
*/ | ||
|
||
import { DataHelper, EditorPage, SecretsManager, TestAccount } from '@automattic/calypso-e2e'; | ||
import { Browser, Page } from 'playwright'; | ||
|
||
declare const browser: Browser; | ||
|
||
/** | ||
* Tests features offered by Jetpack Social. | ||
* | ||
* Keywords: Social, Jetpack, Publicize | ||
*/ | ||
describe( DataHelper.createSuiteTitle( 'Social: Editor Smoke test' ), function () { | ||
let page: Page; | ||
let editorPage: EditorPage; | ||
|
||
const siteSlug = | ||
SecretsManager.secrets.testAccounts.simpleSiteFreePlanUser.testSites?.primary.url; | ||
|
||
beforeAll( async () => { | ||
page = await browser.newPage(); | ||
editorPage = new EditorPage( page ); | ||
|
||
const testAccount = new TestAccount( 'simpleSiteFreePlanUser' ); | ||
await testAccount.authenticate( page ); | ||
} ); | ||
|
||
it( 'Verify that Social UI is visible', async function () { | ||
await editorPage.visit( 'post', { siteSlug } ); | ||
|
||
// Open the Jetpack sidebar. | ||
await editorPage.openSettings( 'Jetpack' ); | ||
|
||
// Expand the Publicize panel. | ||
await editorPage.expandSection( 'Share this post' ); | ||
|
||
const editorParent = await editorPage.getEditorParent(); | ||
|
||
const toggle = editorParent.getByLabel( 'Share when publishing' ); | ||
|
||
expect( await toggle.isChecked() ).toBe( false ); | ||
|
||
const link = editorParent.getByRole( 'link', { name: 'Connect an account' } ); | ||
|
||
expect( await link.isVisible() ).toBe( true ); | ||
} ); | ||
} ); |