Fix return subscription plan id

This commit is contained in:
Emili Castells Guasch 2023-03-02 09:11:17 +01:00
parent 62364d1e84
commit bdc69a6fc6
3 changed files with 16 additions and 1 deletions

View file

@ -2,6 +2,8 @@ const {test, expect} = require('@playwright/test');
const {
WP_MERCHANT_USER,
WP_MERCHANT_PASSWORD,
WP_CUSTOMER_USER,
WP_CUSTOMER_PASSWORD,
AUTHORIZATION
} = process.env;
@ -15,6 +17,16 @@ async function loginAsAdmin(page) {
]);
}
async function loginAsCustomer(page) {
await page.goto('/wp-admin');
await page.locator('input[name="log"]').fill(WP_CUSTOMER_USER);
await page.locator('input[name="pwd"]').fill(WP_CUSTOMER_PASSWORD);
await Promise.all([
page.waitForNavigation(),
page.locator('text=Log In').click()
]);
}
test.describe.serial('Merchant', () => {
const title = (Math.random() + 1).toString(36).substring(7);
let product_id = '';