2020-09-29 19:16:43 +00:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2020-12-22 13:59:16 +00:00
|
|
|
const { merchant } = require( '@woocommerce/e2e-utils' );
|
2021-11-16 22:51:24 +00:00
|
|
|
const deprecated = require( '@wordpress/deprecated' );
|
2020-09-29 19:16:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
const {
|
|
|
|
it,
|
|
|
|
describe,
|
|
|
|
beforeAll,
|
|
|
|
} = require( '@jest/globals' );
|
|
|
|
|
|
|
|
const runActivationTest = () => {
|
|
|
|
describe('Store owner can login and make sure WooCommerce is activated', () => {
|
|
|
|
beforeAll(async () => {
|
2020-12-22 13:59:16 +00:00
|
|
|
await merchant.login();
|
2020-09-29 19:16:43 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
it('can make sure WooCommerce is activated. If not, activate it', async () => {
|
2021-11-16 22:51:24 +00:00
|
|
|
deprecated( 'runActivationTest', {
|
|
|
|
alternative: '@woocommerce/admin-e2e-tests `testAdminBasicSetup()`',
|
|
|
|
});
|
|
|
|
|
2020-09-29 19:16:43 +00:00
|
|
|
const slug = 'woocommerce';
|
2020-12-22 13:59:16 +00:00
|
|
|
await merchant.openPlugins();
|
2020-09-29 19:16:43 +00:00
|
|
|
const disableLink = await page.$(`tr[data-slug="${slug}"] .deactivate a`);
|
|
|
|
if (disableLink) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
await page.click(`tr[data-slug="${slug}"] .activate a`);
|
|
|
|
await page.waitForSelector(`tr[data-slug="${slug}"] .deactivate a`);
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = runActivationTest;
|