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' );
|
|
|
|
|
|
|
|
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 () => {
|
|
|
|
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;
|