-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2521 from woocommerce/update/2487-hide-jetpack-e2…
…e-tests Update e2e tests for #2487
- Loading branch information
Showing
2 changed files
with
75 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,28 +79,6 @@ test.describe( 'Set up accounts', () => { | |
await expect( continueButton ).toBeDisabled(); | ||
} ); | ||
|
||
test( 'JetpackConnected: should verify that the Jetpack connect button is hidden if already connected', async () => { | ||
await setUpAccountsPage.goto(); | ||
|
||
await expect( | ||
page.getByRole( 'heading', { name: 'Set up your accounts' } ) | ||
).toBeVisible(); | ||
|
||
await expect( | ||
page.getByText( | ||
'Connect the accounts required to use Google for WooCommerce.' | ||
) | ||
).toBeVisible(); | ||
|
||
await expect( | ||
page.getByRole( 'button', { name: 'Connect' } ).first() | ||
).toBeEnabled(); | ||
|
||
const firstCard = setUpAccountsPage.getWPAccountCard(); | ||
await expect( firstCard ).toBeEnabled(); | ||
await expect( firstCard ).not.toContainText( 'WordPress.com' ); | ||
} ); | ||
|
||
test.describe( 'FAQ panels', () => { | ||
test( 'should see two questions in FAQ', async () => { | ||
const faqTitles = getFAQPanelTitle( page ); | ||
|
@@ -138,7 +116,7 @@ test.describe( 'Set up accounts', () => { | |
} ); | ||
} ); | ||
|
||
test.describe( 'Connect Google account', () => { | ||
test.describe( 'Connected WordPress.com account', async () => { | ||
test.beforeAll( async () => { | ||
// Mock Jetpack as connected | ||
await setUpAccountsPage.mockJetpackConnected( | ||
|
@@ -155,14 +133,44 @@ test.describe( 'Set up accounts', () => { | |
await setUpAccountsPage.goto(); | ||
} ); | ||
|
||
test( 'should see their WPORG email, "Google" title & connect button', async () => { | ||
const jetpackDescriptionRow = | ||
setUpAccountsPage.getJetpackDescriptionRow(); | ||
test( 'should not show the WP.org connection card when already connected', async () => { | ||
await expect( | ||
page.getByRole( 'heading', { name: 'Set up your accounts' } ) | ||
).toBeVisible(); | ||
|
||
await expect( | ||
page.getByText( | ||
'Connect the accounts required to use Google for WooCommerce.' | ||
) | ||
).toBeVisible(); | ||
|
||
await expect( jetpackDescriptionRow ).toContainText( | ||
await expect( | ||
page.getByRole( 'button', { name: 'Connect' } ).first() | ||
).toBeEnabled(); | ||
|
||
const wpAccountCard = setUpAccountsPage.getWPAccountCard(); | ||
await expect( wpAccountCard ).not.toBeVisible(); | ||
} ); | ||
} ); | ||
|
||
test.describe( 'Connect Google account', () => { | ||
test.beforeAll( async () => { | ||
// Mock Jetpack as connected | ||
await setUpAccountsPage.mockJetpackConnected( | ||
'Test user', | ||
'[email protected]' | ||
); | ||
|
||
// Mock google as not connected. | ||
// When pending even WPORG will not render yet. | ||
// If not mocked will fail and render nothing, | ||
// as Jetpack is mocked only on the client-side. | ||
await setUpAccountsPage.mockGoogleNotConnected(); | ||
|
||
await setUpAccountsPage.goto(); | ||
} ); | ||
|
||
test( 'should see their WPORG email, "Google" title & connect button', async () => { | ||
const googleAccountCard = setUpAccountsPage.getGoogleAccountCard(); | ||
|
||
await expect( | ||
|
@@ -415,12 +423,6 @@ test.describe( 'Set up accounts', () => { | |
} ); | ||
|
||
test( 'should see their WPORG email, Google email, "Google Merchant Center" title & "Create account" button', async () => { | ||
const jetpackDescriptionRow = | ||
setUpAccountsPage.getJetpackDescriptionRow(); | ||
await expect( jetpackDescriptionRow ).toContainText( | ||
'[email protected]' | ||
); | ||
|
||
const googleDescriptionRow = | ||
setUpAccountsPage.getGoogleDescriptionRow(); | ||
await expect( googleDescriptionRow ).toContainText( | ||
|
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