You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
2.5 KiB
TypeScript

import { test } from '@playwright/test';
import {cPanelLicensesPageStepDefs} from "../src/main/cPanel/step-definitions/cPanelLicensesPageStepDefs";
import {ProductConfigurePageStepDefs} from "../src/main/cPanel/step-definitions/productConfigurePageStepDefs";
import {ReviewAndCheckoutPageStepDefs} from "../src/main/cPanel/step-definitions/reviewAndCheckoutPageStepDefs";
import {CheckoutPageStepDefs} from "../src/main/cPanel/step-definitions/checkoutPageStepDefs";
test.describe('Order License from cPanel Licenses Page with one Addon', () => {
test('cPanel Licenses Page', async ({ page }) => {
const cPanelLicensesPage = new cPanelLicensesPageStepDefs(page);
await cPanelLicensesPage.open();
await cPanelLicensesPage.clickOnOrderNowLicense("cPanel Pro Cloud (30 Accounts)")
const productConfigurePage = new ProductConfigurePageStepDefs(page)
await productConfigurePage.fillIpAddressWithData("2.2.2.2")
await productConfigurePage.clickOnAddToCartProduct("Monthly CloudLinux")
await productConfigurePage.assertProductName("cPanel Pro Cloud (30 Accounts)")
await productConfigurePage.assertAddonName("Monthly CloudLinux")
await productConfigurePage.assertProductPrice("$42.99 USD")
await productConfigurePage.assertAddonPrice("$26.00 USD")
await productConfigurePage.assertSetupFeePrice("$0.00 USD")
await productConfigurePage.assertMonthlyPrice()
await productConfigurePage.assertTotalDue()
await productConfigurePage.clickOnContinue()
const reviewAndCheckoutPage = new ReviewAndCheckoutPageStepDefs(page)
await reviewAndCheckoutPage.assertLicenseName("cPanel Licenses")
await reviewAndCheckoutPage.assertIpAddress("2.2.2.2")
// await reviewAndCheckoutPage.assertProductMonthlyPrice("$42.99 USD")
await reviewAndCheckoutPage.assertAddonMonthlyPrice("$26.00 USD")
// await reviewAndCheckoutPage.assertTotalDue()
await reviewAndCheckoutPage.clickOnCheckout()
const checkoutPage = new CheckoutPageStepDefs(page)
await checkoutPage.assertPersonalInformationBlockIsVisible()
await checkoutPage.assertBillingAddressBlockIsVisible()
await checkoutPage.assertAccountSecurityBlockIsVisible()
await checkoutPage.assertTermsAndConditionsBlockIsVisible()
await checkoutPage.assertPaymentDetailsBlockIsVisible()
await checkoutPage.assertCompleteOrderButtonIsVisibleAndDisabled()
});
})