2023-05-05 11:03:36 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2023-08-28 10:04:28 +00:00
|
|
|
import {
|
|
|
|
BLOCK_THEME_NAME,
|
|
|
|
BLOCK_THEME_SLUG,
|
|
|
|
cli,
|
|
|
|
} from '@woocommerce/e2e-utils';
|
|
|
|
import { test as setup, expect } from '@woocommerce/e2e-playwright-utils';
|
2023-05-05 11:03:36 +00:00
|
|
|
|
2023-08-28 10:04:28 +00:00
|
|
|
setup( 'Sets up the block theme', async ( { admin } ) => {
|
|
|
|
await cli(
|
2023-09-01 09:07:55 +00:00
|
|
|
`npm run wp-env run tests-cli -- wp theme install ${ BLOCK_THEME_SLUG } --activate`
|
2023-08-28 10:04:28 +00:00
|
|
|
);
|
|
|
|
await admin.page.goto( '/wp-admin/themes.php' );
|
|
|
|
await expect(
|
|
|
|
admin.page.getByText( `Active: ${ BLOCK_THEME_NAME }` )
|
|
|
|
).toBeVisible();
|
2023-09-19 09:58:18 +00:00
|
|
|
// Enable permalinks.
|
|
|
|
await cli(
|
|
|
|
`npm run wp-env run tests-cli -- wp rewrite structure /%postname%/ --hard`
|
|
|
|
);
|
|
|
|
await cli( `npm run wp-env run tests-cli -- wp rewrite flush --hard` );
|
2023-08-28 10:04:28 +00:00
|
|
|
} );
|