-
Notifications
You must be signed in to change notification settings - Fork 798
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Social | Add e2e test for publicize activation from the editor (#40378)
* Enhance Block Editor E2E utility class * Social | Add e2e test for publicize activation from the editor * Improve social sidebar test * Add changelog * Trigger Jetpack E2E tests * Update test path * Update e2e-matrix.js * Update the test for the updated link
- Loading branch information
1 parent
1a0a361
commit 8ef292d
Showing
7 changed files
with
177 additions
and
13 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
5 changes: 5 additions & 0 deletions
5
projects/plugins/jetpack/changelog/add-e2e-test-for-publicize-activation-from-the-editor
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,5 @@ | ||
Significance: patch | ||
Type: other | ||
Comment: Social | Added e2e test for publicize activation from the editor | ||
|
||
|
48 changes: 48 additions & 0 deletions
48
projects/plugins/jetpack/tests/e2e/specs/editor/sidebar-social.test.js
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,48 @@ | ||
import { prerequisitesBuilder } from 'jetpack-e2e-commons/env/index.js'; | ||
import { expect, test } from 'jetpack-e2e-commons/fixtures/base-test.js'; | ||
import logger from 'jetpack-e2e-commons/logger.js'; | ||
import { BlockEditorPage } from 'jetpack-e2e-commons/pages/wp-admin/index.js'; | ||
|
||
test.beforeEach( async ( { page } ) => { | ||
await prerequisitesBuilder( page ) | ||
.withCleanEnv() | ||
.withLoggedIn( true ) | ||
.withWpComLoggedIn( true ) | ||
.withConnection( true ) | ||
.build(); | ||
} ); | ||
|
||
test.describe( 'Editor sidebar: Social', () => { | ||
test( 'Activation of publicize from the editor', async ( { page } ) => { | ||
logger.sync( 'Creating new post' ); | ||
|
||
/** | ||
* @type {BlockEditorPage} | ||
*/ | ||
const blockEditor = await BlockEditorPage.visit( page ); | ||
|
||
await page.waitForURL( '**/post-new.php' ); | ||
await blockEditor.waitForEditor(); | ||
|
||
logger.action( 'Close "Welcome to the block editor" dialog' ); | ||
await blockEditor.closeWelcomeGuide(); | ||
|
||
logger.action( 'Open Jetpack sidebar' ); | ||
await blockEditor.openSettings( 'Jetpack' ); | ||
|
||
const settingsSidebar = blockEditor.getEditorSettingsSidebar(); | ||
|
||
const socialPanel = settingsSidebar.getByRole( 'button', { | ||
name: 'Share this post', | ||
} ); | ||
|
||
logger.action( 'Expand "Share this post" panel' ); | ||
await socialPanel.click(); | ||
|
||
const activateSocialLink = settingsSidebar.getByRole( 'link', { | ||
name: 'Activate Jetpack Social', | ||
} ); | ||
|
||
await expect( activateSocialLink ).toBeVisible(); | ||
} ); | ||
} ); |
5 changes: 5 additions & 0 deletions
5
projects/plugins/social/changelog/add-e2e-test-for-publicize-activation-from-the-editor
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,5 @@ | ||
Significance: patch | ||
Type: changed | ||
Comment: Updated E2E test | ||
|
||
|
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