This repository has been archived by the owner on Feb 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a2dafa
commit 3bace80
Showing
5 changed files
with
92 additions
and
4 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
21 changes: 21 additions & 0 deletions
21
tests/e2e-pw/tests/templates/cart-template.block_theme.spec.ts
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,21 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { test, expect } from '@woocommerce/e2e-playwright-utils'; | ||
|
||
test.describe( 'Test the cart template', async () => { | ||
test.describe( 'Template is available', () => { | ||
test( 'Open template in the site editor', async ( { page } ) => { | ||
await page.goto( '/wp-admin/site-editor.php' ); | ||
await page.click( 'text=Templates' ); | ||
await page.click( 'text=Cart' ); | ||
await page.getByRole( 'button', { name: /Edit/i } ).click(); | ||
|
||
const iframeButton = await page | ||
.frameLocator( 'iFrame' ) | ||
.locator( 'button:has-text("Proceed to checkout")' ) | ||
.first(); | ||
await expect( iframeButton ).toBeVisible(); | ||
} ); | ||
} ); | ||
} ); |
17 changes: 17 additions & 0 deletions
17
tests/e2e-pw/tests/templates/checkout-header-template-part.block_theme.spec.ts
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,17 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { test, expect } from '@woocommerce/e2e-playwright-utils'; | ||
|
||
test.describe( 'Test the checkout header template part', async () => { | ||
test.describe( 'Template part is available', () => { | ||
test( 'Open template in the site editor', async ( { page } ) => { | ||
await page.goto( '/wp-admin/site-editor.php' ); | ||
await page.click( 'text=Template Parts' ); | ||
await page.click( 'text=Checkout Header' ); | ||
|
||
const editButton = page.getByRole( 'button', { name: /Edit/i } ); | ||
await expect( editButton ).toBeVisible(); | ||
} ); | ||
} ); | ||
} ); |
21 changes: 21 additions & 0 deletions
21
tests/e2e-pw/tests/templates/checkout-template.block_theme.spec.ts
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,21 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { test, expect } from '@woocommerce/e2e-playwright-utils'; | ||
|
||
test.describe( 'Test the checkout template', async () => { | ||
test.describe( 'Template is available', () => { | ||
test( 'Open template in the site editor', async ( { page } ) => { | ||
await page.goto( '/wp-admin/site-editor.php' ); | ||
await page.click( 'text=Templates' ); | ||
await page.click( 'text=Checkout' ); | ||
await page.getByRole( 'button', { name: /Edit/i } ).click(); | ||
|
||
const iframeButton = await page | ||
.frameLocator( 'iFrame' ) | ||
.locator( 'button:has-text("Place order")' ) | ||
.first(); | ||
await expect( iframeButton ).toBeVisible(); | ||
} ); | ||
} ); | ||
} ); |
23 changes: 23 additions & 0 deletions
23
tests/e2e-pw/tests/templates/order-confirmation.block_theme.spec.ts
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,23 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import { test, expect } from '@woocommerce/e2e-playwright-utils'; | ||
|
||
test.describe( 'Test the order confirmation template', async () => { | ||
test.describe( 'Template is available', () => { | ||
test( 'Open template in the site editor', async ( { page } ) => { | ||
await page.goto( '/wp-admin/site-editor.php' ); | ||
await page.click( 'text=Templates' ); | ||
await page.click( 'text=Order confirmation' ); | ||
await page.getByRole( 'button', { name: /Edit/i } ).click(); | ||
|
||
const iframeButton = await page | ||
.frameLocator( 'iFrame' ) | ||
.locator( | ||
'p:has-text("Thank you. Your order has been received.")' | ||
) | ||
.first(); | ||
await expect( iframeButton ).toBeVisible(); | ||
} ); | ||
} ); | ||
} ); |