diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index 6e429875a1..6c6a7c11ed 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -346,6 +346,7 @@ jobs: # Override reports path specifically for this job env: + SYSTEM_INFO: ./tests/pw/all-reports/test-artifact-api/playwright/systemInfo.json API_TEST_RESULT: ./tests/pw/all-reports/test-artifact-api/playwright-report/api/summary-report/results.json API_COVERAGE: ./tests/pw/all-reports/test-artifact-api/playwright-report/api/coverage-report/coverage.json E2E_TEST_RESULT: ./tests/pw/all-reports/merged-summary.json diff --git a/tests/pw/pages/customerPage.ts b/tests/pw/pages/customerPage.ts index 7d6c5fa22b..43ba7cee32 100644 --- a/tests/pw/pages/customerPage.ts +++ b/tests/pw/pages/customerPage.ts @@ -162,23 +162,23 @@ export class CustomerPage extends BasePage { async updateBillingFields(billingInfo: customer['customerInfo']['billing']) { await this.clearAndType(customerAddress.billing.firstName, billingInfo.firstName); await this.clearAndType(customerAddress.billing.lastName, billingInfo.lastName); - await this.clearAndType(customerAddress.billing.companyName, billingInfo.companyName); if (DOKAN_PRO) { await this.clearAndType(customerAddress.billing.euFields.companyID, billingInfo.companyId); await this.clearAndType(customerAddress.billing.euFields.vatOrTaxNumber, billingInfo.vatNumber); await this.clearAndType(customerAddress.billing.euFields.nameOfBank, billingInfo.bankName); await this.clearAndType(customerAddress.billing.euFields.bankIban, billingInfo.bankIban); } - await this.click(customerAddress.billing.countryOrRegion); - await this.clearAndType(customerAddress.billing.countryOrRegionInput, billingInfo.country); - await this.press(data.key.enter); + await this.click(customerAddress.billing.country); + await this.clearAndType(customerAddress.billing.countryInput, billingInfo.country); + await this.click(customerAddress.billing.countryValue(billingInfo.country)); + await this.toHaveText(customerAddress.billing.selectedCountry, billingInfo.country); await this.clearAndType(customerAddress.billing.streetAddress, billingInfo.street1); await this.clearAndType(customerAddress.billing.streetAddress2, billingInfo.street2); await this.clearAndType(customerAddress.billing.city, billingInfo.city); - await this.focus(customerAddress.billing.zipCode); await this.click(customerAddress.billing.state); await this.clearAndType(customerAddress.billing.stateInput, billingInfo.state); - await this.press(data.key.enter); + await this.click(customerAddress.billing.stateValue(billingInfo.state)); + await this.toHaveText(customerAddress.billing.selectedState, billingInfo.state); await this.clearAndType(customerAddress.billing.zipCode, billingInfo.zipCode); await this.clearAndType(customerAddress.billing.phone, billingInfo.phone); await this.clearAndType(customerAddress.billing.email, billingInfo.email); @@ -188,17 +188,17 @@ export class CustomerPage extends BasePage { async updateShippingFields(shippingInfo: customer['customerInfo']['shipping']): Promise { await this.clearAndType(customerAddress.shipping.firstName, shippingInfo.firstName); await this.clearAndType(customerAddress.shipping.lastName, shippingInfo.lastName); - await this.clearAndType(customerAddress.shipping.companyName, shippingInfo.companyName); - await this.click(customerAddress.shipping.countryOrRegion); - await this.clearAndType(customerAddress.shipping.countryOrRegionInput, shippingInfo.country); - await this.press(data.key.enter); + await this.click(customerAddress.shipping.country); + await this.clearAndType(customerAddress.shipping.countryInput, shippingInfo.country); + await this.click(customerAddress.shipping.countryValue(shippingInfo.country)); + await this.toHaveText(customerAddress.shipping.selectedCountry, shippingInfo.country); await this.clearAndType(customerAddress.shipping.streetAddress, shippingInfo.street1); await this.clearAndType(customerAddress.shipping.streetAddress2, shippingInfo.street2); await this.clearAndType(customerAddress.shipping.city, shippingInfo.city); - await this.focus(customerAddress.shipping.zipCode); await this.click(customerAddress.shipping.state); await this.clearAndType(customerAddress.shipping.stateInput, shippingInfo.state); - await this.press(data.key.enter); + await this.click(customerAddress.shipping.stateValue(shippingInfo.state)); + await this.toHaveText(customerAddress.shipping.selectedState, shippingInfo.state); await this.clearAndType(customerAddress.shipping.zipCode, shippingInfo.zipCode); } diff --git a/tests/pw/pages/selectors.ts b/tests/pw/pages/selectors.ts index 99e63a01f7..ddd99c1e45 100644 --- a/tests/pw/pages/selectors.ts +++ b/tests/pw/pages/selectors.ts @@ -6913,22 +6913,25 @@ export const selector = { editBillingAddress: '//h3[contains(text(),"Billing address")]/..//a[@class="edit"]', firstName: '#billing_first_name', lastName: '#billing_last_name', - companyName: '#billing_company', euFields: { companyID: '#billing_dokan_company_id_number', vatOrTaxNumber: '#billing_dokan_vat_number', nameOfBank: '#billing_dokan_bank_name', bankIban: '#billing_dokan_bank_iban', }, - countryOrRegion: '(//span[@class="select2-selection__arrow"])[1]', - countryOrRegionInput: '.select2-search.select2-search--dropdown .select2-search__field', - countryOrRegionValues: '.select2-results ul li', + country: '//select[@id="billing_country"]/..//span[@class="select2-selection__arrow"]', + countryInput: '.select2-search.select2-search--dropdown .select2-search__field', + countryValues: '.select2-results ul li', + countryValue: (country: string) => `//li[contains(@class,"select2-results__option") and normalize-space(text())="${country}"]`, + selectedCountry: '//span[@id="select2-billing_country-container"]', streetAddress: '#billing_address_1', streetAddress2: '#billing_address_2', city: '#billing_city', - state: '(//span[@class="select2-selection__arrow"])[2]', + state: '//select[@id="billing_state"]/..//span[@class="select2-selection__arrow"]', stateInput: '.select2-search.select2-search--dropdown .select2-search__field', stateValues: '.select2-results ul li', + stateValue: (state: string) => `//li[contains(@class,"select2-results__option")and normalize-space(text())="${state}"]`, + selectedState: '//span[@id="select2-billing_state-container"]', zipCode: '#billing_postcode', phone: '#billing_phone', email: '#billing_email', @@ -6942,16 +6945,19 @@ export const selector = { editShippingAddress: '//h3[contains(text(),"Shipping address")]/..//a[@class="edit"]', firstName: '#shipping_first_name', lastName: '#shipping_last_name', - companyName: '#shipping_company', - countryOrRegion: '(//span[@class="select2-selection__arrow"])[1]', - countryOrRegionInput: '.select2-search.select2-search--dropdown .select2-search__field', - countryOrRegionValues: '.select2-results ul li', + country: '//select[@id="shipping_country"]/..//span[@class="select2-selection__arrow"]', + countryInput: '.select2-search.select2-search--dropdown .select2-search__field', + countryValues: '.select2-results ul li', + countryValue: (country: string) => `//li[contains(@class,"select2-results__option") and normalize-space(text())="${country}"]`, + selectedCountry: '//span[@id="select2-shipping_country-container"]', streetAddress: '#shipping_address_1', streetAddress2: '#shipping_address_2', city: '#shipping_city', - state: '(//span[@class="select2-selection__arrow"])[2]', + state: '//select[@id="shipping_state"]/..//span[@class="select2-selection__arrow"]', stateInput: '.select2-search.select2-search--dropdown .select2-search__field', stateValues: '.select2-results ul li', + stateValue: (state: string) => `//li[contains(@class,"select2-results__option")and normalize-space(text())="${state}"]`, + selectedState: '//span[@id="select2-shipping_state-container"]', zipCode: '#shipping_postcode', saveAddress: '//button[@name="save_address"]', @@ -8038,8 +8044,9 @@ export const selector = { deliveryTimeInputHidden: '//input[@class="delivery-time-date-picker flatpickr-input"]', deliveryDate: (date: string) => `//div[contains(@class,"flatpickr-calendar animate open")]//div[@class="dayContainer"]//span[contains(@class,"flatpickr-day") and @aria-label="${date}"]`, - timePicker: 'select.delivery-time-slot-picker', - locationPicker: 'select.delivery-store-location-picker', + timePicker: '//option[normalize-space()="Select time slot"]/..', + locationPicker: '//option[normalize-space()="Select store location"]/..', + storeLocation: 'div.store-address.vendor-info', orderDetails: { deliveryTimeDetails: 'div#dokan-delivery-time-slot-order-details', diff --git a/tests/pw/pages/vendorDeliveryTimePage.ts b/tests/pw/pages/vendorDeliveryTimePage.ts index 042dfbb7cd..7fae1c80c6 100644 --- a/tests/pw/pages/vendorDeliveryTimePage.ts +++ b/tests/pw/pages/vendorDeliveryTimePage.ts @@ -148,15 +148,16 @@ export class VendorDeliveryTimePage extends CustomerPage { await this.click(deliveryTimeCustomer.delivery); await this.click(deliveryTimeCustomer.deliveryTimeInput); await this.clickAndWaitForResponse(data.subUrls.api.dokan.deliveryTime, deliveryTimeCustomer.deliveryDate(deliveryTime.date)); - await this.selectByNumber(deliveryTimeCustomer.timePicker, 1); + await this.selectByNumber(deliveryTimeCustomer.timePicker, 0); break; case 'store-pickup': await this.click(deliveryTimeCustomer.storePickup); await this.click(deliveryTimeCustomer.deliveryTimeInput); await this.clickAndWaitForResponse(data.subUrls.api.dokan.deliveryTime, deliveryTimeCustomer.deliveryDate(deliveryTime.date)); - await this.selectByNumber(deliveryTimeCustomer.timePicker, 1); - await this.selectByNumber(deliveryTimeCustomer.locationPicker, 1); + await this.selectByNumber(deliveryTimeCustomer.timePicker, 0); + await this.selectByNumber(deliveryTimeCustomer.locationPicker, 0); + await this.toBeVisible(deliveryTimeCustomer.storeLocation); break; default: diff --git a/tests/pw/tests/api/_env.setup.ts b/tests/pw/tests/api/_env.setup.ts index 82742ba595..c9ee33d180 100644 --- a/tests/pw/tests/api/_env.setup.ts +++ b/tests/pw/tests/api/_env.setup.ts @@ -21,6 +21,10 @@ setup.describe('setup woocommerce settings', () => { await apiUtils.dispose(); }); + setup('set woocommerce site visibility settings', { tag: ['@lite'] }, async () => { + await dbUtils.setOptionValue('woocommerce_coming_soon', 'no', false); + }); + setup('set woocommerce settings', { tag: ['@lite'] }, async () => { await apiUtils.updateBatchWcSettingsOptions('general', payloads.general); await apiUtils.updateBatchWcSettingsOptions('account', payloads.account); diff --git a/tests/pw/tests/e2e/_env.setup.ts b/tests/pw/tests/e2e/_env.setup.ts index 0007ca2671..3c0b075861 100644 --- a/tests/pw/tests/e2e/_env.setup.ts +++ b/tests/pw/tests/e2e/_env.setup.ts @@ -21,6 +21,10 @@ setup.describe('setup woocommerce settings', () => { await apiUtils.dispose(); }); + setup('set woocommerce site visibility settings', { tag: ['@lite'] }, async () => { + await dbUtils.setOptionValue('woocommerce_coming_soon', 'no', false); + }); + setup('set woocommerce settings', { tag: ['@lite'] }, async () => { await apiUtils.updateBatchWcSettingsOptions('general', payloads.general); await apiUtils.updateBatchWcSettingsOptions('account', payloads.account); diff --git a/tests/pw/tests/e2e/customer.spec.ts b/tests/pw/tests/e2e/customer.spec.ts index 57621b12da..7fb96d60b5 100644 --- a/tests/pw/tests/e2e/customer.spec.ts +++ b/tests/pw/tests/e2e/customer.spec.ts @@ -39,11 +39,11 @@ test.describe('Customer functionality test', () => { await customer.customerBecomeVendor(data.customer.customerInfo); }); - test('customer can add billing details', { tag: ['@lite', '@customer'] }, async () => { + test.skip('customer can add billing details', { tag: ['@lite', '@customer'] }, async () => { await customer.addBillingAddress(data.customer.customerInfo.billing); }); - test('customer can add shipping details', { tag: ['@lite', '@customer'] }, async () => { + test.skip('customer can add shipping details', { tag: ['@lite', '@customer'] }, async () => { await customer.addShippingAddress(data.customer.customerInfo.shipping); }); diff --git a/tests/pw/tests/e2e/vendorDeliveryTime.spec.ts b/tests/pw/tests/e2e/vendorDeliveryTime.spec.ts index 158c8fe9ae..438955d5ea 100644 --- a/tests/pw/tests/e2e/vendorDeliveryTime.spec.ts +++ b/tests/pw/tests/e2e/vendorDeliveryTime.spec.ts @@ -66,14 +66,11 @@ test.describe('Vendor delivery time test', () => { // customer test('customer can buy product with delivery time', { tag: ['@pro', '@customer'] }, async () => { - test.skip(true, 'run when chart & checkout block pr is merged'); await customer.addProductToCart(data.predefined.simpleProduct.product1.name, 'single-product'); await customer.placeOrderWithDeliverTimeStorePickup('delivery-time', data.deliveryTime); }); test('customer can buy product with store pickup', { tag: ['@pro', '@customer'] }, async () => { - test.skip(true, 'run when chart & checkout block pr is merged'); - await dbUtils.setOptionValue(dbData.dokan.optionName.deliveryTime, { ...dbData.dokan.deliveryTimeSettings, allow_vendor_override_settings: 'off' }); // todo: resolve: previous test disable store pickup await customer.addProductToCart(data.predefined.simpleProduct.product1.name, 'single-product'); await customer.placeOrderWithDeliverTimeStorePickup('store-pickup', data.deliveryTime); });