2020-09-29 19:16:43 +00:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
2020-12-22 13:59:16 +00:00
|
|
|
const { merchant } = require( '@woocommerce/e2e-utils' );
|
2020-09-29 19:16:43 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
const {
|
|
|
|
it,
|
|
|
|
describe,
|
|
|
|
beforeAll,
|
|
|
|
} = require( '@jest/globals' );
|
2021-11-30 19:16:51 +00:00
|
|
|
import deprecated from '@wordpress/deprecated';
|
2020-09-29 19:16:43 +00:00
|
|
|
|
|
|
|
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;
|