Use urls from env values in pw

This commit is contained in:
Alex P 2023-05-29 10:46:35 +03:00
parent 4b3c16ebaf
commit b556841562
No known key found for this signature in database
GPG key ID: 54487A734A204D71
2 changed files with 10 additions and 5 deletions

View file

@ -13,6 +13,8 @@ BLOCK_CART_URL="/cart-block"
PRODUCT_URL="/product/prod"
PRODUCT_ID=123
SUBSCRIPTION_URL="/product/sub"
WP_MERCHANT_USER="admin"
WP_MERCHANT_PASSWORD="admin"

View file

@ -4,13 +4,16 @@ const {openPaypalPopup, loginIntoPaypal, completePaypalPayment} = require("./uti
const {fillCheckoutForm, expectOrderReceivedPage} = require("./utils/checkout");
const {
AUTHORIZATION,
SUBSCRIPTION_URL,
CHECKOUT_URL,
CART_URL,
} = process.env;
async function purchaseSubscriptionFromCart(page) {
await loginAsCustomer(page);
await page.goto('/product/subscription');
await page.goto(SUBSCRIPTION_URL);
await page.click("text=Sign up now");
await page.goto('/cart');
await page.goto(CART_URL);
const popup = await openPaypalPopup(page);
await loginIntoPaypal(popup);
@ -195,9 +198,9 @@ test.describe('Subscriber purchase a Subscription', () => {
test('Purchase Subscription from Checkout Page', async ({page}) => {
await loginAsCustomer(page);
await page.goto('/product/subscription');
await page.goto(SUBSCRIPTION_URL);
await page.click("text=Sign up now");
await page.goto('/checkout');
await page.goto(CHECKOUT_URL);
await fillCheckoutForm(page);
const popup = await openPaypalPopup(page);
@ -213,7 +216,7 @@ test.describe('Subscriber purchase a Subscription', () => {
test('Purchase Subscription from Single Product Page', async ({page}) => {
await loginAsCustomer(page);
await page.goto('/product/subscription');
await page.goto(SUBSCRIPTION_URL);
const popup = await openPaypalPopup(page);
await loginIntoPaypal(popup);