woocommerce/tests/e2e/specs/smoke-tests/update-woocommerce.js

38 lines
883 B
JavaScript
Raw Normal View History

2021-07-15 20:39:32 +00:00
/**
* Internal dependencies
*/
2021-07-20 21:26:51 +00:00
const { merchant, utils } = require( '@woocommerce/e2e-utils' );
2021-07-15 20:39:32 +00:00
2021-07-20 21:26:51 +00:00
const { getRemotePluginZip } = require( '@woocommerce/e2e-environment' );
2021-07-15 20:39:32 +00:00
2021-07-20 21:26:51 +00:00
/**
* External dependencies
*/
const {
it,
beforeAll,
} = require( '@jest/globals' );
2021-07-15 20:39:32 +00:00
2021-07-20 21:26:51 +00:00
const { UPDATE_WC } = process.env;
2021-07-15 20:39:32 +00:00
2021-07-20 21:26:51 +00:00
const nightlyZip = 'https://github.com/woocommerce/woocommerce/releases/download/nightly/woocommerce-trunk-nightly.zip';
const pluginName = 'WooCommerce';
2021-07-15 20:39:32 +00:00
2021-07-20 21:26:51 +00:00
let pluginPath;
2021-07-15 20:39:32 +00:00
2021-07-20 21:26:51 +00:00
utils.describeIf( UPDATE_WC )( 'WooCommerce plugin can be uploaded and activated', () => {
beforeAll( async () => {
pluginPath = await getRemotePluginZip( nightlyZip );
await merchant.login();
});
2021-07-15 20:39:32 +00:00
2021-07-20 21:26:51 +00:00
afterAll( async () => {
await merchant.logout();
});
2021-07-15 20:39:32 +00:00
2021-07-20 21:26:51 +00:00
it( 'can upload and activate the WooCommerce plugin', async () => {
await merchant.uploadAndActivatePlugin( pluginPath, pluginName );
});
2021-07-15 20:39:32 +00:00
2021-07-20 21:26:51 +00:00
});