2023-05-05 11:03:36 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
2024-02-20 15:52:53 +00:00
|
|
|
import { BLOCK_THEME_SLUG, cli } from '@woocommerce/e2e-utils';
|
2023-08-28 10:04:28 +00:00
|
|
|
import { test as setup, expect } from '@woocommerce/e2e-playwright-utils';
|
2023-05-05 11:03:36 +00:00
|
|
|
|
2024-02-20 15:52:53 +00:00
|
|
|
setup( 'Sets up the block theme', async () => {
|
|
|
|
let cliOutput = 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
|
|
|
);
|
2024-02-20 15:52:53 +00:00
|
|
|
|
|
|
|
expect(
|
|
|
|
cliOutput.stdout,
|
|
|
|
`Could not install and/or activate ${ BLOCK_THEME_SLUG }`
|
|
|
|
).toContain( 'Success' );
|
|
|
|
|
|
|
|
// Enable permalinks and perform a hard flush.
|
|
|
|
cliOutput = await cli(
|
2023-09-19 09:58:18 +00:00
|
|
|
`npm run wp-env run tests-cli -- wp rewrite structure /%postname%/ --hard`
|
|
|
|
);
|
2024-02-20 15:52:53 +00:00
|
|
|
|
|
|
|
expect( cliOutput.stdout ).toContain( 'Success: Rewrite structure set' );
|
|
|
|
expect( cliOutput.stdout ).toContain( 'Success: Rewrite rules flushed' );
|
2023-08-28 10:04:28 +00:00
|
|
|
} );
|