2019-08-27 12:22:24 +00:00
|
|
|
/**
|
|
|
|
* @format
|
|
|
|
*/
|
|
|
|
|
|
|
|
const baseUrl = process.env.WP_BASE_URL;
|
|
|
|
|
|
|
|
const WP_ADMIN_NEW_PRODUCT = baseUrl + '/wp-admin/post-new.php?post_type=product';
|
2019-08-30 11:03:57 +00:00
|
|
|
const WP_ADMIN_WC_SETTINGS = baseUrl + '/wp-admin/admin.php?page=wc-settings&tab=';
|
2019-08-27 12:22:24 +00:00
|
|
|
|
|
|
|
const StoreOwnerFlow = {
|
|
|
|
openNewProduct: async () => {
|
|
|
|
await page.goto( WP_ADMIN_NEW_PRODUCT, {
|
|
|
|
waitUntil: 'networkidle0',
|
|
|
|
} );
|
|
|
|
},
|
2019-08-30 11:03:57 +00:00
|
|
|
|
|
|
|
openSettings: async ( tab, section = null ) => {
|
|
|
|
let settingsUrl = WP_ADMIN_WC_SETTINGS + tab;
|
|
|
|
|
|
|
|
if ( section ) {
|
|
|
|
settingsUrl += `§ion=${ section }`;
|
|
|
|
}
|
|
|
|
|
|
|
|
await page.goto( settingsUrl, {
|
|
|
|
waitUntil: 'networkidle0',
|
|
|
|
} );
|
|
|
|
},
|
2019-08-27 12:22:24 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export { StoreOwnerFlow };
|