From 7527381d6df22b80c2515d4fee7687508fcf49b3 Mon Sep 17 00:00:00 2001 From: shashwata Date: Wed, 21 Feb 2024 17:43:30 +0600 Subject: [PATCH 01/31] refactor test yml --- .github/workflows/e2e_api_tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index 16d4e0f5f9..ffaccf9b51 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -3,7 +3,7 @@ name: E2E_API Tests on: # workflow will run daily at 8:00 AM BDT (2:00 AM UTC) schedule: - - cron: '0 2 * * *' + - cron: 0 2 * * * # workflow will trigger on pull request pull_request: branches: [develop] @@ -73,8 +73,8 @@ jobs: if: success() uses: actions/setup-node@v4 with: - node-version: '16' - cache: 'npm' + node-version: 16 + cache: npm - name: Composer install and build (Dokan-lite) if: success() @@ -195,7 +195,7 @@ jobs: - name: Prepare test summary id: prepare-test-summary uses: actions/github-script@v7 - if: always() + if: steps.e2e-test.outcome == 'success' || steps.api-test.outcome == 'success' with: result-encoding: string script: | From 73bc60d067baa3f982d7b1e34715ca41b0681815 Mon Sep 17 00:00:00 2001 From: shashwata Date: Wed, 21 Feb 2024 17:45:14 +0600 Subject: [PATCH 02/31] update pro plugins in wp-env override --- tests/pw/.wp-env.override | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/pw/.wp-env.override b/tests/pw/.wp-env.override index c1ae967364..b27c859277 100644 --- a/tests/pw/.wp-env.override +++ b/tests/pw/.wp-env.override @@ -6,10 +6,10 @@ "https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip", "../../", "../../../../", - "../../../woocommerce-bookings", - "../../../woocommerce-product-addons", - "../../../woocommerce-simple-auctions", - "../../../woocommerce-subscriptions" + "../../../woo-plugins/tests/plugins/woocommerce-bookings", + "../../../woo-plugins/tests/plugins/woocommerce-product-addons", + "../../../woo-plugins/tests/plugins/woocommerce-simple-auctions", + "../../../woo-plugins/tests/plugins/woocommerce-subscriptions" ] } } From 25e444b8dcfbff91af54e08acbb6249d365aafbf Mon Sep 17 00:00:00 2001 From: shashwata Date: Wed, 21 Feb 2024 19:53:03 +0600 Subject: [PATCH 03/31] refactor setup both test suite --- tests/pw/.eslintrc | 3 +- tests/pw/package.json | 3 +- tests/pw/playwright.config.ts | 2 +- tests/pw/tests/api/_auth.setup.ts | 63 +++++++++ tests/pw/tests/api/_env.setup.ts | 208 ++++++++++++++++++++++++------ tests/pw/tests/api/_env2.setup.ts | 54 -------- tests/pw/tests/e2e/_auth.setup.ts | 15 +-- tests/pw/tests/e2e/_env.setup.ts | 69 +--------- tests/pw/types/environment.d.ts | 2 +- tests/pw/utils/helpers.ts | 18 +-- tests/pw/utils/payloads.ts | 4 +- 11 files changed, 258 insertions(+), 183 deletions(-) create mode 100644 tests/pw/tests/api/_auth.setup.ts delete mode 100644 tests/pw/tests/api/_env2.setup.ts diff --git a/tests/pw/.eslintrc b/tests/pw/.eslintrc index 52adaa832d..e4c99908e9 100644 --- a/tests/pw/.eslintrc +++ b/tests/pw/.eslintrc @@ -24,7 +24,8 @@ // playwright rules "playwright/expect-expect": "off", "playwright/no-skipped-test": "off", - "playwright/no-conditional-in-test": "off" + "playwright/no-conditional-in-test": "off", + "playwright/no-standalone-expect": "off" // custom rules // "no-restricted-syntax": [ // "error", diff --git a/tests/pw/package.json b/tests/pw/package.json index fdd2140013..355cddccc6 100644 --- a/tests/pw/package.json +++ b/tests/pw/package.json @@ -18,8 +18,7 @@ "test:api:lite": "npx playwright test --project=api_tests --grep '@lite|@liteOnly' --grep-invert @pro --config=api.config.ts", "test:e2e:lite:explo": "npx playwright test --project=e2e_tests --grep '(?=.*@lite)(?=.*@exp)' --config=e2e.config.ts", "test:api:pro": "npx playwright test --project=api_tests --grep '@lite|@pro' --grep-invert @liteOnly --config=api.config.ts", - "test:e2e:pro": "npx playwright test --project=e2e_tests --grep '@lite' --grep-invert @liteOnly --config=e2e.config.ts", - "test:e2e:pro_": "npx playwright test --project=e2e_tests --grep '@lite|@pro' --grep-invert @liteOnly --config=e2e.config.ts", + "test:e2e:pro": "npx playwright test --project=e2e_tests --grep '@lite|@pro' --grep-invert @liteOnly --config=e2e.config.ts", "test:e2e:visual": "npx playwright test --project=e2e_tests --grep @visual --config=e2e.config.ts", "test:e2e:explo": "npx playwright test --project=e2e_tests --grep @exp --config=e2e.config.ts", "test:e2e:core": "npx playwright test --project=e2e_tests --grep @core --config=e2e.config.ts", diff --git a/tests/pw/playwright.config.ts b/tests/pw/playwright.config.ts index 574d9cfd0f..ad47b1832e 100644 --- a/tests/pw/playwright.config.ts +++ b/tests/pw/playwright.config.ts @@ -1,6 +1,6 @@ import { defineConfig, devices, expect } from '@playwright/test'; import { customExpect } from '@utils/pwMatchers'; -import 'dotenv/config'; +// import 'dotenv/config'; const { CI, BASE_URL, SLOWMO, ADMIN, ADMIN_PASSWORD } = process.env; export default defineConfig({ diff --git a/tests/pw/tests/api/_auth.setup.ts b/tests/pw/tests/api/_auth.setup.ts new file mode 100644 index 0000000000..53f656fd7a --- /dev/null +++ b/tests/pw/tests/api/_auth.setup.ts @@ -0,0 +1,63 @@ +import { test as setup, expect, request } from '@playwright/test'; +import { ApiUtils } from '@utils/apiUtils'; +import { endPoints } from '@utils/apiEndPoints'; +import { payloads } from '@utils/payloads'; +import { helpers } from '@utils/helpers'; +import { data } from '@utils/testData'; + +const { DOKAN_PRO, BASE_URL } = process.env; + +setup.describe('setup test environment', () => { + let apiUtils: ApiUtils; + + setup.beforeAll(async () => { + apiUtils = new ApiUtils(await request.newContext()); + }); + + setup.afterAll(async () => { + await apiUtils.dispose(); + }); + + setup.skip('get server url @lite', async () => { + const headers = await apiUtils.getSiteHeaders(BASE_URL); + if (headers.link) { + const serverUrl = headers.link.includes('rest_route') ? BASE_URL + '/?rest_route=' : BASE_URL + '/wp-json'; + helpers.createEnvVar('SERVER_URL', serverUrl); + } else { + console.log("Headers link doesn't exists"); + } + }); + + setup('setup store settings @lite', async () => { + const [response] = await apiUtils.put(endPoints.updateSettings, { data: payloads.setupStore }); + expect(response.ok()).toBeTruthy(); + }); + + setup('create customer @lite', async () => { + const [, customerId] = await apiUtils.createCustomer(payloads.createCustomer1, payloads.adminAuth); + helpers.createEnvVar('CUSTOMER_ID', customerId); + }); + + setup('create vendor @lite', async () => { + const [, sellerId] = await apiUtils.createStore(payloads.createStore1, payloads.adminAuth); + helpers.createEnvVar('VENDOR_ID', sellerId); + }); + + setup('add vendor2 @lite', async () => { + const [, sellerId] = await apiUtils.createStore(payloads.createStore2, payloads.adminAuth); + helpers.createEnvVar('VENDOR2_ID', sellerId); + }); + + setup('dokan pro enabled or not @lite', async () => { + let res = await apiUtils.checkPluginsExistence(data.plugin.dokanPro, payloads.adminAuth); + if (res) { + res = await apiUtils.pluginsActiveOrNot(data.plugin.dokanPro, payloads.adminAuth); + } + DOKAN_PRO ? expect(res).toBeTruthy() : expect(res).toBeFalsy(); + }); + + setup('get test environment info @lite', async () => { + const [, systemInfo] = await apiUtils.getSystemStatus(payloads.adminAuth); + helpers.writeFile(data.systemInfo, JSON.stringify(systemInfo)); + }); +}); diff --git a/tests/pw/tests/api/_env.setup.ts b/tests/pw/tests/api/_env.setup.ts index f56666682a..557b123c24 100644 --- a/tests/pw/tests/api/_env.setup.ts +++ b/tests/pw/tests/api/_env.setup.ts @@ -1,15 +1,19 @@ -import { test as setup, expect, request } from '@playwright/test'; +import { test as setup, expect, request, Page } from '@playwright/test'; +import { LoginPage } from '@pages/loginPage'; +import { ProductAdvertisingPage } from '@pages/productAdvertisingPage'; +import { ReverseWithdrawsPage } from '@pages/reverseWithdrawsPage'; import { ApiUtils } from '@utils/apiUtils'; -import { endPoints } from '@utils/apiEndPoints'; import { payloads } from '@utils/payloads'; -import { helpers } from '@utils/helpers'; import { dbUtils } from '@utils/dbUtils'; import { dbData } from '@utils/dbData'; import { data } from '@utils/testData'; +import { helpers } from '@utils/helpers'; + +const { DOKAN_PRO, HPOS } = process.env; -const { BASE_URL } = process.env; +setup.describe('setup site & woocommerce & user settings', () => { + setup.use({ extraHTTPHeaders: { Authorization: payloads.adminAuth.Authorization } }); -setup.describe('setup test environment', () => { let apiUtils: ApiUtils; setup.beforeAll(async () => { @@ -20,45 +24,54 @@ setup.describe('setup test environment', () => { await apiUtils.dispose(); }); - setup.skip('get server url @lite', async () => { - const headers = await apiUtils.getSiteHeaders(BASE_URL); - if (headers.link) { - const serverUrl = headers.link.includes('rest_route') ? BASE_URL + '/?rest_route=' : BASE_URL + '/wp-json'; - console.log('ServerUrl:', serverUrl); - process.env.SERVER_URL = serverUrl; - } else { - console.log("Headers link doesn't exists"); - } + setup('check active plugins @lite', async () => { + setup.skip(!process.env.CI, 'skip plugin check on local'); + const activePlugins = (await apiUtils.getAllPlugins({ status: 'active' })).map((a: { plugin: string }) => a.plugin.split('/')[1]); + DOKAN_PRO ? expect(activePlugins).toEqual(expect.arrayContaining(data.plugin.plugins)) : expect(activePlugins).toEqual(expect.arrayContaining(data.plugin.pluginsLite)); }); - setup('setup store settings @lite', async () => { - const [response] = await apiUtils.put(endPoints.updateSettings, { data: payloads.setupStore }); - expect(response.ok()).toBeTruthy(); + setup('set wordPress site settings @lite', async () => { + const siteSettings = await apiUtils.setSiteSettings(payloads.siteSettings); + expect(siteSettings).toEqual(expect.objectContaining(payloads.siteSettings)); }); - setup('create customer @lite', async () => { - const [, customerId] = await apiUtils.createCustomer(payloads.createCustomer1, payloads.adminAuth); - console.log('CUSTOMER_ID:', customerId); - process.env.CUSTOMER_ID = customerId; - helpers.appendEnv(`CUSTOMER_ID=${customerId}`); // for local testing + setup('set woocommerce settings @lite', async () => { + await apiUtils.updateBatchWcSettingsOptions('general', payloads.general); + await apiUtils.updateBatchWcSettingsOptions('account', payloads.account); + HPOS && (await apiUtils.updateBatchWcSettingsOptions('advanced', payloads.advanced)); }); - setup('create vendor @lite', async () => { - const [, sellerId] = await apiUtils.createStore(payloads.createStore1, payloads.adminAuth); - console.log('VENDOR_ID:', sellerId); - process.env.VENDOR_ID = sellerId; - helpers.appendEnv(`VENDOR_ID=${sellerId}`); // for local testing + // Vendor Details + setup('add vendor1 product @lite', async () => { + // delete previous store products with predefined name if any + await apiUtils.deleteAllProducts(data.predefined.simpleProduct.product1.name, payloads.vendorAuth); + // create store product + const [, productId] = await apiUtils.createProduct({ ...payloads.createProduct(), name: data.predefined.simpleProduct.product1.name }, payloads.vendorAuth); + helpers.createEnvVar('PRODUCT_ID', productId); }); - setup('add vendor2 @lite', async () => { - const [, sellerId] = await apiUtils.createStore(payloads.createStore2, payloads.adminAuth); - console.log('VENDOR2_ID:', sellerId); - process.env.VENDOR2_ID = sellerId; - helpers.appendEnv(`VENDOR2_ID=${sellerId}`); // for local testing + setup('add vendor2 product @lite', async () => { + // delete previous store products with predefined name if any + await apiUtils.deleteAllProducts(data.predefined.vendor2.simpleProduct.product1.name, payloads.vendor2Auth); + // create store product + const [, productId] = await apiUtils.createProduct({ ...payloads.createProduct(), name: data.predefined.vendor2.simpleProduct.product1.name }, payloads.vendor2Auth); + helpers.createEnvVar('PRODUCT_ID', productId); + }); +}); + +setup.describe('setup dokan settings', () => { + let apiUtils: ApiUtils; + + setup.beforeAll(async () => { + apiUtils = new ApiUtils(await request.newContext()); + }); + + setup.afterAll(async () => { + await apiUtils.dispose(); }); setup('set dokan general settings @lite', async () => { - await dbUtils.setDokanSettings(dbData.dokan.optionName.general, { ...dbData.dokan.generalSettings, store_category_type: 'single' }); + await dbUtils.setDokanSettings(dbData.dokan.optionName.general, dbData.dokan.generalSettings); }); setup('admin set dokan selling settings @lite', async () => { @@ -73,8 +86,131 @@ setup.describe('setup test environment', () => { await dbUtils.setDokanSettings(dbData.dokan.optionName.reverseWithdraw, dbData.dokan.reverseWithdrawSettings); }); - setup('get test environment info @lite', async () => { - const [, systemInfo] = await apiUtils.getSystemStatus(payloads.adminAuth); - helpers.writeFile(data.systemInfo, JSON.stringify(systemInfo)); + setup('admin set dokan page settings @lite', async () => { + const [, pageId] = await apiUtils.createPage(payloads.tocPage, payloads.adminAuth); + const pageSettings = await dbUtils.getDokanSettings(dbData.dokan.optionName.page); + pageSettings['reg_tc_page'] = String(pageId); + await dbUtils.setDokanSettings(dbData.dokan.optionName.page, pageSettings); + }); + + setup('admin set dokan appearance settings @lite', async () => { + await dbUtils.setDokanSettings(dbData.dokan.optionName.appearance, dbData.dokan.appearanceSettings); + }); + + setup('admin set dokan privacy policy settings @lite', async () => { + const [, pageId] = await apiUtils.createPage(payloads.privacyPolicyPage, payloads.adminAuth); + dbData.dokan.privacyPolicySettings.privacy_page = String(pageId); + await dbUtils.setDokanSettings(dbData.dokan.optionName.privacyPolicy, dbData.dokan.privacyPolicySettings); + }); + + setup('admin set dokan color settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.colors, dbData.dokan.colorsSettings); + }); + + setup('admin set dokan store support settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.storeSupport, dbData.dokan.storeSupportSettings); + }); + + setup('admin set dokan shipping status settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.shippingStatus, dbData.dokan.shippingStatusSettings); + }); + + setup('admin set dokan quote settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.quote, dbData.dokan.quoteSettings); + }); + + setup('admin set dokan rma settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.rma, dbData.dokan.rmaSettings); + }); + + setup('admin set dokan wholesale settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.wholesale, dbData.dokan.wholesaleSettings); + }); + + setup('admin set dokan eu compliance settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.euCompliance, dbData.dokan.euComplianceSettings); + }); + + setup('admin set dokan delivery time settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.deliveryTime, dbData.dokan.deliveryTimeSettings); + }); + + setup('admin set dokan product advertising settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.productAdvertising, dbData.dokan.productAdvertisingSettings); + }); + + setup('admin set dokan geolocation settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.geolocation, dbData.dokan.geolocationSettings); + }); + + setup('admin set dokan product report abuse settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.productReportAbuse, dbData.dokan.productReportAbuseSettings); + }); + + setup('admin set dokan spmv settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.spmv, dbData.dokan.spmvSettings); + }); + + setup('admin set dokan vendor subscription settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.vendorSubscription, dbData.dokan.vendorSubscriptionSettings); + }); +}); + +setup.describe.skip('setup dokan settings e2e', () => { + let productAdvertisingPage: ProductAdvertisingPage; + let reverseWithdrawsPage: ReverseWithdrawsPage; + let aPage: Page; + let apiUtils: ApiUtils; + + setup.beforeAll(async ({ browser }) => { + const adminContext = await browser.newContext(data.auth.adminAuth); + aPage = await adminContext.newPage(); + productAdvertisingPage = new ProductAdvertisingPage(aPage); + reverseWithdrawsPage = new ReverseWithdrawsPage(aPage); + + apiUtils = new ApiUtils(await request.newContext()); + }); + + setup.afterAll(async () => { + await aPage.close(); + await apiUtils.dispose(); + }); + + setup('authenticate admin @lite', async ({ page }) => { + const loginPage = new LoginPage(page); + await loginPage.adminLogin(data.admin, data.auth.adminAuthFile); + }); + + setup('recreate reverse withdrawal payment product via settings save @lite', async () => { + await reverseWithdrawsPage.reCreateReverseWithdrawalPaymentViaSettingsSave(); + }); + + setup('reverse Withdraw payment product exists @lite', async () => { + const product = await apiUtils.checkProductExistence('Reverse Withdrawal Payment', payloads.adminAuth); + expect(product).toBeTruthy(); + }); + + setup('recreate product advertisement payment product via settings save @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await productAdvertisingPage.recreateProductAdvertisementPaymentViaSettingsSave(); + }); + + setup('product advertisement payment product exists @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + const product = await apiUtils.checkProductExistence('Product Advertisement Payment', payloads.adminAuth); + expect(product).toBeTruthy(); }); }); diff --git a/tests/pw/tests/api/_env2.setup.ts b/tests/pw/tests/api/_env2.setup.ts deleted file mode 100644 index 5c0ca09682..0000000000 --- a/tests/pw/tests/api/_env2.setup.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { test as setup, expect, request, Page } from '@playwright/test'; -import { LoginPage } from '@pages/loginPage'; -import { ProductAdvertisingPage } from '@pages/productAdvertisingPage'; -import { ReverseWithdrawsPage } from '@pages/reverseWithdrawsPage'; -import { ApiUtils } from '@utils/apiUtils'; -import { payloads } from '@utils/payloads'; -import { data } from '@utils/testData'; - -setup.describe.skip('authenticate users & set permalink', () => { - setup('authenticate admin @lite', async ({ page }) => { - const loginPage = new LoginPage(page); - await loginPage.adminLogin(data.admin, data.auth.adminAuthFile); - }); -}); - -setup.describe.skip('setup dokan settings e2e', () => { - let productAdvertisingPage: ProductAdvertisingPage; - let reverseWithdrawsPage: ReverseWithdrawsPage; - let aPage: Page, vPage: Page; - let apiUtils: ApiUtils; - - setup.beforeAll(async ({ browser }) => { - const adminContext = await browser.newContext(data.auth.adminAuth); - aPage = await adminContext.newPage(); - productAdvertisingPage = new ProductAdvertisingPage(aPage); - reverseWithdrawsPage = new ReverseWithdrawsPage(aPage); - - apiUtils = new ApiUtils(await request.newContext()); - }); - - setup.afterAll(async () => { - await aPage.close(); - await vPage.close(); - await apiUtils.dispose(); - }); - - setup('recreate reverse withdrawal payment product via settings save @lite', async () => { - await reverseWithdrawsPage.reCreateReverseWithdrawalPaymentViaSettingsSave(); - }); - - setup('reverse Withdraw payment product exists @lite', async () => { - const product = await apiUtils.checkProductExistence('Reverse Withdrawal Payment', payloads.adminAuth); - expect(product).toBeTruthy(); - }); - - setup('recreate product advertisement payment product via settings save @pro', async () => { - await productAdvertisingPage.recreateProductAdvertisementPaymentViaSettingsSave(); - }); - - setup('product advertisement payment product exists @pro', async () => { - const product = await apiUtils.checkProductExistence('Product Advertisement Payment', payloads.adminAuth); - expect(product).toBeTruthy(); - }); -}); diff --git a/tests/pw/tests/e2e/_auth.setup.ts b/tests/pw/tests/e2e/_auth.setup.ts index 6828478e8b..1346cf2112 100644 --- a/tests/pw/tests/e2e/_auth.setup.ts +++ b/tests/pw/tests/e2e/_auth.setup.ts @@ -24,8 +24,7 @@ setup.describe('authenticate users & set permalink', () => { const headers = await apiUtils.getSiteHeaders(BASE_URL); if (headers.link) { const serverUrl = headers.link.includes('rest_route') ? BASE_URL + '/?rest_route=' : BASE_URL + '/wp-json'; - console.log('ServerUrl:', serverUrl); - process.env.SERVER_URL = serverUrl; + helpers.createEnvVar('SERVER_URL', serverUrl); } else { console.log("Headers link doesn't exists"); } @@ -45,23 +44,17 @@ setup.describe('authenticate users & set permalink', () => { setup('add customer1 @lite', async () => { const [, customerId] = await apiUtils.createCustomer(payloads.createCustomer1, payloads.adminAuth); - console.log('CUSTOMER_ID:', customerId); - process.env.CUSTOMER_ID = customerId; - helpers.appendEnv(`CUSTOMER_ID=${customerId}`); // for local testing + helpers.createEnvVar('CUSTOMER_ID', customerId); }); setup('add vendor1 @lite', async () => { const [, sellerId] = await apiUtils.createStore(payloads.createStore1, payloads.adminAuth, true); - console.log('VENDOR_ID:', sellerId); - process.env.VENDOR_ID = sellerId; - helpers.appendEnv(`VENDOR_ID=${sellerId}`); // for local testing + helpers.createEnvVar('VENDOR_ID', sellerId); }); setup('add vendor2 @lite', async () => { const [, sellerId] = await apiUtils.createStore(payloads.createStore2, payloads.adminAuth, true); - console.log('VENDOR2_ID:', sellerId); - process.env.VENDOR2_ID = sellerId; - helpers.appendEnv(`VENDOR2_ID=${sellerId}`); // for local testing + helpers.createEnvVar('VENDOR2_ID', sellerId); }); setup('authenticate customer @lite', async ({ page }) => { diff --git a/tests/pw/tests/e2e/_env.setup.ts b/tests/pw/tests/e2e/_env.setup.ts index b427663b18..f2c087493e 100644 --- a/tests/pw/tests/e2e/_env.setup.ts +++ b/tests/pw/tests/e2e/_env.setup.ts @@ -9,7 +9,7 @@ import { dbData } from '@utils/dbData'; import { data } from '@utils/testData'; import { helpers } from '@utils/helpers'; -const { DOKAN_PRO, CUSTOMER_ID, HPOS } = process.env; +const { DOKAN_PRO, HPOS } = process.env; setup.describe('setup site & woocommerce & user settings', () => { setup.use({ extraHTTPHeaders: { Authorization: payloads.adminAuth.Authorization } }); @@ -128,23 +128,17 @@ setup.describe('setup user settings', () => { setup('add vendor1 product @lite', async () => { // delete previous store products with predefined name if any await apiUtils.deleteAllProducts(data.predefined.simpleProduct.product1.name, payloads.vendorAuth); - // create store product const [, productId] = await apiUtils.createProduct({ ...payloads.createProduct(), name: data.predefined.simpleProduct.product1.name }, payloads.vendorAuth); - console.log('PRODUCT_ID', productId); - process.env.PRODUCT_ID = productId; - helpers.appendEnv(`PRODUCT_ID=${productId}`); // for local testing + helpers.createEnvVar('PRODUCT_ID', productId); }); setup('add vendor2 product @lite', async () => { // delete previous store products with predefined name if any await apiUtils.deleteAllProducts(data.predefined.vendor2.simpleProduct.product1.name, payloads.vendor2Auth); - // create store product const [, productId] = await apiUtils.createProduct({ ...payloads.createProduct(), name: data.predefined.vendor2.simpleProduct.product1.name }, payloads.vendor2Auth); - console.log('V2_PRODUCT_ID:', productId); - process.env.V2_PRODUCT_ID = productId; - helpers.appendEnv(`V2_PRODUCT_ID=${productId}`); // for local testing + helpers.createEnvVar('PRODUCT_ID', productId); }); setup('add vendor coupon @pro', async () => { @@ -190,87 +184,30 @@ setup.describe('setup dokan settings', () => { await dbUtils.setDokanSettings(dbData.dokan.optionName.reverseWithdraw, dbData.dokan.reverseWithdrawSettings); }); - setup('admin set dokan page settings @lite', async () => { - const [, pageId] = await apiUtils.createPage(payloads.tocPage, payloads.adminAuth); - const pageSettings = await dbUtils.getDokanSettings(dbData.dokan.optionName.page); - pageSettings['reg_tc_page'] = String(pageId); - await dbUtils.setDokanSettings(dbData.dokan.optionName.page, pageSettings); - }); - - setup('admin set dokan appearance settings @lite', async () => { - await dbUtils.setDokanSettings(dbData.dokan.optionName.appearance, dbData.dokan.appearanceSettings); - }); - - setup('admin set dokan privacy policy settings @lite', async () => { - const [, pageId] = await apiUtils.createPage(payloads.privacyPolicyPage, payloads.adminAuth); - dbData.dokan.privacyPolicySettings.privacy_page = String(pageId); - await dbUtils.setDokanSettings(dbData.dokan.optionName.privacyPolicy, dbData.dokan.privacyPolicySettings); - }); - - setup('admin set dokan color settings @pro', async () => { - setup.skip(!DOKAN_PRO, 'skip on lite'); - await dbUtils.setDokanSettings(dbData.dokan.optionName.colors, dbData.dokan.colorsSettings); - }); - setup('admin set dokan store support settings @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); await dbUtils.setDokanSettings(dbData.dokan.optionName.storeSupport, dbData.dokan.storeSupportSettings); }); - setup('admin set dokan shipping status settings @pro', async () => { - setup.skip(!DOKAN_PRO, 'skip on lite'); - await dbUtils.setDokanSettings(dbData.dokan.optionName.shippingStatus, dbData.dokan.shippingStatusSettings); - }); - setup('admin set dokan quote settings @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); await dbUtils.setDokanSettings(dbData.dokan.optionName.quote, dbData.dokan.quoteSettings); }); - setup('admin set dokan rma settings @pro', async () => { - setup.skip(!DOKAN_PRO, 'skip on lite'); - await dbUtils.setDokanSettings(dbData.dokan.optionName.rma, dbData.dokan.rmaSettings); - }); - setup('admin set dokan wholesale settings @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); await dbUtils.setDokanSettings(dbData.dokan.optionName.wholesale, dbData.dokan.wholesaleSettings); }); - setup('admin set dokan eu compliance settings @pro', async () => { - setup.skip(!DOKAN_PRO, 'skip on lite'); - await dbUtils.setDokanSettings(dbData.dokan.optionName.euCompliance, dbData.dokan.euComplianceSettings); - }); - - setup('admin set dokan delivery time settings @pro', async () => { - setup.skip(!DOKAN_PRO, 'skip on lite'); - await dbUtils.setDokanSettings(dbData.dokan.optionName.deliveryTime, dbData.dokan.deliveryTimeSettings); - }); - setup('admin set dokan product advertising settings @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); await dbUtils.setDokanSettings(dbData.dokan.optionName.productAdvertising, dbData.dokan.productAdvertisingSettings); }); - setup('admin set dokan geolocation settings @pro', async () => { - setup.skip(!DOKAN_PRO, 'skip on lite'); - await dbUtils.setDokanSettings(dbData.dokan.optionName.geolocation, dbData.dokan.geolocationSettings); - }); - setup('admin set dokan product report abuse settings @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); await dbUtils.setDokanSettings(dbData.dokan.optionName.productReportAbuse, dbData.dokan.productReportAbuseSettings); }); - - setup('admin set dokan spmv settings @pro', async () => { - setup.skip(!DOKAN_PRO, 'skip on lite'); - await dbUtils.setDokanSettings(dbData.dokan.optionName.spmv, dbData.dokan.spmvSettings); - }); - - setup('admin set dokan vendor subscription settings @pro', async () => { - setup.skip(!DOKAN_PRO, 'skip on lite'); - await dbUtils.setDokanSettings(dbData.dokan.optionName.vendorSubscription, dbData.dokan.vendorSubscriptionSettings); - }); }); setup.describe('setup dokan settings e2e', () => { diff --git a/tests/pw/types/environment.d.ts b/tests/pw/types/environment.d.ts index c4379bb438..8c8ec75e07 100644 --- a/tests/pw/types/environment.d.ts +++ b/tests/pw/types/environment.d.ts @@ -3,7 +3,7 @@ export {}; declare global { namespace NodeJS { interface ProcessEnv { - // [key: string]: string + [key: string]: string; ADMIN: string; ADMIN_PASSWORD: string; VENDOR: string; diff --git a/tests/pw/utils/helpers.ts b/tests/pw/utils/helpers.ts index 0362729e52..33c211721c 100644 --- a/tests/pw/utils/helpers.ts +++ b/tests/pw/utils/helpers.ts @@ -1,7 +1,7 @@ -// const open = require( 'open' ); import fs from 'fs'; import { execSync } from 'child_process'; import { Browser, BrowserContextOptions, Page } from '@playwright/test'; +import open from 'open'; export const helpers = { // replace '_' to space & capitalize first letter of string @@ -275,14 +275,6 @@ export const helpers = { ); // Remove trailing - }, - // create env - createEnvVariable(key: string, value: string) { - const content = '\n' + key + '=' + value; - fs.appendFile('.env', content, 'utf8', err => { - if (err) throw err; - }); - }, - // check file existence fileExists(filePath: string) { return fs.existsSync(filePath); @@ -335,6 +327,14 @@ export const helpers = { fs.renameSync(newFilePath, oldFilePath); }, + // create env + createEnvVar(key: string, value: string) { + console.log(`${key}=${value}`); + const content = '\n' + `${key}=${value}`; + process.env[key] = value; + this.appendFile('.env', content); // for local testing + }, + // append content to .env file appendEnv(content: string) { content += '\n'; diff --git a/tests/pw/utils/payloads.ts b/tests/pw/utils/payloads.ts index 09ed56d120..51497ed22a 100644 --- a/tests/pw/utils/payloads.ts +++ b/tests/pw/utils/payloads.ts @@ -1211,12 +1211,12 @@ export const payloads = { // "no": "WordPress post tables", // "yes": "High performance order storage (new)" // }, - value: 'no', + value: 'yes', }, { id: 'woocommerce_custom_orders_table_data_sync_enabled', // description: "Keep the posts and orders tables in sync (compatibility mode).", - value: 'no', + value: 'yes', }, ], }, From 85993b114694871e67d8559cdec576b2b12b7756 Mon Sep 17 00:00:00 2001 From: shashwata Date: Thu, 22 Feb 2024 15:32:18 +0600 Subject: [PATCH 04/31] added menu manager tests --- tests/pw/.wp-env.override | 8 +- tests/pw/pages/basePage.ts | 6 + tests/pw/pages/menuManagerPage.ts | 88 ++++ tests/pw/pages/selectors.ts | 38 +- tests/pw/pages/vendorAuctionsPage.ts | 2 +- tests/pw/pages/vendorBookingPage.ts | 2 +- tests/pw/tests/api/productQA.spec.ts | 8 +- tests/pw/tests/e2e/menuManager.spec.ts | 68 ++++ tests/pw/utils/dbData.ts | 531 +++++++++++++++++++++++++ tests/pw/utils/interfaces.ts | 19 + tests/pw/utils/testData.ts | 33 +- 11 files changed, 778 insertions(+), 25 deletions(-) create mode 100644 tests/pw/pages/menuManagerPage.ts create mode 100644 tests/pw/tests/e2e/menuManager.spec.ts diff --git a/tests/pw/.wp-env.override b/tests/pw/.wp-env.override index b27c859277..ecf496c87e 100644 --- a/tests/pw/.wp-env.override +++ b/tests/pw/.wp-env.override @@ -6,10 +6,10 @@ "https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip", "../../", "../../../../", - "../../../woo-plugins/tests/plugins/woocommerce-bookings", - "../../../woo-plugins/tests/plugins/woocommerce-product-addons", - "../../../woo-plugins/tests/plugins/woocommerce-simple-auctions", - "../../../woo-plugins/tests/plugins/woocommerce-subscriptions" + "../../../../woo-plugins/tests/plugins/woocommerce-bookings", + "../../../../woo-plugins/tests/plugins/woocommerce-product-addons", + "../../../../woo-plugins/tests/plugins/woocommerce-simple-auctions", + "../../../../woo-plugins/tests/plugins/woocommerce-subscriptions" ] } } diff --git a/tests/pw/pages/basePage.ts b/tests/pw/pages/basePage.ts index e269523018..072fe1d1c5 100644 --- a/tests/pw/pages/basePage.ts +++ b/tests/pw/pages/basePage.ts @@ -1364,6 +1364,12 @@ export class BasePage { await expect(this.page.locator(selector)).toHaveClass(className); } + // assert element to have background color + async toHaveBackgroundColor(selector: string, backgroundColor: string) { + const value = await this.getElementBackgroundColor(selector); + expect(value).toBe(backgroundColor); + } + // assert element not to be visible async notToBeVisible(selector: string) { await expect(this.page.locator(selector)).toBeHidden(); diff --git a/tests/pw/pages/menuManagerPage.ts b/tests/pw/pages/menuManagerPage.ts new file mode 100644 index 0000000000..06e632f32b --- /dev/null +++ b/tests/pw/pages/menuManagerPage.ts @@ -0,0 +1,88 @@ +import { Page } from '@playwright/test'; +import { BasePage } from '@pages/basePage'; +import { selector } from '@pages/selectors'; +import { data } from '@utils/testData'; + +// selectors +const settingsAdmin = selector.admin.dokan.settings; + +export class MenuManagerPage extends BasePage { + constructor(page: Page) { + super(page); + } + + // seave settings + async saveSettings() { + await this.toContainText(settingsAdmin.dokanUpdateSuccessMessage, 'Setting has been saved successfully.'); + } + + // update menu status + async updateMenuStatus(menu: string, action: string, menuLink: string) { + await this.goIfNotThere(data.subUrls.backend.dokan.settings); + await this.click(settingsAdmin.menus.menuManager); + action === 'activate' ? await this.enableSwitcher(settingsAdmin.menuManager.menuSwithcher(menu)) : await this.disableSwitcher(settingsAdmin.menuManager.menuSwithcher(menu)); + await this.clickAndWaitForResponseAndLoadState(data.subUrls.ajax, settingsAdmin.menuManager.menuManagerSaveChanges); + const backgroundColor = action === 'activate' ? 'rgb(0, 144, 255)' : 'rgb(215, 218, 221)'; + await this.toHaveBackgroundColor(settingsAdmin.menuManager.menuSwithcher(menu) + '//span', backgroundColor); + + await this.goto(data.subUrls.frontend.vDashboard.dashboard); + action === 'activate' + ? await this.toBeVisible(selector.vendor.vDashboard.menus[menuLink as keyof typeof selector.vendor.vDashboard.menus]) + : await this.notToBeVisible(selector.vendor.vDashboard.menus[menuLink as keyof typeof selector.vendor.vDashboard.menus]); + await this.goto(data.subUrls.frontend.vDashboard[menuLink as keyof typeof data.subUrls.frontend.vDashboard]); + action === 'activate' ? await this.notToBeVisible(settingsAdmin.menuManager.noPermissionNotice) : await this.toBeVisible(settingsAdmin.menuManager.noPermissionNotice); + } + + // rename menu + async renameMenu(currentMenu: string, newMenu: string) { + await this.goIfNotThere(data.subUrls.backend.dokan.settings); + await this.click(settingsAdmin.menus.menuManager); + + //rename + await this.click(settingsAdmin.menuManager.menuEdit(currentMenu)); + await this.clearAndType(settingsAdmin.menuManager.menuNameInput, newMenu); + await this.click(settingsAdmin.menuManager.menuNameConfirm); + await this.clickAndWaitForResponseAndLoadState(data.subUrls.ajax, settingsAdmin.menuManager.menuManagerSaveChanges); + await this.toBeVisible(settingsAdmin.menuManager.menuEdit(newMenu)); + + await this.goto(data.subUrls.frontend.vDashboard.dashboard); + await this.toBeVisible(selector.vendor.vDashboard.menus.menuByText(newMenu)); + } + + async cantRenameMenu(menu: string) { + await this.goIfNotThere(data.subUrls.backend.dokan.settings); + await this.click(settingsAdmin.menus.menuManager); + + await this.notToBeVisible(settingsAdmin.menuManager.menuEdit(menu)); + } + + // dashboard cant be alterd + async cantAlterMenu(menu: string, isSubmenu?: boolean) { + await this.goIfNotThere(data.subUrls.backend.dokan.settings); + await this.click(settingsAdmin.menus.menuManager); + isSubmenu && (await this.click(settingsAdmin.menuManager.settingsSubMenu)); + + await this.notToBeVisible(settingsAdmin.menuManager.menuGrabber(menu)); + await this.notToBeVisible(settingsAdmin.menuManager.menuSwithcher(menu)); + } + + // reorderMenu + async reorderMenu(menu: string) { + await this.goIfNotThere(data.subUrls.backend.dokan.settings); + await this.click(settingsAdmin.menus.menuManager); + await this.clickAndWaitForResponseAndLoadState(data.subUrls.ajax, settingsAdmin.menuManager.menuManagerSaveChanges); + } + + // reset menu manager settings + async resetMenuManagerSettings(menu: string) { + await this.goIfNotThere(data.subUrls.backend.dokan.settings); + await this.click(settingsAdmin.menus.menuManager); + + // reset + await this.click(settingsAdmin.menuManager.resetAll); + await this.click(settingsAdmin.menuManager.confirmReset); + await this.clickAndWaitForResponseAndLoadState(data.subUrls.ajax, settingsAdmin.menuManager.menuManagerSaveChanges); + + await this.toHaveBackgroundColor(settingsAdmin.menuManager.menuSwithcher(menu) + '//span', 'rgb(0, 144, 255)'); + } +} diff --git a/tests/pw/pages/selectors.ts b/tests/pw/pages/selectors.ts index e839dc87ef..c03327631a 100644 --- a/tests/pw/pages/selectors.ts +++ b/tests/pw/pages/selectors.ts @@ -1,4 +1,5 @@ import { helpers } from '@utils/helpers'; +import { string } from 'zod'; export const selector = { // Login @@ -1855,6 +1856,7 @@ export const selector = { reverseWithdrawal: '//div[@class="nav-title" and contains(text(),"Reverse Withdrawal")]', pageSettings: '//div[@class="nav-title" and contains(text(),"Page Settings")]', appearance: '//div[@class="nav-title" and contains(text(),"Appearance")]', + menuManager: '//div[@class="nav-title" and contains(text(),"Menu Manager")]', privacyPolicy: '//div[@class="nav-title" and contains(text(),"Privacy Policy")]', colors: '//div[@class="nav-title" and contains(text(),"Colors")]', liveSearch: '//div[@class="nav-title" and contains(text(),"Live Search")]', @@ -2046,6 +2048,23 @@ export const selector = { appearanceSaveChanges: '#submit', }, + // Menu Manager + menuManager: { + leftMenu: '//a[contains(text(),"Left Menu")]', + settingsSubMenu: '//a[contains(text(),"Settings Sub Menu")]', + resetAll: 'div.menu-manager-reset-all', + confirmReset: '.swal2-confirm', + cancelReset: '.swal2-cancel', + menuGrabber: (menuName: string) => `//span[text()='${menuName}']/..//div[@class='grabber-wrapper-placeholder']//div[@class='svg-pull-wrapper']`, + menuEdit: (menuName: string) => `//span[text()='${menuName}']/../..//div[@class='action-icon-wrapper edit-icon-wrapper']`, + menuNameInput: '//div[@class="first-part"]//input', + menuNameConfirm: '//div[@class="menu-item"]//div[@class="action-icon-wrapper check-icon-wrapper"]', + menuNameCancel: '//div[@class="menu-item"]//div[@class="action-icon-wrapper cancel-icon-wrapper"]', + menuSwithcher: (menuName: string) => `//span[text()='${menuName}']/../..//label[@class="switch tips"]`, + menuManagerSaveChanges: '#submit', + noPermissionNotice: '//strong[text()="You have no permission to view this page"]', + }, + // Privacy Policy privacyPolicy: { // Privacy Policy @@ -3289,29 +3308,43 @@ export const selector = { // Dashboard Menus menus: { + menuByText: (menu: string) => `//a[contains(text(), "${menu}")]`, dashboard: '.dashboard a', products: '.products a', orders: '.orders a', - userSubscription: '.user-subscription a', + userSubscriptions: '.user-subscription a', + requestQuotes: '.requested-quotes a', coupons: '.coupons a', reports: '.reports a', deliveryTime: '.delivery-time-dashboard a', reviews: '.reviews a', withdraw: '.withdraw a', + reverseWithdrawal: '.reverse-withdrawal a', badges: '.seller-badge a', productQA: '.product-questions-answers a', returnRequest: '.return-request a', staff: '.staffs a', followers: '.followers a', booking: '.booking a', - analytics: '.analytics a', announcements: '.announcement a', + analytics: '.analytics a', tools: '.tools a', auction: '.auction a', support: '.support a', settings: '.settings a', visitStore: '//i[@class="fas fa-external-link-alt"]/..', editAccount: '.fa-user', + + //submenus + store: '.submenu-item.store', + addons: '.submenu-item.product-addon', + payment: '.submenu-item.payment', + verification: '.submenu-item.verification', + shipping: '.submenu-item.shipping', + shipStation: '.submenu-item.shipstation', + social: '.submenu-item.social', + rma: '.submenu-item.rma', + seo: '.submenu-item.seo', }, // profile Progress @@ -6890,6 +6923,7 @@ export const selector = { storeSocialIcons: { facebook: '.fa-facebook-square', twitter: '.fa-twitter-square', + // twitter: '.fa-square-x-twitter', // todo: replace after PR is merged pinterest: '.fa-pinterest-square', linked: '.fa-linkedin', youtube: '.fa-youtube-square', diff --git a/tests/pw/pages/vendorAuctionsPage.ts b/tests/pw/pages/vendorAuctionsPage.ts index 04472bb328..932af16fdf 100644 --- a/tests/pw/pages/vendorAuctionsPage.ts +++ b/tests/pw/pages/vendorAuctionsPage.ts @@ -95,7 +95,7 @@ export class AuctionsPage extends VendorPage { await this.goIfNotThere(data.subUrls.frontend.vDashboard.auction); await this.clickAndWaitForLoadState(auctionProductsVendor.addNewActionProduct); await this.updateAuctionProductFields(product); - await this.clickAndWaitForResponseAndLoadState(data.subUrls.frontend.vDashboard.productAuction, auctionProductsVendor.auction.addAuctionProduct, 302); + await this.clickAndWaitForResponseAndLoadState(data.subUrls.frontend.vDashboard.auction, auctionProductsVendor.auction.addAuctionProduct, 302); await this.toContainText(selector.vendor.product.updatedSuccessMessage, product.saveSuccessMessage); } diff --git a/tests/pw/pages/vendorBookingPage.ts b/tests/pw/pages/vendorBookingPage.ts index 2c2481fff2..9b0ecb6229 100644 --- a/tests/pw/pages/vendorBookingPage.ts +++ b/tests/pw/pages/vendorBookingPage.ts @@ -164,7 +164,7 @@ export class BookingPage extends VendorPage { await this.goIfNotThere(data.subUrls.frontend.vDashboard.booking); await this.clickAndWaitForLoadState(bookingProductsVendor.addNewBookingProduct); await this.updateBookingProductFields(product); - await this.clickAndWaitForResponseAndLoadState(data.subUrls.frontend.vDashboard.productBooking, bookingProductsVendor.booking.saveProduct, 302); + await this.clickAndWaitForResponseAndLoadState(data.subUrls.frontend.vDashboard.addBookingProduct, bookingProductsVendor.booking.saveProduct, 302); await this.toContainText(selector.vendor.product.updatedSuccessMessage, product.saveSuccessMessage); } diff --git a/tests/pw/tests/api/productQA.spec.ts b/tests/pw/tests/api/productQA.spec.ts index 8d7502ec96..2ec270197a 100644 --- a/tests/pw/tests/api/productQA.spec.ts +++ b/tests/pw/tests/api/productQA.spec.ts @@ -28,10 +28,13 @@ test.describe('product questions and answeres api test', () => { test.beforeAll(async () => { apiUtils = new ApiUtils(await request.newContext()); [, questionId] = await apiUtils.createProductQuestion({ ...payloads.createProductQuestion(), product_id: PRODUCT_ID }, payloads.customerAuth); - [, answerId] = await apiUtils.createProductQuestionAnswer({ ...payloads.createProductQuestionAnswer(), question_id: questionId }, payloads.vendorAuth); + // todo: vendor can't create answer + [, answerId] = await apiUtils.createProductQuestionAnswer({ ...payloads.createProductQuestionAnswer(), question_id: questionId }, payloads.adminAuth); + console.log(questionId, answerId); }); test.afterAll(async () => { + // await apiUtils.deleteAllProductQuestions(payloads.adminAuth); await apiUtils.dispose(); }); @@ -59,6 +62,7 @@ test.describe('product questions and answeres api test', () => { }); test('update a product question @pro', async () => { + test.skip(true, 'PR has Issue'); const [response, responseBody] = await apiUtils.put(endPoints.updateProductQuestion(questionId), { data: payloads.updateProductQuestion() }); expect(response.ok()).toBeTruthy(); expect(responseBody).toBeTruthy(); @@ -97,7 +101,7 @@ test.describe('product questions and answeres api test', () => { }); test('create a product question answer @pro', async () => { - const [response, responseBody] = await apiUtils.post(endPoints.createProductQuestionAnswer, { data: { ...payloads.createProductQuestionAnswer(), question_id: questionId }, headers: payloads.vendorAuth }); + const [response, responseBody] = await apiUtils.post(endPoints.createProductQuestionAnswer, { data: { ...payloads.createProductQuestionAnswer(), question_id: questionId }, headers: payloads.adminAuth }); expect(response.ok()).toBeTruthy(); expect(responseBody).toBeTruthy(); expect(responseBody).toMatchSchema(schemas.productQaSchema.productQuestionAnswerSchema); diff --git a/tests/pw/tests/e2e/menuManager.spec.ts b/tests/pw/tests/e2e/menuManager.spec.ts new file mode 100644 index 0000000000..08e8d98fa5 --- /dev/null +++ b/tests/pw/tests/e2e/menuManager.spec.ts @@ -0,0 +1,68 @@ +import { test, Page } from '@playwright/test'; +import { MenuManagerPage } from '@pages/menuManagerPage'; +import { dbUtils } from '@utils/dbUtils'; +import { data } from '@utils/testData'; +import { dbData } from '@utils/dbData'; + +test.describe('Menu Manager test', () => { + test.skip(true, 'feature not merged yet'); + let admin: MenuManagerPage; + let aPage: Page; + + test.beforeAll(async ({ browser }) => { + const adminContext = await browser.newContext(data.auth.adminAuth); + aPage = await adminContext.newPage(); + admin = new MenuManagerPage(aPage); + }); + + test.afterAll(async () => { + await dbUtils.setDokanSettings(dbData.dokan.optionName.menuManager, dbData.dokan.menuManagerSettings); + await aPage.close(); + }); + + //admin + + test('admin can deactivate menu @pro @a', async () => { + await admin.updateMenuStatus('Analytics', 'deactivate', 'analytics'); + //reset + await dbUtils.setDokanSettings(dbData.dokan.optionName.menuManager, dbData.dokan.menuManagerSettings); + }); + + test('admin can activate menu@pro @a', async () => { + await updateMenuStatusByDB('user-subscription', 'false'); + await admin.updateMenuStatus('User Subscriptions', 'activate', 'userSubscriptions'); + }); + + test('admin can rename menu @pro @a', async () => { + await admin.renameMenu('Request Quotes', 'Quotations'); + //reset + await dbUtils.setDokanSettings(dbData.dokan.optionName.menuManager, dbData.dokan.menuManagerSettings); + }); + + test("admin can't rename disabled menu @pro @a", async () => { + await updateMenuStatusByDB('auction', 'false'); + await admin.cantRenameMenu('Auction'); + //reset + await dbUtils.setDokanSettings(dbData.dokan.optionName.menuManager, dbData.dokan.menuManagerSettings); + }); + + test.skip('admin can redorder menu @pro @a', async () => { + await admin.reorderMenu('Orders'); + }); + + test("admin can't redorder or toggle status of dashboard & store menu @pro @a", async () => { + await admin.cantAlterMenu('Dashboard'); + await admin.cantAlterMenu('Store', true); + }); + + test('admin can reset menu manager settings @pro @a', async () => { + await updateMenuStatusByDB('auction', 'false'); + await admin.resetMenuManagerSettings('Auction'); + }); +}); + +async function updateMenuStatusByDB(key: string, value: string) { + const menuManagerSettings = dbData.dokan.menuManagerSettings; + menuManagerSettings.dashboard_menu_manager.left_menus[key as keyof typeof menuManagerSettings.dashboard_menu_manager.left_menus].is_switched_on = value; + await dbUtils.setDokanSettings(dbData.dokan.optionName.menuManager, menuManagerSettings); +} diff --git a/tests/pw/utils/dbData.ts b/tests/pw/utils/dbData.ts index c180616fcd..457e17bd3d 100644 --- a/tests/pw/utils/dbData.ts +++ b/tests/pw/utils/dbData.ts @@ -1,3 +1,5 @@ +const { BASE_URL } = process.env; + export const dbData = { dokan: { optionName: { @@ -7,6 +9,7 @@ export const dbData = { reverseWithdraw: 'dokan_reverse_withdrawal', page: 'dokan_pages', appearance: 'dokan_appearance', + menuManager: 'dokan_menu_manager', privacyPolicy: 'dokan_privacy', colors: 'dokan_colors', // liveSearch: 'dokan_live_search_setting', @@ -212,6 +215,534 @@ export const dbData = { disable_dokan_fontawesome: 'off', }, + menuManagerSettings: { + menu_manager_menu_tab: '', + dashboard_menu_manager: { + left_menus: { + dashboard: { + menu_key: 'dashboard', + is_sortable: 'false', + previous_title: 'Dashboard', + menu_manager_title: 'Dashboard', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'false', + is_switched_on: 'true', + menu_manager_position: '0', + title: 'Dashboard', + icon: '', + url: `${BASE_URL}/dashboard/`, + pos: '10', + permission: 'dokan_view_overview_menu', + }, + products: { + menu_key: 'products', + is_sortable: 'true', + previous_title: 'Products', + menu_manager_title: 'Products', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '1', + title: 'Products', + icon: '', + url: `${BASE_URL}/dashboard/products/`, + pos: '30', + permission: 'dokan_view_product_menu', + }, + orders: { + menu_key: 'orders', + is_sortable: 'true', + previous_title: 'Orders', + menu_manager_title: 'Orders', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '2', + title: 'Orders', + icon: '', + url: `${BASE_URL}/dashboard/orders/`, + pos: '50', + permission: 'dokan_view_order_menu', + }, + 'user-subscription': { + menu_key: 'user-subscription', + is_sortable: 'true', + previous_title: 'User Subscriptions', + menu_manager_title: 'User Subscriptions', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '3', + title: 'User Subscriptions', + icon: '', + url: `${BASE_URL}/dashboard/user-subscription/`, + pos: '50', + permission: 'dokan_view_order_menu', + }, + 'requested-quotes': { + menu_key: 'requested-quotes', + is_sortable: 'true', + previous_title: 'Request Quotes', + menu_manager_title: 'Request Quotes', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '4', + title: 'Request Quotes', + icon: '', + url: `${BASE_URL}/dashboard/requested-quotes/`, + pos: '53', + permission: 'dokan_view_request_quote_menu', + }, + coupons: { + menu_key: 'coupons', + is_sortable: 'true', + previous_title: 'Coupons', + menu_manager_title: 'Coupons', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '5', + title: 'Coupons', + icon: '', + url: `${BASE_URL}/dashboard/coupons/`, + pos: '55', + permission: 'dokan_view_coupon_menu', + }, + reports: { + menu_key: 'reports', + is_sortable: 'true', + previous_title: 'Reports', + menu_manager_title: 'Reports', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '6', + title: 'Reports', + icon: '', + url: `${BASE_URL}/dashboard/reports/`, + pos: '60', + permission: 'dokan_view_report_menu', + }, + 'delivery-time-dashboard': { + menu_key: 'delivery-time-dashboard', + is_sortable: 'true', + previous_title: 'Delivery Time', + menu_manager_title: 'Delivery Time', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '7', + title: 'Delivery Time', + icon: '', + url: `${BASE_URL}/dashboard/delivery-time-dashboard/`, + pos: '61', + }, + reviews: { + menu_key: 'reviews', + is_sortable: 'true', + previous_title: 'Reviews', + menu_manager_title: 'Reviews', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '8', + title: 'Reviews', + icon: '', + url: `${BASE_URL}/dashboard/reviews/`, + pos: '65', + permission: 'dokan_view_review_menu', + }, + withdraw: { + menu_key: 'withdraw', + is_sortable: 'true', + previous_title: 'Withdraw', + menu_manager_title: 'Withdraw', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '9', + title: 'Withdraw', + icon: '', + url: `${BASE_URL}/dashboard/withdraw/`, + pos: '70', + permission: 'dokan_view_withdraw_menu', + }, + 'reverse-withdrawal': { + menu_key: 'reverse-withdrawal', + is_sortable: 'true', + previous_title: 'Reverse Withdrawal', + menu_manager_title: 'Reverse Withdrawal', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '10', + title: 'Reverse Withdrawal', + icon: '', + url: `${BASE_URL}/dashboard/reverse-withdrawal/`, + pos: '71', + permission: 'dokan_view_withdraw_menu', + }, + 'seller-badge': { + menu_key: 'seller-badge', + is_sortable: 'true', + previous_title: 'Badge', + menu_manager_title: 'Badge', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '11', + title: 'Badge', + icon: '', + url: `${BASE_URL}/dashboard/seller-badge/`, + pos: '73', + permission: 'dokan_view_badge_menu', + }, + 'product-questions-answers': { + menu_key: 'product-questions-answers', + is_sortable: 'true', + previous_title: 'Product Q&A', + menu_manager_title: 'Product Q&A', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '12', + title: 'Product Q&A', + icon: '', + url: `${BASE_URL}/dashboard/product-questions-answers/`, + pos: '80', + permission: 'dokandar', + }, + 'return-request': { + menu_key: 'return-request', + is_sortable: 'true', + previous_title: 'Return Request', + menu_manager_title: 'Return Request', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '13', + title: 'Return Request', + icon: '', + url: `${BASE_URL}/dashboard/return-request/`, + pos: '170', + permission: 'dokan_view_store_rma_menu', + }, + staffs: { + menu_key: 'staffs', + is_sortable: 'true', + previous_title: 'Staff', + menu_manager_title: 'Staff', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '14', + title: 'Staff', + icon: '', + url: `${BASE_URL}/dashboard/staffs/`, + pos: '172', + }, + followers: { + menu_key: 'followers', + is_sortable: 'true', + previous_title: 'Followers', + menu_manager_title: 'Followers', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '15', + title: 'Followers', + icon: '', + url: `${BASE_URL}/dashboard/followers/`, + pos: '175', + permission: 'dokan_view_overview_menu', + }, + booking: { + menu_key: 'booking', + is_sortable: 'true', + previous_title: 'Booking', + menu_manager_title: 'Booking', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '16', + title: 'Booking', + icon: '', + url: `${BASE_URL}/dashboard/booking/`, + pos: '180', + }, + announcement: { + menu_key: 'announcement', + is_sortable: 'true', + previous_title: 'Announcements', + menu_manager_title: 'Announcements', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '17', + title: 'Announcements', + icon: '', + url: `${BASE_URL}/dashboard/announcement/`, + pos: '181', + }, + analytics: { + menu_key: 'analytics', + is_sortable: 'true', + previous_title: 'Analytics', + menu_manager_title: 'Analytics', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '18', + title: 'Analytics', + icon: '', + url: `${BASE_URL}/dashboard/analytics/`, + pos: '182', + }, + tools: { + menu_key: 'tools', + is_sortable: 'true', + previous_title: 'Tools', + menu_manager_title: 'Tools', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '19', + title: 'Tools', + icon: '', + url: `${BASE_URL}/dashboard/tools/`, + pos: '183', + }, + auction: { + menu_key: 'auction', + is_sortable: 'true', + previous_title: 'Auction', + menu_manager_title: 'Auction', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '20', + title: 'Auction', + icon: '', + url: `${BASE_URL}/dashboard/auction/`, + pos: '185', + permission: 'dokan_view_auction_menu', + }, + support: { + menu_key: 'support', + is_sortable: 'true', + previous_title: 'Support', + menu_manager_title: 'Support', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '21', + title: 'Support', + icon: '', + url: `${BASE_URL}/dashboard/support/`, + pos: '199', + }, + }, + settings_sub_menu: { + store: { + menu_key: 'store', + is_sortable: 'false', + previous_title: 'Store', + menu_manager_title: 'Store', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'false', + is_switched_on: 'true', + menu_manager_position: '0', + title: 'Store', + icon: '', + url: `${BASE_URL}/dashboard/settings/store/`, + pos: '30', + permission: 'dokan_view_store_settings_menu', + }, + 'product-addon': { + menu_key: 'product-addon', + is_sortable: 'true', + previous_title: 'Addons', + menu_manager_title: 'Addons', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '1', + title: 'Addons', + icon: '', + url: `${BASE_URL}/dashboard/settings/product-addon/`, + pos: '40', + }, + payment: { + menu_key: 'payment', + is_sortable: 'true', + previous_title: 'Payment', + menu_manager_title: 'Payment', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '2', + title: 'Payment', + icon: '', + url: `${BASE_URL}/dashboard/settings/payment/`, + pos: '50', + permission: 'dokan_view_store_payment_menu', + }, + verification: { + menu_key: 'verification', + is_sortable: 'true', + previous_title: 'Verification', + menu_manager_title: 'Verification', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '3', + title: 'Verification', + icon: '', + url: `${BASE_URL}/dashboard/settings/verification/`, + pos: '55', + permission: 'dokan_view_store_verification_menu', + }, + shipping: { + menu_key: 'shipping', + is_sortable: 'true', + previous_title: 'Shipping', + menu_manager_title: 'Shipping', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '4', + title: 'Shipping', + icon: '', + url: `${BASE_URL}/dashboard/settings/shipping/`, + pos: '70', + permission: 'dokan_view_store_shipping_menu', + }, + shipstation: { + menu_key: 'shipstation', + is_sortable: 'true', + previous_title: 'ShipStation', + menu_manager_title: 'ShipStation', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '5', + title: 'ShipStation', + icon: '', + url: `${BASE_URL}/dashboard/settings/shipstation/`, + pos: '72', + permission: 'dokan_view_store_shipping_menu', + }, + social: { + menu_key: 'social', + is_sortable: 'true', + previous_title: 'Social Profile', + menu_manager_title: 'Social Profile', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '6', + title: 'Social Profile', + icon: '', + url: `${BASE_URL}/dashboard/settings/social/`, + pos: '90', + permission: 'dokan_view_store_social_menu', + }, + rma: { + menu_key: 'rma', + is_sortable: 'true', + previous_title: 'RMA', + menu_manager_title: 'RMA', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '7', + title: 'RMA', + icon: '', + url: `${BASE_URL}/dashboard/settings/rma/`, + pos: '93', + permission: 'dokan_view_store_rma_menu', + }, + seo: { + menu_key: 'seo', + is_sortable: 'true', + previous_title: 'Store SEO', + menu_manager_title: 'Store SEO', + edit_now: 'false', + editable: 'true', + temporary_disable_edit: 'false', + switchable: 'true', + is_switched_on: 'true', + menu_manager_position: '8', + title: 'Store SEO', + icon: '', + url: `${BASE_URL}/dashboard/settings/seo/`, + pos: '110', + permission: 'dokan_view_store_seo_menu', + }, + }, + }, + }, privacyPolicySettings: { enable_privacy: 'on', privacy_page: '2', diff --git a/tests/pw/utils/interfaces.ts b/tests/pw/utils/interfaces.ts index affb101453..2ad06cfe00 100644 --- a/tests/pw/utils/interfaces.ts +++ b/tests/pw/utils/interfaces.ts @@ -1849,3 +1849,22 @@ export interface questionsAnswers { password: string; }; } + +export interface dashboardMenu { + menu_key: string; + is_sortable: string; + previous_title: string; + menu_manager_title: string; + edit_now: string; + editable: string; + temporary_disable_edit: string; + switchable: string; + is_switched_on: string; + menu_manager_position: string; + title: string; + icon: string; + url: string; + pos: string; + permission: string; + +} diff --git a/tests/pw/utils/testData.ts b/tests/pw/utils/testData.ts index d957cff562..3ebc852bd8 100644 --- a/tests/pw/utils/testData.ts +++ b/tests/pw/utils/testData.ts @@ -904,9 +904,7 @@ export const data = { setupWizard: '?page=dokan-seller-setup', dashboard: 'dashboard', products: 'dashboard/products', - productSearch: 'products/?product_listing_search', - productAuction: 'dashboard/auction', - productBooking: 'dashboard/booking/new-product', + spmv: 'dashboard/products-search', orders: 'dashboard/orders', userSubscriptions: 'dashboard/user-subscription', requestQuotes: 'dashboard/requested-quotes', @@ -918,31 +916,39 @@ export const data = { reviews: 'dashboard/reviews', withdraw: 'dashboard/withdraw', withdrawRequests: 'dashboard/withdraw-requests', + reverseWithdrawal: 'dashboard/reverse-withdrawal', badges: 'dashboard/seller-badge', productQA: 'dashboard/product-questions-answers', questionDetails: (questionId: string) => `dashboard/product-questions-answers/?question_id=${questionId}`, - reverseWithdrawal: 'dashboard/reverse-withdrawal', returnRequest: 'dashboard/return-request', staff: 'dashboard/staffs', followers: 'dashboard/followers', - analytics: 'dashboard/analytics', + booking: 'dashboard/booking', + addBookingProduct: 'dashboard/booking/new-product', + addBooking: 'dashboard/booking/add-booking', + manageBooking: 'dashboard/booking/my-bookings', + bookingCalendar: 'dashboard/booking/calendar', + manageResources: 'dashboard/booking/resources', announcements: 'dashboard/announcement', + analytics: 'dashboard/analytics', tools: 'dashboard/tools', export: 'dashboard/tools/#export', csvImport: 'dashboard/tools/csv-import', csvExport: 'dashboard/tools/csv-export', auction: 'dashboard/auction', auctionActivity: 'dashboard/auction-activity', - booking: 'dashboard/booking', - addBooking: 'dashboard/booking/add-booking', - manageBooking: 'dashboard/booking/my-bookings', - bookingCalendar: 'dashboard/booking/calendar', - manageResources: 'dashboard/booking/resources', storeSupport: 'dashboard/support', - spmv: 'dashboard/products-search', + + // sub menus settingsStore: 'dashboard/settings/store', settingsAddon: 'dashboard/settings/product-addon', settingsPayment: 'dashboard/settings/payment', + // payment settings + paypal: 'dashboard/settings/payment-manage-paypal', + bankTransfer: 'dashboard/settings/payment-manage-bank', + customPayment: 'dashboard/settings/payment-manage-dokan_custom', + skrill: 'dashboard/settings/payment-manage-skrill', + settingsVerification: 'dashboard/settings/verification', settingsDeliveryTime: 'dashboard/settings/delivery-time', settingsShipping: 'dashboard/settings/shipping', @@ -950,11 +956,8 @@ export const data = { settingsSocialProfile: 'dashboard/settings/social', settingsRma: 'dashboard/settings/rma', settingsSeo: 'dashboard/settings/seo', + editAccountVendor: 'dashboard/edit-account', - paypal: 'dashboard/settings/payment-manage-paypal', - bankTransfer: 'dashboard/settings/payment-manage-bank', - customPayment: 'dashboard/settings/payment-manage-dokan_custom', - skrill: 'dashboard/settings/payment-manage-skrill', }, }, From 6e404fa23a96287089f3dbe9fda0c748830db164 Mon Sep 17 00:00:00 2001 From: shashwata Date: Thu, 22 Feb 2024 17:19:09 +0600 Subject: [PATCH 05/31] update reporter condition --- .github/workflows/e2e_api_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index ffaccf9b51..b4122b788b 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -195,7 +195,7 @@ jobs: - name: Prepare test summary id: prepare-test-summary uses: actions/github-script@v7 - if: steps.e2e-test.outcome == 'success' || steps.api-test.outcome == 'success' + if: always() with: result-encoding: string script: | From 0efa060187cd738072060ecafe4028640ad8600b Mon Sep 17 00:00:00 2001 From: shashwata Date: Fri, 23 Feb 2024 09:34:29 +0600 Subject: [PATCH 06/31] added menu-manager test --- tests/pw/pages/basePage.ts | 68 ++++++++++++++------------ tests/pw/pages/menuManagerPage.ts | 60 +++++++++++++++++------ tests/pw/pages/selectors.ts | 53 ++++++++++---------- tests/pw/pages/spmvPage.ts | 2 +- tests/pw/tests/e2e/menuManager.spec.ts | 7 ++- 5 files changed, 114 insertions(+), 76 deletions(-) diff --git a/tests/pw/pages/basePage.ts b/tests/pw/pages/basePage.ts index 072fe1d1c5..9274044e49 100644 --- a/tests/pw/pages/basePage.ts +++ b/tests/pw/pages/basePage.ts @@ -168,11 +168,11 @@ export class BasePage { // click on element async click(selector: string): Promise { await this.clickLocator(selector); - // await this.clickViaPage(selector); + // await this.clickByPage(selector); } // click on element - async clickViaPage(selector: string): Promise { + async clickByPage(selector: string): Promise { await this.page.click(selector); } @@ -277,7 +277,7 @@ export class BasePage { } // type & wait for response - async typeViaPageAndWaitForResponse(subUrl: string, selector: string, text: string, code = 200): Promise { + async typeByPageAndWaitForResponse(subUrl: string, selector: string, text: string, code = 200): Promise { const [response] = await Promise.all([this.page.waitForResponse(resp => resp.url().includes(subUrl) && resp.status() === code), this.page.locator(selector).pressSequentially(text, { delay: 100 })]); return response; } @@ -399,11 +399,11 @@ export class BasePage { // returns whether the element is visible async isVisible(selector: string): Promise { return await this.isVisibleLocator(selector); - // return await this.isVisibleViaPage(selector); + // return await this.isVisibleByPage(selector); } // returns whether the element is visible - async isVisibleViaPage(selector: string): Promise { + async isVisibleByPage(selector: string): Promise { return await this.page.isVisible(selector); } @@ -429,7 +429,7 @@ export class BasePage { } // returns whether the element is disabled - async isDisabledViaPage(selector: string): Promise { + async isDisabledByPage(selector: string): Promise { return await this.page.isDisabled(selector); } @@ -475,7 +475,7 @@ export class BasePage { } // get element text content - async getElementTextViaPage(selector: string): Promise { + async getElementTextByPage(selector: string): Promise { return await this.page.textContent(selector); } @@ -628,12 +628,12 @@ export class BasePage { // clear input field and type async clearAndType(selector: string, text: string): Promise { await this.fill(selector, text); - // await this.clearAndTypeViaPage(selector, text); + // await this.clearAndTypeByPage(selector, text); } // clear input field and type - async clearAndTypeViaPage(selector: string, text: string): Promise { - await this.clearInputField1(selector); + async clearAndTypeByPage(selector: string, text: string): Promise { + await this.clearInputFieldByMultipleClick(selector); await this.type(selector, text); } @@ -681,18 +681,18 @@ export class BasePage { } // check input fields [checkbox/radio] - async check1(selector: string): Promise { + async checkByPage(selector: string): Promise { await this.page.check(selector); } // check input fields [checkbox/radio] async check(selector: string): Promise { await this.checkLocator(selector); - // await this.checkViaPage(selector); + // await this.checkByPage(selector); } // check input fields [checkbox/radio] - async checkViaPage(selector: string): Promise { + async checkBySetChecked(selector: string): Promise { await this.page.setChecked(selector, true); } @@ -713,19 +713,19 @@ export class BasePage { * Input field methods */ - // // select option by value/text/index - // async select(selector: string, choice: string, value: string | number): Promise { - // switch (choice) { - // case 'value': - // return await this.page.selectOption(selector, {value: value}) - // case 'label': - // return await this.page.selectOption(selector, {label: value}) - // case 'index': - // return await this.page.selectOption(selector, {index: value}) - // default: - // break - // } - // } + // select option by value/text/index + async select(selector: string, choice: string, value: string | number): Promise { + switch (choice) { + case 'value': + return await this.page.selectOption(selector, { value: value as string }); + case 'label': + return await this.page.selectOption(selector, { label: value as string }); + case 'index': + return await this.page.selectOption(selector, { index: value as number }); + default: + return []; + } + } // select by value async selectByValue(selector: string, value: string): Promise { @@ -754,12 +754,6 @@ export class BasePage { return response; } - // set value based on select options text - // async selectByText(selectSelector: string, optionSelector: string, text: string): Promise { - // let optionValue = await this.page.$$eval(optionSelector, (options, text) => options.find(option => (option.innerText).toLowerCase() === text.toLowerCase())?.value, text) - // await this.selectByValue(selectSelector, optionValue); - // } - /** * Files & Media methods */ @@ -952,6 +946,16 @@ export class BasePage { return await locator.evaluateHandle(pageFunction); } + // get locator index relative to it's parent + async getLocatorIndex(parentSelector: string, childSelector: string): Promise { + // const parent = await this.getElementHandle(parentSelector); + const parent = this.getElement(parentSelector); + const child = await this.getElementHandle(childSelector); + const index = await parent.evaluate((parent, child) => Array.from(parent.children).indexOf(child as HTMLElement), child); + console.log(index); + return index; + } + // fill input locator async fillLocator(selector: string, text: string): Promise { const locator = this.page.locator(selector); diff --git a/tests/pw/pages/menuManagerPage.ts b/tests/pw/pages/menuManagerPage.ts index 06e632f32b..0cbebf4047 100644 --- a/tests/pw/pages/menuManagerPage.ts +++ b/tests/pw/pages/menuManagerPage.ts @@ -1,4 +1,4 @@ -import { Page } from '@playwright/test'; +import { Page, expect } from '@playwright/test'; import { BasePage } from '@pages/basePage'; import { selector } from '@pages/selectors'; import { data } from '@utils/testData'; @@ -20,17 +20,32 @@ export class MenuManagerPage extends BasePage { async updateMenuStatus(menu: string, action: string, menuLink: string) { await this.goIfNotThere(data.subUrls.backend.dokan.settings); await this.click(settingsAdmin.menus.menuManager); - action === 'activate' ? await this.enableSwitcher(settingsAdmin.menuManager.menuSwithcher(menu)) : await this.disableSwitcher(settingsAdmin.menuManager.menuSwithcher(menu)); - await this.clickAndWaitForResponseAndLoadState(data.subUrls.ajax, settingsAdmin.menuManager.menuManagerSaveChanges); - const backgroundColor = action === 'activate' ? 'rgb(0, 144, 255)' : 'rgb(215, 218, 221)'; - await this.toHaveBackgroundColor(settingsAdmin.menuManager.menuSwithcher(menu) + '//span', backgroundColor); - - await this.goto(data.subUrls.frontend.vDashboard.dashboard); - action === 'activate' - ? await this.toBeVisible(selector.vendor.vDashboard.menus[menuLink as keyof typeof selector.vendor.vDashboard.menus]) - : await this.notToBeVisible(selector.vendor.vDashboard.menus[menuLink as keyof typeof selector.vendor.vDashboard.menus]); - await this.goto(data.subUrls.frontend.vDashboard[menuLink as keyof typeof data.subUrls.frontend.vDashboard]); - action === 'activate' ? await this.notToBeVisible(settingsAdmin.menuManager.noPermissionNotice) : await this.toBeVisible(settingsAdmin.menuManager.noPermissionNotice); + switch (action) { + case 'activate': + await this.enableSwitcher(settingsAdmin.menuManager.menuSwithcher(menu)); + await this.clickAndWaitForResponseAndLoadState(data.subUrls.ajax, settingsAdmin.menuManager.menuManagerSaveChanges); + await this.toHaveBackgroundColor(settingsAdmin.menuManager.menuSwithcher(menu) + '//span', 'rgb(0, 144, 255)'); + //assertion + await this.goto(data.subUrls.frontend.vDashboard.dashboard); + await this.toBeVisible((selector.vendor.vDashboard.menus as any)[menuLink]); + await this.goto((data.subUrls.frontend.vDashboard as any)[menuLink]); + await this.notToBeVisible(settingsAdmin.menuManager.noPermissionNotice); + break; + + case 'deactivate': + await this.disableSwitcher(settingsAdmin.menuManager.menuSwithcher(menu)); + await this.clickAndWaitForResponseAndLoadState(data.subUrls.ajax, settingsAdmin.menuManager.menuManagerSaveChanges); + await this.toHaveBackgroundColor(settingsAdmin.menuManager.menuSwithcher(menu) + '//span', 'rgb(215, 218, 221)'); + //assertion + await this.goto(data.subUrls.frontend.vDashboard.dashboard); + await this.notToBeVisible((selector.vendor.vDashboard.menus as any)[menuLink]); + await this.goto((data.subUrls.frontend.vDashboard as any)[menuLink]); + await this.toBeVisible(settingsAdmin.menuManager.noPermissionNotice); + break; + + default: + break; + } } // rename menu @@ -62,15 +77,32 @@ export class MenuManagerPage extends BasePage { await this.click(settingsAdmin.menus.menuManager); isSubmenu && (await this.click(settingsAdmin.menuManager.settingsSubMenu)); - await this.notToBeVisible(settingsAdmin.menuManager.menuGrabber(menu)); + await this.hasClass(settingsAdmin.menuManager.menuGrabber(menu), 'not-sortable'); await this.notToBeVisible(settingsAdmin.menuManager.menuSwithcher(menu)); } // reorderMenu - async reorderMenu(menu: string) { + async reorderMenu(source: string, target: string) { await this.goIfNotThere(data.subUrls.backend.dokan.settings); await this.click(settingsAdmin.menus.menuManager); + const initialSourceIndex = await this.getLocatorIndex(settingsAdmin.menuManager.menuParent, settingsAdmin.menuManager.menuGrabber(source)); + const initialTargetIndex = await this.getLocatorIndex(settingsAdmin.menuManager.menuParent, settingsAdmin.menuManager.menuGrabber(target)); + + await this.dragToTargetLocator(settingsAdmin.menuManager.menuGrabber(source), settingsAdmin.menuManager.menuGrabber(target)); await this.clickAndWaitForResponseAndLoadState(data.subUrls.ajax, settingsAdmin.menuManager.menuManagerSaveChanges); + + const newSourceIndex = await this.getLocatorIndex(settingsAdmin.menuManager.menuParent, settingsAdmin.menuManager.menuGrabber(source)); + const newTargetIndex = await this.getLocatorIndex(settingsAdmin.menuManager.menuParent, settingsAdmin.menuManager.menuGrabber(target)); + + expect(newSourceIndex).toEqual(initialTargetIndex); + expect(newTargetIndex).toEqual(initialSourceIndex); + + await this.goto(data.subUrls.frontend.vDashboard.dashboard); + const sourceIndexDashboard = await this.getLocatorIndex(selector.vendor.vDashboard.menuParent, selector.vendor.vDashboard.menus.menuByText(source) + '/..'); + const targetIndexDashboard = await this.getLocatorIndex(selector.vendor.vDashboard.menuParent, selector.vendor.vDashboard.menus.menuByText(target) + '/..'); + + expect(sourceIndexDashboard).toEqual(newSourceIndex); + expect(targetIndexDashboard).toEqual(newTargetIndex); } // reset menu manager settings diff --git a/tests/pw/pages/selectors.ts b/tests/pw/pages/selectors.ts index c03327631a..d2cb15a418 100644 --- a/tests/pw/pages/selectors.ts +++ b/tests/pw/pages/selectors.ts @@ -2055,7 +2055,9 @@ export const selector = { resetAll: 'div.menu-manager-reset-all', confirmReset: '.swal2-confirm', cancelReset: '.swal2-cancel', - menuGrabber: (menuName: string) => `//span[text()='${menuName}']/..//div[@class='grabber-wrapper-placeholder']//div[@class='svg-pull-wrapper']`, + menuParent:'(//div[@class="tabs-details"]//div)[2]', + allMenus: 'div.menu_manager_menu_tab div.menu-item', + menuGrabber: (menuName: string) => `//span[text()='${menuName}']/../..`, menuEdit: (menuName: string) => `//span[text()='${menuName}']/../..//div[@class='action-icon-wrapper edit-icon-wrapper']`, menuNameInput: '//div[@class="first-part"]//input', menuNameConfirm: '//div[@class="menu-item"]//div[@class="action-icon-wrapper check-icon-wrapper"]', @@ -3307,31 +3309,32 @@ export const selector = { dokanAlert: '.dokan-alert.dokan-alert-warning', // Dashboard Menus + menuParent: '#dokan-navigation ul.dokan-dashboard-menu', menus: { - menuByText: (menu: string) => `//a[contains(text(), "${menu}")]`, - dashboard: '.dashboard a', - products: '.products a', - orders: '.orders a', - userSubscriptions: '.user-subscription a', - requestQuotes: '.requested-quotes a', - coupons: '.coupons a', - reports: '.reports a', - deliveryTime: '.delivery-time-dashboard a', - reviews: '.reviews a', - withdraw: '.withdraw a', - reverseWithdrawal: '.reverse-withdrawal a', - badges: '.seller-badge a', - productQA: '.product-questions-answers a', - returnRequest: '.return-request a', - staff: '.staffs a', - followers: '.followers a', - booking: '.booking a', - announcements: '.announcement a', - analytics: '.analytics a', - tools: '.tools a', - auction: '.auction a', - support: '.support a', - settings: '.settings a', + menuByText: (menu: string) => `//div[@id='dokan-navigation']//ul//li//a[contains(text(), "${menu}")]`, + dashboard: 'ul.dokan-dashboard-menu li.dashboard a', + products: 'ul.dokan-dashboard-menu li.products a', + orders: 'ul.dokan-dashboard-menu li.orders a', + userSubscriptions: 'ul.dokan-dashboard-menu li.user-subscription a', + requestQuotes: 'ul.dokan-dashboard-menu li.requested-quotes a', + coupons: 'ul.dokan-dashboard-menu li.coupons a', + reports: 'ul.dokan-dashboard-menu li.reports a', + deliveryTime: 'ul.dokan-dashboard-menu li.delivery-time-dashboard a', + reviews: 'ul.dokan-dashboard-menu li.reviews a', + withdraw: 'ul.dokan-dashboard-menu li.withdraw a', + reverseWithdrawal: 'ul.dokan-dashboard-menu li.reverse-withdrawal a', + badges: 'ul.dokan-dashboard-menu li.seller-badge a', + productQA: 'ul.dokan-dashboard-menu li.product-questions-answers a', + returnRequest: 'ul.dokan-dashboard-menu li.return-request a', + staff: 'ul.dokan-dashboard-menu li.staffs a', + followers: 'ul.dokan-dashboard-menu li.followers a', + booking: 'ul.dokan-dashboard-menu li.booking a', + announcements: 'ul.dokan-dashboard-menu li.announcement a', + analytics: 'ul.dokan-dashboard-menu li.analytics a', + tools: 'ul.dokan-dashboard-menu li.tools a', + auction: 'ul.dokan-dashboard-menu li.auction a', + support: 'ul.dokan-dashboard-menu li.support a', + settings: 'ul.dokan-dashboard-menu li.settings a', visitStore: '//i[@class="fas fa-external-link-alt"]/..', editAccount: '.fa-user', diff --git a/tests/pw/pages/spmvPage.ts b/tests/pw/pages/spmvPage.ts index bf4b0cf6b0..508c011563 100644 --- a/tests/pw/pages/spmvPage.ts +++ b/tests/pw/pages/spmvPage.ts @@ -24,7 +24,7 @@ export class SpmvPage extends VendorPage { const alreadyAssigned = await this.isVisible(spmvAdmin.unassignVendor(storeName)); alreadyAssigned && (await this.clickAndAcceptAndWaitForResponseAndLoadState(data.subUrls.ajax, spmvAdmin.unassignVendor(storeName))); - await this.typeViaPageAndWaitForResponse(data.subUrls.ajax, spmvAdmin.searchVendor, storeName); + await this.typeByPageAndWaitForResponse(data.subUrls.ajax, spmvAdmin.searchVendor, storeName); await this.toContainText(spmvAdmin.highlightedResult, storeName); await this.click(spmvAdmin.searchedResult(storeName)); await this.click(spmvAdmin.spmvDiv); diff --git a/tests/pw/tests/e2e/menuManager.spec.ts b/tests/pw/tests/e2e/menuManager.spec.ts index 08e8d98fa5..fe628bf2f4 100644 --- a/tests/pw/tests/e2e/menuManager.spec.ts +++ b/tests/pw/tests/e2e/menuManager.spec.ts @@ -42,12 +42,10 @@ test.describe('Menu Manager test', () => { test("admin can't rename disabled menu @pro @a", async () => { await updateMenuStatusByDB('auction', 'false'); await admin.cantRenameMenu('Auction'); - //reset - await dbUtils.setDokanSettings(dbData.dokan.optionName.menuManager, dbData.dokan.menuManagerSettings); }); - test.skip('admin can redorder menu @pro @a', async () => { - await admin.reorderMenu('Orders'); + test('admin can redorder menu @pro @a', async () => { + await admin.reorderMenu('Orders', 'Products'); }); test("admin can't redorder or toggle status of dashboard & store menu @pro @a", async () => { @@ -61,6 +59,7 @@ test.describe('Menu Manager test', () => { }); }); +// update menu switch status async function updateMenuStatusByDB(key: string, value: string) { const menuManagerSettings = dbData.dokan.menuManagerSettings; menuManagerSettings.dashboard_menu_manager.left_menus[key as keyof typeof menuManagerSettings.dashboard_menu_manager.left_menus].is_switched_on = value; From 04caf679d3f02809e28b4e38e60ddd1116f9f88b Mon Sep 17 00:00:00 2001 From: shashwata Date: Fri, 23 Feb 2024 11:38:17 +0600 Subject: [PATCH 07/31] fixed a env var issue --- tests/pw/README.MD | 11 +++++++++++ tests/pw/tests/api/_env.setup.ts | 2 +- tests/pw/tests/e2e/_env.setup.ts | 2 +- tests/pw/types/environment.d.ts | 2 +- tests/pw/utils/apiUtils.ts | 2 +- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/pw/README.MD b/tests/pw/README.MD index f0ca99a43a..2988d99231 100644 --- a/tests/pw/README.MD +++ b/tests/pw/README.MD @@ -14,6 +14,7 @@
- [Prep for tests :construction:](#prep-for-tests) + - [Build Dokan plugin](#build-dokan-plugin) - [Install Dependencies](#install-dependencies) - [Start Wordpress Environment](#start-wordpress-environment) - [Create Env file](#create-env-file) @@ -56,6 +57,16 @@ Preparation for running tests involves conducting necessary tasks and arrangemen
+### :o: Build Dokan plugin + +
+ +:radio_button: Go to dokan project root directory and run + + composer i --no-dev && composer du -o && npm i && npm run build + +
+ ### :o: Install Dependencies
diff --git a/tests/pw/tests/api/_env.setup.ts b/tests/pw/tests/api/_env.setup.ts index 557b123c24..0e2ebaa4e0 100644 --- a/tests/pw/tests/api/_env.setup.ts +++ b/tests/pw/tests/api/_env.setup.ts @@ -55,7 +55,7 @@ setup.describe('setup site & woocommerce & user settings', () => { await apiUtils.deleteAllProducts(data.predefined.vendor2.simpleProduct.product1.name, payloads.vendor2Auth); // create store product const [, productId] = await apiUtils.createProduct({ ...payloads.createProduct(), name: data.predefined.vendor2.simpleProduct.product1.name }, payloads.vendor2Auth); - helpers.createEnvVar('PRODUCT_ID', productId); + helpers.createEnvVar('PRODUCT_ID_V2', productId); }); }); diff --git a/tests/pw/tests/e2e/_env.setup.ts b/tests/pw/tests/e2e/_env.setup.ts index f2c087493e..2bb6d86157 100644 --- a/tests/pw/tests/e2e/_env.setup.ts +++ b/tests/pw/tests/e2e/_env.setup.ts @@ -138,7 +138,7 @@ setup.describe('setup user settings', () => { await apiUtils.deleteAllProducts(data.predefined.vendor2.simpleProduct.product1.name, payloads.vendor2Auth); // create store product const [, productId] = await apiUtils.createProduct({ ...payloads.createProduct(), name: data.predefined.vendor2.simpleProduct.product1.name }, payloads.vendor2Auth); - helpers.createEnvVar('PRODUCT_ID', productId); + helpers.createEnvVar('PRODUCT_ID_V2', productId); }); setup('add vendor coupon @pro', async () => { diff --git a/tests/pw/types/environment.d.ts b/tests/pw/types/environment.d.ts index 8c8ec75e07..9270d8d344 100644 --- a/tests/pw/types/environment.d.ts +++ b/tests/pw/types/environment.d.ts @@ -15,7 +15,7 @@ declare global { VENDOR2_ID: string; CUSTOMER_ID: string; PRODUCT_ID: string; - V2_PRODUCT_ID: string; + PRODUCT_ID_V2: string; CI: string; GMAP: string; LICENSE_KEY: string; diff --git a/tests/pw/utils/apiUtils.ts b/tests/pw/utils/apiUtils.ts index 7a760c2662..f0908ed2a3 100644 --- a/tests/pw/utils/apiUtils.ts +++ b/tests/pw/utils/apiUtils.ts @@ -1644,7 +1644,7 @@ export class ApiUtils { return [response, responseBody, orderId, productId]; } - // create complete order + // create order with status async createOrderWithStatus(product: string | object, order: any, status: string, auth?: auth): Promise<[APIResponse, responseBody, string, string]> { const [response, responseBody, orderId, productId] = await this.createOrder(product, order, auth); await this.updateOrderStatus(orderId, status, auth); From f788c293fbb811fe645efc97c5ae81f6ebd9b5cb Mon Sep 17 00:00:00 2001 From: shashwata Date: Fri, 23 Feb 2024 23:45:54 +0600 Subject: [PATCH 08/31] fixed menu-manager tests --- tests/pw/pages/basePage.ts | 2 +- tests/pw/pages/menuManagerPage.ts | 19 +++++++++++++++++-- tests/pw/pages/productQAPage.ts | 4 ++-- tests/pw/pages/selectors.ts | 4 ++-- tests/pw/tests/api/productQA.spec.ts | 8 ++++---- tests/pw/tests/e2e/menuManager.spec.ts | 20 ++++++++++++-------- tests/pw/tests/e2e/productAddons.spec.ts | 15 ++++++++------- 7 files changed, 46 insertions(+), 26 deletions(-) diff --git a/tests/pw/pages/basePage.ts b/tests/pw/pages/basePage.ts index 9274044e49..bf50b3f10a 100644 --- a/tests/pw/pages/basePage.ts +++ b/tests/pw/pages/basePage.ts @@ -1358,7 +1358,7 @@ export class BasePage { await expect(this.page.locator(selector)).toHaveValue(value); } - // assert element to have attribute + // assert element to have attribute along with attirbute value async toHaveAttribute(selector: string, attribute: string, value: string) { await expect(this.page.locator(selector)).toHaveAttribute(attribute, value); } diff --git a/tests/pw/pages/menuManagerPage.ts b/tests/pw/pages/menuManagerPage.ts index 0cbebf4047..c5096df047 100644 --- a/tests/pw/pages/menuManagerPage.ts +++ b/tests/pw/pages/menuManagerPage.ts @@ -18,8 +18,9 @@ export class MenuManagerPage extends BasePage { // update menu status async updateMenuStatus(menu: string, action: string, menuLink: string) { - await this.goIfNotThere(data.subUrls.backend.dokan.settings); + await this.goto(data.subUrls.backend.dokan.settings); await this.click(settingsAdmin.menus.menuManager); + switch (action) { case 'activate': await this.enableSwitcher(settingsAdmin.menuManager.menuSwithcher(menu)); @@ -64,10 +65,24 @@ export class MenuManagerPage extends BasePage { await this.toBeVisible(selector.vendor.vDashboard.menus.menuByText(newMenu)); } - async cantRenameMenu(menu: string) { + async cantRenameMenuBeyondLimit(currentMenu: string, newMenu: string) { await this.goIfNotThere(data.subUrls.backend.dokan.settings); await this.click(settingsAdmin.menus.menuManager); + //rename + await this.click(settingsAdmin.menuManager.menuEdit(currentMenu)); + await this.clearAndType(settingsAdmin.menuManager.menuNameInput, newMenu); + await this.toHaveAttribute(settingsAdmin.menuManager.menuNameInput, 'maxlength', '45'); + await this.click(settingsAdmin.menuManager.menuNameConfirm); + // await this.clickAndWaitForResponseAndLoadState(data.subUrls.ajax, settingsAdmin.menuManager.menuManagerSaveChanges); + await this.toBeVisible(settingsAdmin.menuManager.menuEdit(newMenu.substring(0, 45))); + await this.notToBeVisible(settingsAdmin.menuManager.menuEdit(newMenu)); + } + + async cantRenameMenu(menu: string) { + await this.goIfNotThere(data.subUrls.backend.dokan.settings); + await this.click(settingsAdmin.menus.menuManager); + await this.disableSwitcher(settingsAdmin.menuManager.menuSwithcher(menu)); await this.notToBeVisible(settingsAdmin.menuManager.menuEdit(menu)); } diff --git a/tests/pw/pages/productQAPage.ts b/tests/pw/pages/productQAPage.ts index cd8497b417..d42096c86c 100644 --- a/tests/pw/pages/productQAPage.ts +++ b/tests/pw/pages/productQAPage.ts @@ -56,7 +56,7 @@ export class ProductQAPage extends BasePage { await this.toBeVisible(productQAAdmin.questionDetails.goBack); // question details elements are visible - const { questionInput, saveQuestion, questionText, ...questionDetails } = productQAAdmin.questionDetails.questionDetails; // todo: need to add questiontext + const { questionInput, saveQuestion, ...questionDetails } = productQAAdmin.questionDetails.questionDetails; await this.multipleElementVisible(questionDetails); // status elements are visible @@ -64,7 +64,7 @@ export class ProductQAPage extends BasePage { await this.multipleElementVisible(status); // answer elements are visible - const { questionAnswerHtmlBody, editAnswer, ...answer } = productQAAdmin.questionDetails.answer; + const { questionAnswerIframe, questionAnswerHtmlBody, saveAnswer, ...answer } = productQAAdmin.questionDetails.answer; await this.multipleElementVisible(answer); } diff --git a/tests/pw/pages/selectors.ts b/tests/pw/pages/selectors.ts index d2cb15a418..629312ad16 100644 --- a/tests/pw/pages/selectors.ts +++ b/tests/pw/pages/selectors.ts @@ -1584,7 +1584,7 @@ export const selector = { editQuestion: '(//button[normalize-space()="Edit"])[1]', questionInput: 'textarea#comment.block', saveQuestion: '(//button[normalize-space()="Save"])[1]', - questionText: 'div.break-words', + questionText: '//div[ contains(@class, "break-words") and not(contains(@class, "prose")) ]', }, status: { @@ -2055,7 +2055,7 @@ export const selector = { resetAll: 'div.menu-manager-reset-all', confirmReset: '.swal2-confirm', cancelReset: '.swal2-cancel', - menuParent:'(//div[@class="tabs-details"]//div)[2]', + menuParent: '(//div[@class="tabs-details"]//div)[2]', allMenus: 'div.menu_manager_menu_tab div.menu-item', menuGrabber: (menuName: string) => `//span[text()='${menuName}']/../..`, menuEdit: (menuName: string) => `//span[text()='${menuName}']/../..//div[@class='action-icon-wrapper edit-icon-wrapper']`, diff --git a/tests/pw/tests/api/productQA.spec.ts b/tests/pw/tests/api/productQA.spec.ts index 2ec270197a..78b4cc6eff 100644 --- a/tests/pw/tests/api/productQA.spec.ts +++ b/tests/pw/tests/api/productQA.spec.ts @@ -41,14 +41,14 @@ test.describe('product questions and answeres api test', () => { // questions test('get all product questions @pro', async () => { - const [response, responseBody] = await apiUtils.get(endPoints.getAllProductQuestions, { headers: payloads.vendorAuth }); + const [response, responseBody] = await apiUtils.get(endPoints.getAllProductQuestions, { headers: payloads.adminAuth }); expect(response.ok()).toBeTruthy(); expect(responseBody).toBeTruthy(); expect(responseBody).toMatchSchema(schemas.productQaSchema.productQuestionsSchema); }); test('get single product question @pro', async () => { - const [response, responseBody] = await apiUtils.get(endPoints.getSingleProductQuestion(questionId), { headers: payloads.vendorAuth }); + const [response, responseBody] = await apiUtils.get(endPoints.getSingleProductQuestion(questionId), { headers: payloads.adminAuth }); expect(response.ok()).toBeTruthy(); expect(responseBody).toBeTruthy(); expect(responseBody).toMatchSchema(schemas.productQaSchema.productQuestionSchema); @@ -87,14 +87,14 @@ test.describe('product questions and answeres api test', () => { // answers test('get all product question answers @pro', async () => { - const [response, responseBody] = await apiUtils.get(endPoints.getAllProductQuestionAnswers, { headers: payloads.vendorAuth }); + const [response, responseBody] = await apiUtils.get(endPoints.getAllProductQuestionAnswers, { headers: payloads.adminAuth }); expect(response.ok()).toBeTruthy(); expect(responseBody).toBeTruthy(); expect(responseBody).toMatchSchema(schemas.productQaSchema.productQuestionAnswersSchema); }); test('get single product question answer @pro', async () => { - const [response, responseBody] = await apiUtils.get(endPoints.getSingleProductQuestionAnswer(answerId), { headers: payloads.vendorAuth }); + const [response, responseBody] = await apiUtils.get(endPoints.getSingleProductQuestionAnswer(answerId), { headers: payloads.adminAuth }); expect(response.ok()).toBeTruthy(); expect(responseBody).toBeTruthy(); expect(responseBody).toMatchSchema(schemas.productQaSchema.productQuestionAnswerSchema); diff --git a/tests/pw/tests/e2e/menuManager.spec.ts b/tests/pw/tests/e2e/menuManager.spec.ts index fe628bf2f4..9af9cce7bc 100644 --- a/tests/pw/tests/e2e/menuManager.spec.ts +++ b/tests/pw/tests/e2e/menuManager.spec.ts @@ -25,7 +25,7 @@ test.describe('Menu Manager test', () => { test('admin can deactivate menu @pro @a', async () => { await admin.updateMenuStatus('Analytics', 'deactivate', 'analytics'); //reset - await dbUtils.setDokanSettings(dbData.dokan.optionName.menuManager, dbData.dokan.menuManagerSettings); + // await dbUtils.setDokanSettings(dbData.dokan.optionName.menuManager, dbData.dokan.menuManagerSettings); }); test('admin can activate menu@pro @a', async () => { @@ -36,14 +36,17 @@ test.describe('Menu Manager test', () => { test('admin can rename menu @pro @a', async () => { await admin.renameMenu('Request Quotes', 'Quotations'); //reset - await dbUtils.setDokanSettings(dbData.dokan.optionName.menuManager, dbData.dokan.menuManagerSettings); + // await dbUtils.setDokanSettings(dbData.dokan.optionName.menuManager, dbData.dokan.menuManagerSettings); }); - test("admin can't rename disabled menu @pro @a", async () => { - await updateMenuStatusByDB('auction', 'false'); - await admin.cantRenameMenu('Auction'); + test("admin can't rename menu with more than 45 characters @pro @a", async () => { + await admin.cantRenameMenuBeyondLimit('Subscription', 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'); }); + test("admin can't rename disabled menu @pro @a", async () => { + await admin.cantRenameMenu('Coupons'); + }); + test('admin can redorder menu @pro @a', async () => { await admin.reorderMenu('Orders', 'Products'); }); @@ -54,14 +57,15 @@ test.describe('Menu Manager test', () => { }); test('admin can reset menu manager settings @pro @a', async () => { - await updateMenuStatusByDB('auction', 'false'); - await admin.resetMenuManagerSettings('Auction'); + await updateMenuStatusByDB('tools', 'false'); + await admin.resetMenuManagerSettings('Tools'); }); }); // update menu switch status async function updateMenuStatusByDB(key: string, value: string) { - const menuManagerSettings = dbData.dokan.menuManagerSettings; + const menuManagerSettings = JSON.parse(JSON.stringify(dbData.dokan.menuManagerSettings)); menuManagerSettings.dashboard_menu_manager.left_menus[key as keyof typeof menuManagerSettings.dashboard_menu_manager.left_menus].is_switched_on = value; await dbUtils.setDokanSettings(dbData.dokan.optionName.menuManager, menuManagerSettings); } + diff --git a/tests/pw/tests/e2e/productAddons.spec.ts b/tests/pw/tests/e2e/productAddons.spec.ts index 80b51ccf22..1aa49d2045 100644 --- a/tests/pw/tests/e2e/productAddons.spec.ts +++ b/tests/pw/tests/e2e/productAddons.spec.ts @@ -15,13 +15,6 @@ test.describe('Product addon functionality test', () => { let categoryName: string; let apiUtils: ApiUtils; - async function createVendorProductAddon(): Promise<[string, string, string, string]> { - const [, categoryId, categoryName] = await apiUtils.createCategory(payloads.createCategoryRandom(), payloads.adminAuth); - const [, addonId, addonName, addonFieldTitle] = await apiUtils.createProductAddon({ ...payloads.createProductAddons(), restrict_to_categories: [categoryId] }, payloads.adminAuth); - await dbUtils.updateCell(addonId, VENDOR_ID); - return [addonId, addonName, addonFieldTitle, categoryName]; - } - test.beforeAll(async ({ browser }) => { const vendorContext = await browser.newContext(data.auth.vendorAuth); vPage = await vendorContext.newPage(); @@ -54,3 +47,11 @@ test.describe('Product addon functionality test', () => { await vendor.deleteAddon({ ...data.vendor.addon(), name: addonName }); }); }); + +// create product addon +async function createVendorProductAddon(): Promise<[string, string, string, string]> { + const [, categoryId, categoryName] = await apiUtils.createCategory(payloads.createCategoryRandom(), payloads.adminAuth); + const [, addonId, addonName, addonFieldTitle] = await apiUtils.createProductAddon({ ...payloads.createProductAddons(), restrict_to_categories: [categoryId] }, payloads.adminAuth); + await dbUtils.updateCell(addonId, VENDOR_ID); + return [addonId, addonName, addonFieldTitle, categoryName]; +} From c4de91e03ee7554154d5a8492c9561b08679543e Mon Sep 17 00:00:00 2001 From: shashwata Date: Wed, 28 Feb 2024 10:15:45 +0600 Subject: [PATCH 09/31] update productQA tests --- .github/workflows/e2e_api_tests.yml | 2 +- tests/pw/pages/basePage.ts | 4 +++- tests/pw/pages/productQAPage.ts | 6 +++--- tests/pw/tests/e2e/productQA.spec.ts | 20 ++++++++++++-------- tests/pw/utils/apiUtils.ts | 1 + tests/pw/utils/payloads.ts | 2 +- 6 files changed, 21 insertions(+), 14 deletions(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index b4122b788b..dd5f02730b 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -84,7 +84,7 @@ jobs: - name: Npm install and build (Dokan-lite) if: success() run: | - npm ci + npm ci || npm i npm run build # Install test dependencies diff --git a/tests/pw/pages/basePage.ts b/tests/pw/pages/basePage.ts index bf50b3f10a..feb0330c7e 100644 --- a/tests/pw/pages/basePage.ts +++ b/tests/pw/pages/basePage.ts @@ -55,7 +55,7 @@ export class BasePage { // goto subUrl async goto(subPath: string): Promise { - await this.page.goto(subPath, { waitUntil: 'networkidle' }); + await this.page.goto(subPath, { waitUntil: 'domcontentloaded' }); } // go forward @@ -94,6 +94,8 @@ export class BasePage { const url = this.createUrl(subPath); await this.page.goto(url, { waitUntil: 'networkidle' }); // await this.page.goto(url, { waitUntil: 'domcontentloaded' }); //don't work for backend + // this.page.waitForURL(url, { waitUntil: 'networkidle' }) + // this.page.waitForURL(url, { waitUntil: 'domcontentloaded' }) const currentUrl = this.getCurrentUrl(); expect(currentUrl).toMatch(subPath); } diff --git a/tests/pw/pages/productQAPage.ts b/tests/pw/pages/productQAPage.ts index d42096c86c..d2dec004a7 100644 --- a/tests/pw/pages/productQAPage.ts +++ b/tests/pw/pages/productQAPage.ts @@ -146,11 +146,11 @@ export class ProductQAPage extends BasePage { // delete answer async deleteAnswer(questionId: string): Promise { - await this.goIfNotThere(data.subUrls.backend.dokan.questionDetails(questionId)); + await this.goto(data.subUrls.backend.dokan.questionDetails(questionId)); await this.click(productQAAdmin.questionDetails.answer.deleteAnswer); await this.clickAndWaitForResponse(data.subUrls.api.dokan.productAnswers, productQAAdmin.questionDetails.confirmAction, 204); await this.toBeVisible(productQAAdmin.questionDetails.answerDeleteSuccessMessage); - await this.toBeVisible(productQAAdmin.questionDetails.answer.saveAnswer); + } // delete question @@ -256,7 +256,7 @@ export class ProductQAPage extends BasePage { // delete question async vendorDeleteQuestion(questionId: string): Promise { - await this.goIfNotThere(data.subUrls.frontend.vDashboard.questionDetails(questionId)); + await this.goto(data.subUrls.frontend.vDashboard.questionDetails(questionId)); await this.click(productQAVendor.questionDetails.status.deleteQuestion); await this.clickAndWaitForResponse(data.subUrls.ajax, productQAVendor.questionDetails.confirmAction); await this.toBeVisible(productQAVendor.questionDetails.questionDeleteSuccessMessage); diff --git a/tests/pw/tests/e2e/productQA.spec.ts b/tests/pw/tests/e2e/productQA.spec.ts index fb715b7bb6..b44e9a86d1 100644 --- a/tests/pw/tests/e2e/productQA.spec.ts +++ b/tests/pw/tests/e2e/productQA.spec.ts @@ -11,11 +11,9 @@ test.describe('Product QA functionality test', () => { let admin: ProductQAPage; let vendor: ProductQAPage; let customer: ProductQAPage; - let guest: ProductQAPage; let aPage: Page, vPage: Page, cPage: Page; let apiUtils: ApiUtils; let questionId: string; - let answerId: string; test.beforeAll(async ({ browser }) => { const adminContext = await browser.newContext(data.auth.adminAuth); @@ -32,10 +30,11 @@ test.describe('Product QA functionality test', () => { apiUtils = new ApiUtils(await request.newContext()); [, questionId] = await apiUtils.createProductQuestion({ ...payloads.createProductQuestion(), product_id: PRODUCT_ID }, payloads.customerAuth); - [, answerId] = await apiUtils.createProductQuestionAnswer({ ...payloads.createProductQuestionAnswer(), question_id: questionId }, payloads.vendorAuth); + await apiUtils.createProductQuestionAnswer({ ...payloads.createProductQuestionAnswer(), question_id: questionId }, payloads.adminAuth); }); test.afterAll(async () => { + await apiUtils.deleteAllProductQuestions(payloads.adminAuth); await aPage.close(); await vPage.close(); await cPage.close(); @@ -49,7 +48,6 @@ test.describe('Product QA functionality test', () => { }); test('admin can view product question details @pro @exp @a', async () => { - const [, questionId] = await apiUtils.createProductQuestion({ ...payloads.createProductQuestion(), product_id: PRODUCT_ID }, payloads.customerAuth); await admin.viewQuestionDetails(questionId); }); @@ -81,14 +79,17 @@ test.describe('Product QA functionality test', () => { }); test('admin can delete answer @pro @a', async () => { + const [, questionId] = await apiUtils.createProductQuestion({ ...payloads.createProductQuestion(), product_id: PRODUCT_ID }, payloads.customerAuth); + await apiUtils.createProductQuestionAnswer({ ...payloads.createProductQuestionAnswer(), question_id: questionId }, payloads.adminAuth); await admin.deleteAnswer(questionId); }); - test('admin can edit (hide) question visibility @pro @a', async () => { + test('admin can edit(hide) question visibility @pro @a', async () => { await admin.editQuestionVisibility(questionId, 'hide'); }); - test('admin can edit (show) question visibility @pro @a', async () => { + test('admin can edit(show) question visibility @pro @a', async () => { + const [, questionId] = await apiUtils.createProductQuestion({ ...payloads.createProductQuestion(), product_id: PRODUCT_ID }, payloads.customerAuth); await apiUtils.updateProductQuestion(questionId, payloads.updateProductQuestion(), payloads.adminAuth); await admin.editQuestionVisibility(questionId, 'show'); }); @@ -133,10 +134,13 @@ test.describe('Product QA functionality test', () => { }); test('vendor can delete a answer @pro @v', async () => { + const [, questionId] = await apiUtils.createProductQuestion({ ...payloads.createProductQuestion(), product_id: PRODUCT_ID }, payloads.customerAuth); + await apiUtils.createProductQuestionAnswer({ ...payloads.createProductQuestionAnswer(), question_id: questionId }, payloads.adminAuth); await vendor.vendorDeleteAnswer(questionId); }); - test('vendor can delete a question @pro @v', async () => { + test.skip('vendor can delete a question @pro @v', async () => { + const [, questionId] = await apiUtils.createProductQuestion({ ...payloads.createProductQuestion(), product_id: PRODUCT_ID }, payloads.customerAuth); await vendor.vendorDeleteQuestion(questionId); }); @@ -153,7 +157,7 @@ test.describe('Product QA functionality test', () => { // guest test('guest customer need to sign-in/signup post question @pro @g', async ({ page }) => { - guest = new ProductQAPage(page); + const guest = new ProductQAPage(page); await guest.postQuestion(data.predefined.simpleProduct.product1.name, data.questionAnswers); }); }); diff --git a/tests/pw/utils/apiUtils.ts b/tests/pw/utils/apiUtils.ts index f0908ed2a3..58fec6c50d 100644 --- a/tests/pw/utils/apiUtils.ts +++ b/tests/pw/utils/apiUtils.ts @@ -1284,6 +1284,7 @@ export class ApiUtils { return; } const allProductQuestionIds = allProductQuestions.map((o: { id: unknown }) => o.id); + // console.log(allProductQuestionIds); const [, responseBody] = await this.put(endPoints.updateBatchProductQuestions, { data: { action: 'delete', ids: allProductQuestionIds }, headers: auth }); return responseBody; } diff --git a/tests/pw/utils/payloads.ts b/tests/pw/utils/payloads.ts index 51497ed22a..c50063e8d2 100644 --- a/tests/pw/utils/payloads.ts +++ b/tests/pw/utils/payloads.ts @@ -3206,7 +3206,7 @@ export const payloads = { }), createProductQuestionAnswer: () => ({ - answer: 'test answer_' + faker.string.nanoid(10), + answer: '

test answer_' + faker.string.nanoid(10) + '

', question_id: '', }), From 607816f228ea2643c2efb47d69d22068a6d62763 Mon Sep 17 00:00:00 2001 From: shashwata Date: Thu, 7 Mar 2024 10:02:15 +0600 Subject: [PATCH 10/31] update: update a locator --- tests/pw/pages/selectors.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/pw/pages/selectors.ts b/tests/pw/pages/selectors.ts index 629312ad16..80fbe15ab2 100644 --- a/tests/pw/pages/selectors.ts +++ b/tests/pw/pages/selectors.ts @@ -6925,8 +6925,7 @@ export const selector = { // Social icons storeSocialIcons: { facebook: '.fa-facebook-square', - twitter: '.fa-twitter-square', - // twitter: '.fa-square-x-twitter', // todo: replace after PR is merged + twitter: '.fa-square-x-twitter', pinterest: '.fa-pinterest-square', linked: '.fa-linkedin', youtube: '.fa-youtube-square', From cdd876587ce29ec3382c7f8196a71f23e8caeda9 Mon Sep 17 00:00:00 2001 From: shashwata Date: Thu, 7 Mar 2024 12:14:42 +0600 Subject: [PATCH 11/31] update: update some locators --- .github/workflows/e2e_api_tests.yml | 2 +- tests/pw/pages/selectors.ts | 21 +++++------ tests/pw/pages/settingsPage.ts | 4 +- tests/pw/tests/e2e/_env.setup.ts | 57 +++++++++++++++++++++++++++++ tests/pw/tests/e2e/license.spec.ts | 6 +-- tests/pw/types/environment.d.ts | 1 + tests/pw/utils/interfaces.ts | 1 + tests/pw/utils/testData.ts | 3 +- 8 files changed, 77 insertions(+), 18 deletions(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index dd5f02730b..df8d35fcbb 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -225,7 +225,7 @@ jobs: # Backup Database - name: Backup Database - if: success() + if: steps.wp-env.outcome == 'success' run: | cd tests/pw npm run wp-env run tests-cli wp db export wp-data/db.sql diff --git a/tests/pw/pages/selectors.ts b/tests/pw/pages/selectors.ts index 80fbe15ab2..c13a270327 100644 --- a/tests/pw/pages/selectors.ts +++ b/tests/pw/pages/selectors.ts @@ -1915,9 +1915,9 @@ export const selector = { // Commission commissionType: '#dokan_selling\\[commission_type\\]', adminCommission: '#dokan_selling\\[admin_percentage\\]', - shippingFeeRecipient: (feeReceiver: string) => `//label[@for='dokan_selling[shipping_fee_recipient][${feeReceiver}]']`, - productTaxFeeRecipient: (feeReceiver: string) => `//label[@for='dokan_selling[tax_fee_recipient][${feeReceiver}]']`, - shippingTaxFeeRecipient: (feeReceiver: string) => `//label[@for='dokan_selling[shipping_tax_fee_recipient][${feeReceiver}]']`, + shippingFeeRecipient: (feeReceiver: string) => `//label[contains(@for,'${feeReceiver}-shipping_fee_recipient')]`, + productTaxFeeRecipient: (feeReceiver: string) => `//label[contains(@for,'${feeReceiver}-tax_fee_recipient')]`, + shippingTaxFeeRecipient: (feeReceiver: string) => `//label[contains(@for,'${feeReceiver}-shipping_tax_fee_recipient')]`, processRefundViaAPI: '#dokan_selling\\[automatic_process_api_refund\\]', // Vendor Capability @@ -1926,11 +1926,11 @@ export const selector = { disableProductPopup: '.disable_product_popup .switch', orderStatusChange: '.order_status_change .switch', selectAnyCategory: '.dokan_any_category_selection .switch', - newProductStatus: (status: string) => `//label[@for='dokan_selling[product_status][${status}]']`, + newProductStatus: (status: string) => `//label[contains(@for,'${status}-product_status')]`, duplicateProduct: '.vendor_duplicate_product .switch', editedProductStatus: '.edited_product_status .switch', productMailNotification: '.product_add_mail .switch', - productCategorySelection: (category: string) => `//label[@for='dokan_selling[product_category_style][${category}]']`, + productCategorySelection: (category: string) => `//label[contains(@for,'${category}-product_category_style')]`, vendorsCanCreateTags: '.product_vendors_can_create_tags .switch', orderDiscount: '//div[contains(text(),"Order Discount")]//label[@class="switch tips"]', productDiscount: '//div[contains(text(),"Product Quantity Discount")]//label[@class="switch tips"]', @@ -2014,10 +2014,10 @@ export const selector = { // Pages page: { // Page Settings - dashboard: '#dokan_pages\\[dashboard\\]', - myOrders: '#dokan_pages\\[my_orders\\]', - storeListing: '#dokan_pages\\[store_listing\\]', - termsAndConditions: '#dokan_pages\\[reg_tc_page\\]', + dashboard: 'select#dokan_pages\\[dashboard\\]', + myOrders: 'select#dokan_pages\\[my_orders\\]', + storeListing: 'select#dokan_pages\\[store_listing\\]', + termsAndConditions: 'select#dokan_pages\\[reg_tc_page\\]', pageSaveChanges: '#submit', }, @@ -2025,8 +2025,7 @@ export const selector = { appearance: { // Appearance showMapOnStorePage: '.store_map .switch', - mapApiSourceGoogleMaps: '//div[@class="map_api_source dokan-settings-field-type-radio"] //label[@for="dokan_appearance[map_api_source][google_maps]"]', - mapApiSourceMapBox: '//div[@class="map_api_source dokan-settings-field-type-radio"] //label[@for="dokan_appearance[map_api_source][mapbox]"]', + mapApiSource: (source: string) => `//label[contains(@for,'${source}-map_api_source')]`, googleMapApiKey: '#dokan_appearance\\[gmap_api_key\\]', mapBoxAccessToken: '#dokan_appearance\\[mapbox_access_token\\]', googleReCAPTCHA: '.recaptcha_validation_label .dashicons', diff --git a/tests/pw/pages/settingsPage.ts b/tests/pw/pages/settingsPage.ts index 27eb76f2d1..fdda2c8405 100644 --- a/tests/pw/pages/settingsPage.ts +++ b/tests/pw/pages/settingsPage.ts @@ -91,7 +91,7 @@ export class SettingsPage extends AdminPage { // commission settings await this.selectByValue(settingsAdmin.selling.commissionType, selling.commissionType); await this.clearAndType(settingsAdmin.selling.adminCommission, selling.adminCommission); - // await this.click(settingsAdmin.selling.shippingFeeRecipient(selling.shippingFeeRecipient)); //todo: makes test flaky + await this.click(settingsAdmin.selling.shippingFeeRecipient(selling.shippingFeeRecipient)); await this.click(settingsAdmin.selling.productTaxFeeRecipient(selling.productTaxFeeRecipient)); await this.click(settingsAdmin.selling.shippingTaxFeeRecipient(selling.shippingTaxFeeRecipient)); @@ -226,7 +226,7 @@ export class SettingsPage extends AdminPage { // Appearance Settings await this.enableSwitcher(settingsAdmin.appearance.showMapOnStorePage); - await this.click(settingsAdmin.appearance.mapApiSourceGoogleMaps); + await this.click(settingsAdmin.appearance.mapApiSource(appearance.mapApiSource)); await this.clearAndType(settingsAdmin.appearance.googleMapApiKey, appearance.googleMapApiKey); await this.enableSwitcher(settingsAdmin.appearance.showContactFormOnStorePage); await this.click(settingsAdmin.appearance.storeHeaderTemplate2); diff --git a/tests/pw/tests/e2e/_env.setup.ts b/tests/pw/tests/e2e/_env.setup.ts index 2bb6d86157..89049f2960 100644 --- a/tests/pw/tests/e2e/_env.setup.ts +++ b/tests/pw/tests/e2e/_env.setup.ts @@ -184,30 +184,87 @@ setup.describe('setup dokan settings', () => { await dbUtils.setDokanSettings(dbData.dokan.optionName.reverseWithdraw, dbData.dokan.reverseWithdrawSettings); }); + setup('admin set dokan page settings @lite', async () => { + const [, pageId] = await apiUtils.createPage(payloads.tocPage, payloads.adminAuth); + const pageSettings = await dbUtils.getDokanSettings(dbData.dokan.optionName.page); + pageSettings['reg_tc_page'] = String(pageId); + await dbUtils.setDokanSettings(dbData.dokan.optionName.page, pageSettings); + }); + + setup.skip('admin set dokan appearance settings @lite', async () => { + await dbUtils.setDokanSettings(dbData.dokan.optionName.appearance, dbData.dokan.appearanceSettings); + }); + + setup('admin set dokan privacy policy settings @lite', async () => { + const [, pageId] = await apiUtils.createPage(payloads.privacyPolicyPage, payloads.adminAuth); + dbData.dokan.privacyPolicySettings.privacy_page = String(pageId); + await dbUtils.setDokanSettings(dbData.dokan.optionName.privacyPolicy, dbData.dokan.privacyPolicySettings); + }); + + setup.skip('admin set dokan color settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.colors, dbData.dokan.colorsSettings); + }); + setup('admin set dokan store support settings @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); await dbUtils.setDokanSettings(dbData.dokan.optionName.storeSupport, dbData.dokan.storeSupportSettings); }); + setup.skip('admin set dokan shipping status settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.shippingStatus, dbData.dokan.shippingStatusSettings); + }); + setup('admin set dokan quote settings @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); await dbUtils.setDokanSettings(dbData.dokan.optionName.quote, dbData.dokan.quoteSettings); }); + setup.skip('admin set dokan rma settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.rma, dbData.dokan.rmaSettings); + }); + setup('admin set dokan wholesale settings @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); await dbUtils.setDokanSettings(dbData.dokan.optionName.wholesale, dbData.dokan.wholesaleSettings); }); + setup.skip('admin set dokan eu compliance settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.euCompliance, dbData.dokan.euComplianceSettings); + }); + + setup.skip('admin set dokan delivery time settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.deliveryTime, dbData.dokan.deliveryTimeSettings); + }); + setup('admin set dokan product advertising settings @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); await dbUtils.setDokanSettings(dbData.dokan.optionName.productAdvertising, dbData.dokan.productAdvertisingSettings); }); + setup.skip('admin set dokan geolocation settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.geolocation, dbData.dokan.geolocationSettings); + }); + setup('admin set dokan product report abuse settings @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); await dbUtils.setDokanSettings(dbData.dokan.optionName.productReportAbuse, dbData.dokan.productReportAbuseSettings); }); + + setup.skip('admin set dokan spmv settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.spmv, dbData.dokan.spmvSettings); + }); + + setup.skip('admin set dokan vendor subscription settings @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.vendorSubscription, dbData.dokan.vendorSubscriptionSettings); + }); }); setup.describe('setup dokan settings e2e', () => { diff --git a/tests/pw/tests/e2e/license.spec.ts b/tests/pw/tests/e2e/license.spec.ts index 8b0a3695f5..deb2d8098d 100644 --- a/tests/pw/tests/e2e/license.spec.ts +++ b/tests/pw/tests/e2e/license.spec.ts @@ -21,15 +21,15 @@ test.describe('License test', () => { await admin.adminLicenseRenderProperly(); }); - test("admin can't activate license with incorrect key @pro @a @neg", async () => { + test.skip("admin can't activate license with incorrect key @pro @a @neg", async () => { await admin.activateLicense(data.dokanLicense.incorrectKey, 'incorrect'); }); - test('admin can activate license @pro @a', async () => { + test.skip('admin can activate license @pro @a', async () => { await admin.activateLicense(data.dokanLicense.correctKey); }); - test('admin can deactivate license @pro @a', async () => { + test.skip('admin can deactivate license @pro @a', async () => { await admin.activateLicense(data.dokanLicense.correctKey); await admin.deactivateLicense(); }); diff --git a/tests/pw/types/environment.d.ts b/tests/pw/types/environment.d.ts index 9270d8d344..43e470108b 100644 --- a/tests/pw/types/environment.d.ts +++ b/tests/pw/types/environment.d.ts @@ -18,6 +18,7 @@ declare global { PRODUCT_ID_V2: string; CI: string; GMAP: string; + MAPBOX: string; LICENSE_KEY: string; DOKAN_PRO: string; SITE_PATH: string; diff --git a/tests/pw/utils/interfaces.ts b/tests/pw/utils/interfaces.ts index 2ad06cfe00..d991ff6007 100644 --- a/tests/pw/utils/interfaces.ts +++ b/tests/pw/utils/interfaces.ts @@ -1505,6 +1505,7 @@ export interface dokanSettings { // Appearance appearance: { + mapApiSource: string; googleMapApiKey: string; mapBoxApiKey: string; storeBannerWidth: string; diff --git a/tests/pw/utils/testData.ts b/tests/pw/utils/testData.ts index 3ebc852bd8..827a8acde6 100644 --- a/tests/pw/utils/testData.ts +++ b/tests/pw/utils/testData.ts @@ -1883,8 +1883,9 @@ export const data = { // Appearance appearance: { + mapApiSource: 'google_maps', // 'google_maps', 'mapbox' googleMapApiKey: String(process.env.GMAP), - mapBoxApiKey: String(process.env.MAPBOX_API_KEY), + mapBoxApiKey: String(process.env.MAPBOX), storeBannerWidth: '625', storeBannerHeight: '300', saveSuccessMessage: 'Setting has been saved successfully.', From ffbc5f20b3069b33dd7cb8b23830a6c1b1553acd Mon Sep 17 00:00:00 2001 From: shashwata Date: Thu, 7 Mar 2024 14:02:39 +0600 Subject: [PATCH 12/31] add: added new test --- .github/workflows/e2e_api_tests.yml | 2 +- tests/pw/pages/licensePage.ts | 6 +++ tests/pw/pages/selectors.ts | 2 +- tests/pw/tests/e2e/_env.setup.ts | 18 +++++++++ tests/pw/tests/e2e/license.spec.ts | 4 ++ tests/pw/utils/apiUtils.ts | 10 ++++- tests/pw/utils/dbData.ts | 59 +++++++++++++++++++++++++++++ tests/pw/utils/payloads.ts | 2 +- 8 files changed, 99 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index df8d35fcbb..3d344b1cdd 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -92,7 +92,7 @@ jobs: if: success() run: | cd tests/pw - npm ci + npm ci || npm i # Create wp debuglog file - name: Create wp debuglog file diff --git a/tests/pw/pages/licensePage.ts b/tests/pw/pages/licensePage.ts index ef3964d8b9..439d753a3b 100644 --- a/tests/pw/pages/licensePage.ts +++ b/tests/pw/pages/licensePage.ts @@ -43,6 +43,12 @@ export class LicensePage extends AdminPage { } } + // refresh license + async refresehLicense() { + await this.goIfNotThere(data.subUrls.backend.dokan.license); + await this.clickAndWaitForResponse(data.subUrls.backend.dokan.license, licenseAdmin.refreshLicense); + await this.toContainText(licenseAdmin.successNotice, 'License refreshed successfully.'); + } // deactivate license async deactivateLicense() { await this.goIfNotThere(data.subUrls.backend.dokan.license); diff --git a/tests/pw/pages/selectors.ts b/tests/pw/pages/selectors.ts index c13a270327..d8f746a18c 100644 --- a/tests/pw/pages/selectors.ts +++ b/tests/pw/pages/selectors.ts @@ -1130,7 +1130,7 @@ export const selector = { announcements: { announcementText: '.dokan-announcement-wrapper h1', - addNewAnnouncement: '//a[normalize-space()="Add Announcement"]', + addNewAnnouncement: '//button[normalize-space()="Add Announcement"]', // Nav Tabs navTabs: { diff --git a/tests/pw/tests/e2e/_env.setup.ts b/tests/pw/tests/e2e/_env.setup.ts index 89049f2960..acd2650edf 100644 --- a/tests/pw/tests/e2e/_env.setup.ts +++ b/tests/pw/tests/e2e/_env.setup.ts @@ -1,4 +1,5 @@ import { test as setup, expect, request, Page } from '@playwright/test'; +import { LicensePage } from '@pages/licensePage'; import { ProductAdvertisingPage } from '@pages/productAdvertisingPage'; import { ReverseWithdrawsPage } from '@pages/reverseWithdrawsPage'; import { VendorSettingsPage } from '@pages/vendorSettingsPage'; @@ -98,6 +99,17 @@ setup.describe('setup site & woocommerce & user settings', () => { await apiUtils.createAttributeTerm(attributeId, { name: 'm' }); }); + setup('set dokan license @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProLicense, dbData.dokan.dokanProLicense); + await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProActiveModules, dbData.dokan.dokanProActiveModules); + }); + + setup('activate all dokan modules @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProActiveModules, dbData.dokan.dokanProActiveModules); + }); + setup('check active dokan modules @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); const activeModules = await apiUtils.getAllModuleIds({ status: 'active' }); @@ -268,6 +280,7 @@ setup.describe('setup dokan settings', () => { }); setup.describe('setup dokan settings e2e', () => { + let licensePage: LicensePage; let productAdvertisingPage: ProductAdvertisingPage; let reverseWithdrawsPage: ReverseWithdrawsPage; let vendorPage: VendorSettingsPage; @@ -277,6 +290,7 @@ setup.describe('setup dokan settings e2e', () => { setup.beforeAll(async ({ browser }) => { const adminContext = await browser.newContext(data.auth.adminAuth); aPage = await adminContext.newPage(); + licensePage = new LicensePage(aPage); productAdvertisingPage = new ProductAdvertisingPage(aPage); reverseWithdrawsPage = new ReverseWithdrawsPage(aPage); @@ -293,6 +307,10 @@ setup.describe('setup dokan settings e2e', () => { await apiUtils.dispose(); }); + setup('admin can refreseh license @pro @a', async () => { + await licensePage.refresehLicense(); + }); + setup('recreate reverse withdrawal payment product via settings save @lite', async () => { await reverseWithdrawsPage.reCreateReverseWithdrawalPaymentViaSettingsSave(); }); diff --git a/tests/pw/tests/e2e/license.spec.ts b/tests/pw/tests/e2e/license.spec.ts index deb2d8098d..45c9556ec0 100644 --- a/tests/pw/tests/e2e/license.spec.ts +++ b/tests/pw/tests/e2e/license.spec.ts @@ -29,6 +29,10 @@ test.describe('License test', () => { await admin.activateLicense(data.dokanLicense.correctKey); }); + test('admin can refreseh license @pro @a', async () => { + await admin.refresehLicense(); + }); + test.skip('admin can deactivate license @pro @a', async () => { await admin.activateLicense(data.dokanLicense.correctKey); await admin.deactivateLicense(); diff --git a/tests/pw/utils/apiUtils.ts b/tests/pw/utils/apiUtils.ts index 58fec6c50d..2dd761d0a7 100644 --- a/tests/pw/utils/apiUtils.ts +++ b/tests/pw/utils/apiUtils.ts @@ -296,7 +296,7 @@ export class ApiUtils { // get product exists or not async checkProductExistence(productName: string, auth?: auth): Promise { - const allProducts = await this.getAllProducts(auth); + const allProducts = await this.getAllProductsWc(auth); const res = allProducts.find((o: { name: string }) => o.name.toLowerCase() === productName.toLowerCase())?.id ?? false; return res; } @@ -1604,6 +1604,14 @@ export class ApiUtils { return [response, responseBody]; } + // product + + // get all products + async getAllProductsWc(auth?: auth): Promise { + const [, responseBody] = await this.get(endPoints.wc.getAllProducts, { params: { per_page: 100 }, headers: auth }); + return responseBody; + } + // order // get all site orders diff --git a/tests/pw/utils/dbData.ts b/tests/pw/utils/dbData.ts index 457e17bd3d..25dc124cfa 100644 --- a/tests/pw/utils/dbData.ts +++ b/tests/pw/utils/dbData.ts @@ -32,6 +32,10 @@ export const dbData = { vendorSubscription: 'dokan_product_subscription', // vendorAnalytics: dokanActiveModules: 'dokan_pro_active_modules', + + // dokanPro + dokanProLicense: 'dokan_pro_license', + dokanProActiveModules: 'dokan_pro_active_modules', }, generalSettings: { @@ -1087,6 +1091,61 @@ export const dbData = { alert_email_body: 'Dear subscriber, Your subscription will be ending soon. Please renew your package in a timely', }, + + // dokan pro license + dokanProLicense: { + key: '74c8654e-84a5-49b2-a3f5-81afba8e13fa', + status: 'activate', + remaining: 42, + activation_limit: 50, + expiry_days: 329, + title: 'Business', + source_id: 'dokan-business', + recurring: 1, + }, + + // dokan pro modules + dokanProActiveModules: [ + 'booking', + 'auction', + 'color_scheme_customizer', + 'delivery_time', + 'elementor', + 'germanized', + 'follow_store', + 'geolocation', + 'live_chat', + 'live_search', + 'mangopay', + 'order_min_max', + 'paypal_marketplace', + 'product_addon', + 'product_advertising', + 'product_enquiry', + 'vsp', + 'rank_math', + 'razorpay', + 'report_abuse', + 'request_for_quotation', + 'rma', + 'seller_badge', + 'seller_vacation', + 'shipstation', + 'spmv', + 'store_reviews', + 'store_support', + 'stripe', + 'stripe_express', + 'table_rate_shipping', + 'vendor_analytics', + 'export_import', + 'vendor_staff', + 'product_subscription', + 'vendor_verification', + 'wholesale', + 'moip', + ], + // modules modules: [ 'booking', diff --git a/tests/pw/utils/payloads.ts b/tests/pw/utils/payloads.ts index c50063e8d2..a8476c3bfa 100644 --- a/tests/pw/utils/payloads.ts +++ b/tests/pw/utils/payloads.ts @@ -2606,7 +2606,7 @@ export const payloads = { email: process.env.VENDOR + '@yopmail.com', store_name: process.env.VENDOR + 'store', first_name: process.env.VENDOR, - last_name: 'v1', + last_name: 'v', social: { fb: 'http://dokan.test', youtube: 'http://dokan.test', From ead1ab05773836225fb420552c30933150c17c8d Mon Sep 17 00:00:00 2001 From: shashwata Date: Thu, 7 Mar 2024 17:01:29 +0600 Subject: [PATCH 13/31] skip a setup test --- tests/pw/tests/e2e/_env.setup.ts | 1 + tests/pw/tests/e2e/menuManager.spec.ts | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/pw/tests/e2e/_env.setup.ts b/tests/pw/tests/e2e/_env.setup.ts index acd2650edf..99e170e800 100644 --- a/tests/pw/tests/e2e/_env.setup.ts +++ b/tests/pw/tests/e2e/_env.setup.ts @@ -308,6 +308,7 @@ setup.describe('setup dokan settings e2e', () => { }); setup('admin can refreseh license @pro @a', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); await licensePage.refresehLicense(); }); diff --git a/tests/pw/tests/e2e/menuManager.spec.ts b/tests/pw/tests/e2e/menuManager.spec.ts index 9af9cce7bc..d4203493a7 100644 --- a/tests/pw/tests/e2e/menuManager.spec.ts +++ b/tests/pw/tests/e2e/menuManager.spec.ts @@ -5,7 +5,6 @@ import { data } from '@utils/testData'; import { dbData } from '@utils/dbData'; test.describe('Menu Manager test', () => { - test.skip(true, 'feature not merged yet'); let admin: MenuManagerPage; let aPage: Page; From 183877f8a67da7bdc146ff175a443b0e1ba89195 Mon Sep 17 00:00:00 2001 From: shashwata Date: Fri, 8 Mar 2024 13:14:39 +0600 Subject: [PATCH 14/31] fix: fix license issue --- tests/pw/pages/basePage.ts | 2 +- tests/pw/tests/api/_env.setup.ts | 17 +++++++++++ tests/pw/tests/e2e/_env.setup.ts | 36 ++++++++++++------------ tests/pw/tests/e2e/license.spec.ts | 2 +- tests/pw/tests/e2e/productAddons.spec.ts | 16 +++++------ tests/pw/utils/gitTestSummary.ts | 12 ++++---- 6 files changed, 52 insertions(+), 33 deletions(-) diff --git a/tests/pw/pages/basePage.ts b/tests/pw/pages/basePage.ts index feb0330c7e..8f90fde612 100644 --- a/tests/pw/pages/basePage.ts +++ b/tests/pw/pages/basePage.ts @@ -954,7 +954,7 @@ export class BasePage { const parent = this.getElement(parentSelector); const child = await this.getElementHandle(childSelector); const index = await parent.evaluate((parent, child) => Array.from(parent.children).indexOf(child as HTMLElement), child); - console.log(index); + // console.log(index); return index; } diff --git a/tests/pw/tests/api/_env.setup.ts b/tests/pw/tests/api/_env.setup.ts index 0e2ebaa4e0..c4cb51468b 100644 --- a/tests/pw/tests/api/_env.setup.ts +++ b/tests/pw/tests/api/_env.setup.ts @@ -41,6 +41,23 @@ setup.describe('setup site & woocommerce & user settings', () => { HPOS && (await apiUtils.updateBatchWcSettingsOptions('advanced', payloads.advanced)); }); + setup('set dokan license @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProLicense, dbData.dokan.dokanProLicense); + await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProActiveModules, dbData.dokan.dokanProActiveModules); + }); + + setup('activate all dokan modules @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProActiveModules, dbData.dokan.dokanProActiveModules); + }); + + setup('check active dokan modules @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + const activeModules = await apiUtils.getAllModuleIds({ status: 'active' }); + expect(activeModules).toEqual(expect.arrayContaining(data.modules.modules)); + }); + // Vendor Details setup('add vendor1 product @lite', async () => { // delete previous store products with predefined name if any diff --git a/tests/pw/tests/e2e/_env.setup.ts b/tests/pw/tests/e2e/_env.setup.ts index 99e170e800..aced94af02 100644 --- a/tests/pw/tests/e2e/_env.setup.ts +++ b/tests/pw/tests/e2e/_env.setup.ts @@ -12,7 +12,7 @@ import { helpers } from '@utils/helpers'; const { DOKAN_PRO, HPOS } = process.env; -setup.describe('setup site & woocommerce & user settings', () => { +setup.describe('setup site & woocommerce & dokan settings', () => { setup.use({ extraHTTPHeaders: { Authorization: payloads.adminAuth.Authorization } }); let apiUtils: ApiUtils; @@ -42,6 +42,23 @@ setup.describe('setup site & woocommerce & user settings', () => { HPOS && (await apiUtils.updateBatchWcSettingsOptions('advanced', payloads.advanced)); }); + setup('set dokan license @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProLicense, dbData.dokan.dokanProLicense); + await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProActiveModules, dbData.dokan.dokanProActiveModules); + }); + + setup('activate all dokan modules @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProActiveModules, dbData.dokan.dokanProActiveModules); + }); + + setup('check active dokan modules @pro', async () => { + setup.skip(!DOKAN_PRO, 'skip on lite'); + const activeModules = await apiUtils.getAllModuleIds({ status: 'active' }); + expect(activeModules).toEqual(expect.arrayContaining(data.modules.modules)); + }); + setup('set tax rate @lite', async () => { await apiUtils.setUpTaxRate(payloads.enableTaxRate, payloads.createTaxRate); }); @@ -99,23 +116,6 @@ setup.describe('setup site & woocommerce & user settings', () => { await apiUtils.createAttributeTerm(attributeId, { name: 'm' }); }); - setup('set dokan license @pro', async () => { - setup.skip(!DOKAN_PRO, 'skip on lite'); - await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProLicense, dbData.dokan.dokanProLicense); - await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProActiveModules, dbData.dokan.dokanProActiveModules); - }); - - setup('activate all dokan modules @pro', async () => { - setup.skip(!DOKAN_PRO, 'skip on lite'); - await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProActiveModules, dbData.dokan.dokanProActiveModules); - }); - - setup('check active dokan modules @pro', async () => { - setup.skip(!DOKAN_PRO, 'skip on lite'); - const activeModules = await apiUtils.getAllModuleIds({ status: 'active' }); - expect(activeModules).toEqual(expect.arrayContaining(data.modules.modules)); - }); - setup('disable simple-auction ajax bid check @pro', async () => { setup.skip(!process.env.CI || !DOKAN_PRO, 'skip on local'); const [, , status] = await apiUtils.getSinglePlugin('woocommerce-simple-auctions/woocommerce-simple-auctions', payloads.adminAuth); diff --git a/tests/pw/tests/e2e/license.spec.ts b/tests/pw/tests/e2e/license.spec.ts index 45c9556ec0..f663fa7fe9 100644 --- a/tests/pw/tests/e2e/license.spec.ts +++ b/tests/pw/tests/e2e/license.spec.ts @@ -13,7 +13,7 @@ test.describe('License test', () => { }); test.afterAll(async () => { - await admin.activateLicense(data.dokanLicense.correctKey); + // await admin.activateLicense(data.dokanLicense.correctKey); await aPage.close(); }); diff --git a/tests/pw/tests/e2e/productAddons.spec.ts b/tests/pw/tests/e2e/productAddons.spec.ts index 1aa49d2045..85ead5f015 100644 --- a/tests/pw/tests/e2e/productAddons.spec.ts +++ b/tests/pw/tests/e2e/productAddons.spec.ts @@ -15,6 +15,14 @@ test.describe('Product addon functionality test', () => { let categoryName: string; let apiUtils: ApiUtils; + // create product addon + async function createVendorProductAddon(): Promise<[string, string, string, string]> { + const [, categoryId, categoryName] = await apiUtils.createCategory(payloads.createCategoryRandom(), payloads.adminAuth); + const [, addonId, addonName, addonFieldTitle] = await apiUtils.createProductAddon({ ...payloads.createProductAddons(), restrict_to_categories: [categoryId] }, payloads.adminAuth); + await dbUtils.updateCell(addonId, VENDOR_ID); + return [addonId, addonName, addonFieldTitle, categoryName]; + } + test.beforeAll(async ({ browser }) => { const vendorContext = await browser.newContext(data.auth.vendorAuth); vPage = await vendorContext.newPage(); @@ -47,11 +55,3 @@ test.describe('Product addon functionality test', () => { await vendor.deleteAddon({ ...data.vendor.addon(), name: addonName }); }); }); - -// create product addon -async function createVendorProductAddon(): Promise<[string, string, string, string]> { - const [, categoryId, categoryName] = await apiUtils.createCategory(payloads.createCategoryRandom(), payloads.adminAuth); - const [, addonId, addonName, addonFieldTitle] = await apiUtils.createProductAddon({ ...payloads.createProductAddons(), restrict_to_categories: [categoryId] }, payloads.adminAuth); - await dbUtils.updateCell(addonId, VENDOR_ID); - return [addonId, addonName, addonFieldTitle, categoryName]; -} diff --git a/tests/pw/utils/gitTestSummary.ts b/tests/pw/utils/gitTestSummary.ts index f1f7b8d048..fffcd8391e 100644 --- a/tests/pw/utils/gitTestSummary.ts +++ b/tests/pw/utils/gitTestSummary.ts @@ -32,12 +32,14 @@ const addSummaryHeadingAndTable = core => { { data: 'Duration :alarm_clock:', header: true }, { data: 'Coverage :checkered_flag:', header: true }, ]; - const apiTesResult = getTestResult('API Tests', API_TEST_RESULT); - const e2eTesResult = getTestResult('E2E Tests', E2E_TEST_RESULT); - apiTesResult.push(getCoverageReport(API_COVERAGE)); - e2eTesResult.push('-'); + const apiTestResult = getTestResult('API Tests', API_TEST_RESULT); + const e2eTestResult = getTestResult('E2E Tests', E2E_TEST_RESULT); + apiTestResult && apiTestResult.push(getCoverageReport(API_COVERAGE)); + e2eTestResult && e2eTestResult.push('-'); const commit_sha = SHA ? `Commit SHA: ${SHA}` : ''; - core.summary.addHeading('Tests Summary').addRaw(commit_sha).addBreak().addBreak().addTable([tableHeader, apiTesResult, e2eTesResult]); + if (apiTestResult || e2eTestResult) { + core.summary.addHeading('Tests Summary').addRaw(commit_sha).addBreak().addBreak().addTable([tableHeader, apiTestResult, e2eTestResult]); + } }; const addList = core => { From 9a814b920818b20e36cce080155f8b474da93df0 Mon Sep 17 00:00:00 2001 From: shashwata Date: Tue, 12 Mar 2024 12:37:29 +0600 Subject: [PATCH 15/31] update: update some pro tests --- tests/pw/pages/abuseReportsPage.ts | 5 +-- tests/pw/pages/licensePage.ts | 12 ++++- tests/pw/pages/selectors.ts | 20 ++++----- tests/pw/tests/api/_env.setup.ts | 3 +- tests/pw/tests/e2e/_env.setup.ts | 7 ++- tests/pw/tests/e2e/abuseReports.spec.ts | 3 +- tests/pw/tests/e2e/menuManager.spec.ts | 4 +- tests/pw/utils/dbData.ts | 58 +++---------------------- tests/pw/utils/testData.ts | 6 +-- 9 files changed, 39 insertions(+), 79 deletions(-) diff --git a/tests/pw/pages/abuseReportsPage.ts b/tests/pw/pages/abuseReportsPage.ts index 655f761127..0cebbbad1c 100644 --- a/tests/pw/pages/abuseReportsPage.ts +++ b/tests/pw/pages/abuseReportsPage.ts @@ -86,12 +86,11 @@ export class AbuseReportsPage extends AdminPage { } // customer report product - async reportProduct(productName: string, report: product['report']): Promise { + async reportProduct(productName: string, report: product['report'], needLogin = false): Promise { await this.goto(data.subUrls.frontend.productDetails(helpers.slugify(productName))); await this.clickAndWaitForResponse(data.subUrls.ajax, abuseReportCustomer.reportAbuse); // non logged user - const isNonLoggedUser = await this.isVisible(abuseReportCustomer.nonLoggedUser.userName); - if (isNonLoggedUser) { + if (needLogin) { await this.clearAndType(abuseReportCustomer.nonLoggedUser.userName, report.username); await this.clearAndType(abuseReportCustomer.nonLoggedUser.userPassword, report.password); await this.clickAndWaitForResponse(data.subUrls.ajax, abuseReportCustomer.nonLoggedUser.login); diff --git a/tests/pw/pages/licensePage.ts b/tests/pw/pages/licensePage.ts index 439d753a3b..1d5d9a988a 100644 --- a/tests/pw/pages/licensePage.ts +++ b/tests/pw/pages/licensePage.ts @@ -21,7 +21,17 @@ export class LicensePage extends AdminPage { await this.toBeVisible(licenseAdmin.licenseText); // license section elements are visible - await this.multipleElementVisible(licenseAdmin.activateSection); + const { activateLicense, ...activateSection } = licenseAdmin.activateSection; + await this.multipleElementVisible(activateSection); + + // deactivate license is visible + await this.toBeVisible(licenseAdmin.deactivateLicense); + + // refresh license is visible + await this.toBeVisible(licenseAdmin.refreshLicense); + + // activated license info elements are visible + await this.toBeVisible(licenseAdmin.activateLicenseInfo); } // activate license diff --git a/tests/pw/pages/selectors.ts b/tests/pw/pages/selectors.ts index d8f746a18c..74347f5c45 100644 --- a/tests/pw/pages/selectors.ts +++ b/tests/pw/pages/selectors.ts @@ -1885,12 +1885,12 @@ export const selector = { // Site settings adminAreaAccess: '.admin_access .switch', - vendorStoreUrl: '#dokan_general\\[custom_store_url\\]', // todo: for CSS selector [ ] needs escaped with double back slash \\ + vendorStoreUrl: '#dokan_general\\[custom_store_url\\]', vendorSetupWizardLogo: '#dokan_general\\[setup_wizard_logo_url\\]', disableWelcomeWizard: '#dokan_general\\[disable_welcome_wizard\\]', setupWizardMessageIframe: 'iframe', setupWizardMessageHtmlBody: '#tinymce', - sellingProductTypes: (type: string) => `//label[@for='dokan_general[global_digital_mode][${type}]']`, + sellingProductTypes: (type: string) => `//label[contains(@for,'sell_${type}-global_digital_mode')]`, logShipStationApiRequest: '#dokan_general\\[enable_shipstation_logging\\]', dataClear: '#dokan_general\\[data_clear_on_uninstall\\]', confirmDataClear: '.swal2-confirm', @@ -1901,7 +1901,7 @@ export const selector = { storeProductPerPage: '#dokan_general\\[store_products_per_page\\]', enableTermsAndCondition: '.enable_tc_on_reg .switch', enableSingSellerMode: '#dokan_general\\[enable_single_seller_mode\\]', - storCategory: (category: string) => `//label[@for='dokan_general[store_category_type][${category}]']`, + storCategory: (category: string) => `//label[contains(@for,'${category}-store_category_type')]`, // product page settings showVendorInfo: '.show_vendor_info .switch', @@ -2240,7 +2240,7 @@ export const selector = { // Wholesale wholesale: { - whoCanSeeWholesalePrice: (type: string) => `//div[@class='wholesale_price_display dokan-settings-field-type-radio'] //label[@for='dokan_wholesale[wholesale_price_display][${type}]']`, + whoCanSeeWholesalePrice: (type: string) => `//label[contains(@for,'${type}_user-wholesale_price_display')]`, showWholesalePriceOnShopArchive: '.display_price_in_shop_archieve .switch', needApprovalForCustomer: '.need_approval_for_wholesale_customer .switch', wholesaleSaveChanges: '#submit', @@ -2298,11 +2298,11 @@ export const selector = { // Geolocation geolocation: { - locationMapPosition: (position: string) => `//label[@for='dokan_geolocation[show_locations_map][${position}]']`, - showMap: (type: string) => `//label[@for='dokan_geolocation[show_location_map_pages][${type}]']`, + locationMapPosition: (position: string) => `//label[contains(@for,'${position}-show_locations_map')]`, + showMap: (type: string) => `//label[contains(@for,'${type}-show_location_map_pages')]`, showFiltersBeforeLocationMap: '.show_filters_before_locations_map .switch', productLocationTab: '.show_product_location_in_wc_tab .switch', - radiusSearchUnit: (unit: string) => `//label[@for='dokan_geolocation[distance_unit][${unit}]']`, + radiusSearchUnit: (unit: string) => `//label[contains(@for,'${unit}-distance_unit')]`, radiusSearchMinimumDistance: '#dokan_geolocation\\[distance_min\\]', radiusSearchMaximumDistance: '#dokan_geolocation\\[distance_max\\]', mapZoomLevel: '#dokan_geolocation\\[map_zoom\\]', @@ -6740,9 +6740,7 @@ export const selector = { // non logged User nonLoggedUser: { - // userName: '#login-name', - // userPassword: '#login-password', - // login: '#support-submit-btn', + loginPopup: 'div#dokan-modal-login-form-popup', userName: '#dokan-login-form-username', userPassword: '#dokan-login-form-password', login: '#dokan-login-form-submit-btn', @@ -6924,7 +6922,7 @@ export const selector = { // Social icons storeSocialIcons: { facebook: '.fa-facebook-square', - twitter: '.fa-square-x-twitter', + twitter: '.fa-square-x-twitter', pinterest: '.fa-pinterest-square', linked: '.fa-linkedin', youtube: '.fa-youtube-square', diff --git a/tests/pw/tests/api/_env.setup.ts b/tests/pw/tests/api/_env.setup.ts index c4cb51468b..efea882de7 100644 --- a/tests/pw/tests/api/_env.setup.ts +++ b/tests/pw/tests/api/_env.setup.ts @@ -44,12 +44,11 @@ setup.describe('setup site & woocommerce & user settings', () => { setup('set dokan license @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProLicense, dbData.dokan.dokanProLicense); - await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProActiveModules, dbData.dokan.dokanProActiveModules); }); setup('activate all dokan modules @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); - await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProActiveModules, dbData.dokan.dokanProActiveModules); + await apiUtils.activateModules(dbData.dokan.modules); }); setup('check active dokan modules @pro', async () => { diff --git a/tests/pw/tests/e2e/_env.setup.ts b/tests/pw/tests/e2e/_env.setup.ts index aced94af02..760b2d3493 100644 --- a/tests/pw/tests/e2e/_env.setup.ts +++ b/tests/pw/tests/e2e/_env.setup.ts @@ -45,12 +45,11 @@ setup.describe('setup site & woocommerce & dokan settings', () => { setup('set dokan license @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProLicense, dbData.dokan.dokanProLicense); - await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProActiveModules, dbData.dokan.dokanProActiveModules); }); setup('activate all dokan modules @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); - await dbUtils.setDokanSettings(dbData.dokan.optionName.dokanProActiveModules, dbData.dokan.dokanProActiveModules); + await apiUtils.activateModules(dbData.dokan.modules); }); setup('check active dokan modules @pro', async () => { @@ -203,7 +202,7 @@ setup.describe('setup dokan settings', () => { await dbUtils.setDokanSettings(dbData.dokan.optionName.page, pageSettings); }); - setup.skip('admin set dokan appearance settings @lite', async () => { + setup('admin set dokan appearance settings @lite', async () => { await dbUtils.setDokanSettings(dbData.dokan.optionName.appearance, dbData.dokan.appearanceSettings); }); @@ -223,7 +222,7 @@ setup.describe('setup dokan settings', () => { await dbUtils.setDokanSettings(dbData.dokan.optionName.storeSupport, dbData.dokan.storeSupportSettings); }); - setup.skip('admin set dokan shipping status settings @pro', async () => { + setup('admin set dokan shipping status settings @pro', async () => { setup.skip(!DOKAN_PRO, 'skip on lite'); await dbUtils.setDokanSettings(dbData.dokan.optionName.shippingStatus, dbData.dokan.shippingStatusSettings); }); diff --git a/tests/pw/tests/e2e/abuseReports.spec.ts b/tests/pw/tests/e2e/abuseReports.spec.ts index da1adc1bbf..2bd8b8c675 100644 --- a/tests/pw/tests/e2e/abuseReports.spec.ts +++ b/tests/pw/tests/e2e/abuseReports.spec.ts @@ -31,7 +31,6 @@ test.describe('Abuse report test', () => { test.afterAll(async () => { await aPage.close(); await cPage.close(); - // await gPage.close(); await apiUtils.dispose(); }); @@ -74,7 +73,7 @@ test.describe('Abuse report test', () => { test('guest customer need to log-in to report product @pro @g', async ({ page }) => { const guest = new AbuseReportsPage(page); await dbUtils.setDokanSettings(dbData.dokan.optionName.productReportAbuse, { ...dbData.dokan.productReportAbuseSettings, reported_by_logged_in_users_only: 'on' }); - await guest.reportProduct(data.predefined.simpleProduct.product1.name, data.product.report); + await guest.reportProduct(data.predefined.simpleProduct.product1.name, data.product.report, true); await dbUtils.setDokanSettings(dbData.dokan.optionName.productReportAbuse, dbData.dokan.productReportAbuseSettings); }); }); diff --git a/tests/pw/tests/e2e/menuManager.spec.ts b/tests/pw/tests/e2e/menuManager.spec.ts index d4203493a7..3ca467acac 100644 --- a/tests/pw/tests/e2e/menuManager.spec.ts +++ b/tests/pw/tests/e2e/menuManager.spec.ts @@ -33,13 +33,13 @@ test.describe('Menu Manager test', () => { }); test('admin can rename menu @pro @a', async () => { - await admin.renameMenu('Request Quotes', 'Quotations'); + await admin.renameMenu('Withdraw', 'Withdraws'); //reset // await dbUtils.setDokanSettings(dbData.dokan.optionName.menuManager, dbData.dokan.menuManagerSettings); }); test("admin can't rename menu with more than 45 characters @pro @a", async () => { - await admin.cantRenameMenuBeyondLimit('Subscription', 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'); + await admin.cantRenameMenuBeyondLimit('Staff', 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz'); }); test("admin can't rename disabled menu @pro @a", async () => { diff --git a/tests/pw/utils/dbData.ts b/tests/pw/utils/dbData.ts index 25dc124cfa..a33ca9e66d 100644 --- a/tests/pw/utils/dbData.ts +++ b/tests/pw/utils/dbData.ts @@ -1091,10 +1091,9 @@ export const dbData = { alert_email_body: 'Dear subscriber, Your subscription will be ending soon. Please renew your package in a timely', }, - // dokan pro license dokanProLicense: { - key: '74c8654e-84a5-49b2-a3f5-81afba8e13fa', + key: process.env.LICENSE_KEY, status: 'activate', remaining: 42, activation_limit: 50, @@ -1105,24 +1104,26 @@ export const dbData = { }, // dokan pro modules - dokanProActiveModules: [ - 'booking', + modules: [ 'auction', + 'booking', 'color_scheme_customizer', 'delivery_time', 'elementor', - 'germanized', + 'export_import', 'follow_store', 'geolocation', + 'germanized', 'live_chat', 'live_search', 'mangopay', + 'moip', 'order_min_max', 'paypal_marketplace', 'product_addon', 'product_advertising', 'product_enquiry', - 'vsp', + 'product_subscription', 'rank_math', 'razorpay', 'report_abuse', @@ -1138,55 +1139,10 @@ export const dbData = { 'stripe_express', 'table_rate_shipping', 'vendor_analytics', - 'export_import', 'vendor_staff', - 'product_subscription', 'vendor_verification', - 'wholesale', - 'moip', - ], - - // modules - modules: [ - 'booking', - 'color_scheme_customizer', - 'delivery_time', - 'elementor', - 'export_import', - 'follow_store', - 'geolocation', - 'germanized', - 'live_chat', - 'live_search', - 'moip', - 'dokan_paypal_ap', - 'paypal_marketplace', - 'product_addon', - 'product_enquiry', - 'report_abuse', - 'rma', - 'seller_vacation', - 'shipstation', - 'auction', - 'spmv', - 'store_reviews', - 'store_support', - 'stripe', - 'product_advertising', - 'product_subscription', - 'vendor_analytics', - 'vendor_staff', 'vsp', - 'vendor_verification', 'wholesale', - 'rank_math', - 'table_rate_shipping', - 'mangopay', - 'order_min_max', - 'razorpay', - 'seller_badge', - 'stripe_express', - 'request_for_quotation', ], // abuse report diff --git a/tests/pw/utils/testData.ts b/tests/pw/utils/testData.ts index 827a8acde6..b8743282d5 100644 --- a/tests/pw/utils/testData.ts +++ b/tests/pw/utils/testData.ts @@ -1823,7 +1823,7 @@ export const data = { vendorStoreUrl: 'store', setupWizardMessage: "Thank you for choosing The Marketplace to power your online store! This quick setup wizard will help you configure the basic settings. It's completely optional and shouldn't take longer than two minutes.", - sellingProductTypes: 'sell_both', // 'sell_both', 'sell_physical', 'sell_digital' + sellingProductTypes: 'both', // 'both', 'physical', 'digital' storeProductPerPage: '12', storCategory: 'multiple', // 'none', 'single', 'multiple' saveSuccessMessage: 'Setting has been saved successfully.', @@ -1947,7 +1947,7 @@ export const data = { // Wholesale wholesale: { - whoCanSeeWholesalePrice: 'all_user', + whoCanSeeWholesalePrice: 'all', // 'all', 'wholesale_customer' saveSuccessMessage: 'Setting has been saved successfully.', }, @@ -2026,7 +2026,7 @@ export const data = { // dokan license dokanLicense: { - correctKey: String(process.env.LICENSE_KEY), + correctKey: process.env.LICENSE_KEY, incorrectKey: 'ABC-123-DEF-456-GHI-789', }, From b203aa03d7ca01ad8a80a608841fc99104d6a47d Mon Sep 17 00:00:00 2001 From: shashwata Date: Thu, 14 Mar 2024 14:05:54 +0600 Subject: [PATCH 16/31] update: update yml --- .github/workflows/e2e_api_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index 3d344b1cdd..19ead38e05 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -185,7 +185,7 @@ jobs: # Run API tests - name: 🧪 Running the api tests id: api-test - if: always() && steps.db-port.outcome == 'success' || ( always() && steps.db-port.outcome == 'success' && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) + if: steps.db-port.outcome == 'success' || ( steps.db-port.outcome == 'success' && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) timeout-minutes: 5 run: | cd tests/pw @@ -225,7 +225,7 @@ jobs: # Backup Database - name: Backup Database - if: steps.wp-env.outcome == 'success' + if: steps.db-port.outcome == 'success' run: | cd tests/pw npm run wp-env run tests-cli wp db export wp-data/db.sql From 667fded06d496927f5b5701a33e8bdcb792227c8 Mon Sep 17 00:00:00 2001 From: shashwata Date: Fri, 22 Mar 2024 12:04:53 +0600 Subject: [PATCH 17/31] update packages --- .github/workflows/e2e_api_tests.yml | 2 +- tests/pw/package-lock.json | 427 ++++++++++++++-------------- tests/pw/package.json | 20 +- 3 files changed, 226 insertions(+), 223 deletions(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index 19ead38e05..9bc01e7e04 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -73,7 +73,7 @@ jobs: if: success() uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 cache: npm - name: Composer install and build (Dokan-lite) diff --git a/tests/pw/package-lock.json b/tests/pw/package-lock.json index c49044d9db..6450d8d417 100644 --- a/tests/pw/package-lock.json +++ b/tests/pw/package-lock.json @@ -9,23 +9,23 @@ "version": "1.0.0", "license": "ISC", "dependencies": { - "@faker-js/faker": "^8.4.0", - "@playwright/test": "1.41", - "@wordpress/env": "^9.2.0", - "dotenv": "^16.4.1", + "@faker-js/faker": "^8.4.1", + "@playwright/test": "1.42", + "@wordpress/env": "^9.6.0", + "dotenv": "^16.4.5", "mysqlconnector": "^2.0.6", "php-serialize": "^4.1.1", "zod": "^3.22.4" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", - "eslint": "^8.56.0", + "@typescript-eslint/eslint-plugin": "^7.3.1", + "@typescript-eslint/parser": "^7.3.1", + "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-playwright": "^0.22.2", - "npm-check-updates": "^16.14.14", + "eslint-plugin-playwright": "^1.5.4", + "npm-check-updates": "^16.14.17", "prettier": "^3.2.5", - "typescript": "^5.3.3" + "typescript": "^5.4.3" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -113,18 +113,18 @@ } }, "node_modules/@eslint/js": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", - "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@faker-js/faker": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.4.0.tgz", - "integrity": "sha512-htW87352wzUCdX1jyUQocUcmAaFqcR/w082EC8iP/gtkF0K+aKcBp0hR5Arb7dzR8tQ1TrhE9DNa5EbJELm84w==", + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.4.1.tgz", + "integrity": "sha512-XQ3cU+Q8Uqmrbf2e0cIC/QN43sTBSC8KF12u29Mb47tWrt2hAgBXSgpZMj4Ao8Uk0iJcU99QsOCaIL8934obCg==", "funding": [ { "type": "opencollective", @@ -137,13 +137,13 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", - "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "dependencies": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" }, "engines": { @@ -164,9 +164,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", - "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, "node_modules/@isaacs/cliui": { @@ -424,11 +424,11 @@ } }, "node_modules/@playwright/test": { - "version": "1.41.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.41.0.tgz", - "integrity": "sha512-Grvzj841THwtpBOrfiHOeYTJQxDRnKofMSzCiV8XeyLWu3o89qftQ4BCKfkziJhSUQRd0utKhrddtIsiraIwmw==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.1.tgz", + "integrity": "sha512-Gq9rmS54mjBL/7/MvBaNOBwbfnh7beHvS6oS4srqXFcQHpQCV1+c8JXWE8VLPyRDhgS3H8x8A7hztqI9VnwrAQ==", "dependencies": { - "playwright": "1.41.0" + "playwright": "1.42.1" }, "bin": { "playwright": "cli.js" @@ -621,22 +621,22 @@ } }, "node_modules/@types/semver": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz", - "integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==", + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", - "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.3.1.tgz", + "integrity": "sha512-STEDMVQGww5lhCuNXVSQfbfuNII5E08QWkvAw5Qwf+bj2WT+JkG1uc+5/vXA3AOYMDHVOSpL+9rcbEUiHIm2dw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/type-utils": "6.21.0", - "@typescript-eslint/utils": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/scope-manager": "7.3.1", + "@typescript-eslint/type-utils": "7.3.1", + "@typescript-eslint/utils": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -645,15 +645,15 @@ "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha", - "eslint": "^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -662,26 +662,26 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", - "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.3.1.tgz", + "integrity": "sha512-Rq49+pq7viTRCH48XAbTA+wdLRrB/3sRq4Lpk0oGDm0VmnjBrAOVXH/Laalmwsv2VpekiEfVFwJYVk6/e8uvQw==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/scope-manager": "7.3.1", + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/typescript-estree": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1", "debug": "^4.3.4" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -690,16 +690,16 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", - "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.3.1.tgz", + "integrity": "sha512-fVS6fPxldsKY2nFvyT7IP78UO1/I2huG+AYu5AMjCT9wtl6JFiDnsv4uad4jQ0GTFzcUV5HShVeN96/17bTBag==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0" + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -707,25 +707,25 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", - "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.3.1.tgz", + "integrity": "sha512-iFhaysxFsMDQlzJn+vr3OrxN8NmdQkHks4WaqD4QBnt5hsq234wcYdyQ9uquzJJIDAj5W4wQne3yEsYA6OmXGw==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/typescript-estree": "7.3.1", + "@typescript-eslint/utils": "7.3.1", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -734,12 +734,12 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", - "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.3.1.tgz", + "integrity": "sha512-2tUf3uWggBDl4S4183nivWQ2HqceOZh1U4hhu4p1tPiIJoRRXrab7Y+Y0p+dozYwZVvLPRI6r5wKe9kToF9FIw==", "dev": true, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -747,13 +747,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", - "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.3.1.tgz", + "integrity": "sha512-tLpuqM46LVkduWP7JO7yVoWshpJuJzxDOPYIVWUUZbW+4dBpgGeUdl/fQkhuV0A8eGnphYw3pp8d2EnvPOfxmQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -762,7 +762,7 @@ "ts-api-utils": "^1.0.1" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -799,41 +799,41 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", - "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.3.1.tgz", + "integrity": "sha512-jIERm/6bYQ9HkynYlNZvXpzmXWZGhMbrOvq3jJzOSOlKXsVjrrolzWBjDW6/TvT5Q3WqaN4EkmcfdQwi9tDjBQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/scope-manager": "7.3.1", + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/typescript-estree": "7.3.1", "semver": "^7.5.4" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "eslint": "^8.56.0" } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", - "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.3.1.tgz", + "integrity": "sha512-9RMXwQF8knsZvfv9tdi+4D/j7dMG28X/wMJ8Jj6eOHyHWwDW4ngQJcqEczSsqIKKjFiLFr40Mnr7a5ulDD3vmw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/types": "7.3.1", "eslint-visitor-keys": "^3.4.1" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -847,9 +847,9 @@ "dev": true }, "node_modules/@wordpress/env": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-9.2.0.tgz", - "integrity": "sha512-2gl65WYbkuTjnW2SHKjeqdpLTgnPc/xVvFiwG+2p/RJwDHSuw1xXSdFqFUh3+wC/4cuXy9b2ZBm/SYsBoc8DDw==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-9.6.0.tgz", + "integrity": "sha512-vXFcr+MfMhREEw+8TBrEtS4MlTJSAjEj5qtUHYK4dpN5DaD1LqQjPxgFFcCvKrZf0ZtT99NQqw+HHB7rYK64rg==", "dependencies": { "chalk": "^4.0.0", "copy-dir": "^1.3.0", @@ -1721,14 +1721,14 @@ } }, "node_modules/dotenv": { - "version": "16.4.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.1.tgz", - "integrity": "sha512-CjA3y+Dr3FyFDOAMnxZEGtnW9KBR2M0JvvUtXNW+dYJL5ROWxP9DUHCwgFqpMk0OXCc0ljhaNTr2w/kutYIcHQ==", + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", "engines": { "node": ">=12" }, "funding": { - "url": "https://github.com/motdotla/dotenv?sponsor=1" + "url": "https://dotenvx.com" } }, "node_modules/eastasianwidth": { @@ -1821,16 +1821,16 @@ } }, "node_modules/eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", - "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -1888,15 +1888,18 @@ } }, "node_modules/eslint-plugin-playwright": { - "version": "0.22.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.22.2.tgz", - "integrity": "sha512-LtOB9myIX1O7HHqg9vtvBLjvXq1MXKuXIcD1nS+qZiMUJV6s9HBdilURAr9pIFc9kEelbVF54hOJ8pMxHvJP7g==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-1.5.4.tgz", + "integrity": "sha512-J38Wy3Vc2f9y73J+KRmgXgbYI8TZ3zbz6qBbTj3PhpFndUS572jZ7kqQ3rJ9si5BaMHT7lmZzraO+3UjwIDV4Q==", "dev": true, "dependencies": { "globals": "^13.23.0" }, + "engines": { + "node": ">=16.6.0" + }, "peerDependencies": { - "eslint": ">=7", + "eslint": ">=8.40.0", "eslint-plugin-jest": ">=25" }, "peerDependenciesMeta": { @@ -3607,9 +3610,9 @@ } }, "node_modules/npm-check-updates": { - "version": "16.14.14", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.14.14.tgz", - "integrity": "sha512-Y3ajS/Ep40jM489rLBdz9jehn/BMil5s9fA4PSr2ZJxxSmtLWCSmRqsI2IEZ9Nb3MTMu8a3s7kBs0l+JbjdkTA==", + "version": "16.14.17", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.14.17.tgz", + "integrity": "sha512-ElnDdXKe60f8S6RhzFeaGuH2TFJmt2cU2HjLdowldabdm27nWFCxV2ebeP3xGbQkzp2+RPDQNdW9HqU1lcY8ag==", "dev": true, "dependencies": { "chalk": "^5.3.0", @@ -4326,11 +4329,11 @@ } }, "node_modules/playwright": { - "version": "1.41.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.41.0.tgz", - "integrity": "sha512-XOsfl5ZtAik/T9oek4V0jAypNlaCNzuKOwVhqhgYT3os6kH34PzbRb74F0VWcLYa5WFdnmxl7qyAHBXvPv7lqQ==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.1.tgz", + "integrity": "sha512-PgwB03s2DZBcNRoW+1w9E+VkLBxweib6KTXM0M3tkiT4jVxKSi6PmVJ591J+0u10LUrgxB7dLRbiJqO5s2QPMg==", "dependencies": { - "playwright-core": "1.41.0" + "playwright-core": "1.42.1" }, "bin": { "playwright": "cli.js" @@ -4343,9 +4346,9 @@ } }, "node_modules/playwright-core": { - "version": "1.41.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.41.0.tgz", - "integrity": "sha512-UGKASUhXmvqm2Lxa1fNr8sFwAtqjpgBRr9jQ7XBI8Rn5uFiEowGUGwrruUQsVPIom4bk7Lt+oLGpXobnXzrBIw==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.1.tgz", + "integrity": "sha512-mxz6zclokgrke9p1vtdy/COWBH+eOZgYUVVU34C73M+4j4HLlQJHtfcqiqqxpP0o8HhMkflvfbquLX5dg6wlfA==", "bin": { "playwright-core": "cli.js" }, @@ -5265,12 +5268,12 @@ } }, "node_modules/ts-api-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.1.tgz", - "integrity": "sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", "dev": true, "engines": { - "node": ">=16.13.0" + "node": ">=16" }, "peerDependencies": { "typescript": ">=4.2.0" @@ -5329,9 +5332,9 @@ } }, "node_modules/typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz", + "integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -5835,24 +5838,24 @@ } }, "@eslint/js": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.56.0.tgz", - "integrity": "sha512-gMsVel9D7f2HLkBma9VbtzZRehRogVRfbr++f06nL2vnCGCNlzOD+/MUov/F4p8myyAHspEhVobgjpX64q5m6A==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.57.0.tgz", + "integrity": "sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==", "dev": true }, "@faker-js/faker": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.4.0.tgz", - "integrity": "sha512-htW87352wzUCdX1jyUQocUcmAaFqcR/w082EC8iP/gtkF0K+aKcBp0hR5Arb7dzR8tQ1TrhE9DNa5EbJELm84w==" + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.4.1.tgz", + "integrity": "sha512-XQ3cU+Q8Uqmrbf2e0cIC/QN43sTBSC8KF12u29Mb47tWrt2hAgBXSgpZMj4Ao8Uk0iJcU99QsOCaIL8934obCg==" }, "@humanwhocodes/config-array": { - "version": "0.11.13", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", - "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", + "version": "0.11.14", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", + "integrity": "sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==", "dev": true, "requires": { - "@humanwhocodes/object-schema": "^2.0.1", - "debug": "^4.1.1", + "@humanwhocodes/object-schema": "^2.0.2", + "debug": "^4.3.1", "minimatch": "^3.0.5" } }, @@ -5863,9 +5866,9 @@ "dev": true }, "@humanwhocodes/object-schema": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", - "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.2.tgz", + "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, "@isaacs/cliui": { @@ -6059,11 +6062,11 @@ "optional": true }, "@playwright/test": { - "version": "1.41.0", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.41.0.tgz", - "integrity": "sha512-Grvzj841THwtpBOrfiHOeYTJQxDRnKofMSzCiV8XeyLWu3o89qftQ4BCKfkziJhSUQRd0utKhrddtIsiraIwmw==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.42.1.tgz", + "integrity": "sha512-Gq9rmS54mjBL/7/MvBaNOBwbfnh7beHvS6oS4srqXFcQHpQCV1+c8JXWE8VLPyRDhgS3H8x8A7hztqI9VnwrAQ==", "requires": { - "playwright": "1.41.0" + "playwright": "1.42.1" } }, "@pnpm/config.env-replace": { @@ -6215,22 +6218,22 @@ } }, "@types/semver": { - "version": "7.5.6", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.6.tgz", - "integrity": "sha512-dn1l8LaMea/IjDoHNd9J52uBbInB796CDffS6VdIxvqYCPSG0V0DzHp76GpaWnlhg88uYyPbXCDIowa86ybd5A==", + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz", - "integrity": "sha512-oy9+hTPCUFpngkEZUSzbf9MxI65wbKFoQYsgPdILTfbUldp5ovUuphZVe4i30emU9M/kP+T64Di0mxl7dSw3MA==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.3.1.tgz", + "integrity": "sha512-STEDMVQGww5lhCuNXVSQfbfuNII5E08QWkvAw5Qwf+bj2WT+JkG1uc+5/vXA3AOYMDHVOSpL+9rcbEUiHIm2dw==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/type-utils": "6.21.0", - "@typescript-eslint/utils": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/scope-manager": "7.3.1", + "@typescript-eslint/type-utils": "7.3.1", + "@typescript-eslint/utils": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -6240,54 +6243,54 @@ } }, "@typescript-eslint/parser": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", - "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.3.1.tgz", + "integrity": "sha512-Rq49+pq7viTRCH48XAbTA+wdLRrB/3sRq4Lpk0oGDm0VmnjBrAOVXH/Laalmwsv2VpekiEfVFwJYVk6/e8uvQw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/scope-manager": "7.3.1", + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/typescript-estree": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", - "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.3.1.tgz", + "integrity": "sha512-fVS6fPxldsKY2nFvyT7IP78UO1/I2huG+AYu5AMjCT9wtl6JFiDnsv4uad4jQ0GTFzcUV5HShVeN96/17bTBag==", "dev": true, "requires": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0" + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1" } }, "@typescript-eslint/type-utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.21.0.tgz", - "integrity": "sha512-rZQI7wHfao8qMX3Rd3xqeYSMCL3SoiSQLBATSiVKARdFGCYSRvmViieZjqc58jKgs8Y8i9YvVVhRbHSTA4VBag==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.3.1.tgz", + "integrity": "sha512-iFhaysxFsMDQlzJn+vr3OrxN8NmdQkHks4WaqD4QBnt5hsq234wcYdyQ9uquzJJIDAj5W4wQne3yEsYA6OmXGw==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/utils": "6.21.0", + "@typescript-eslint/typescript-estree": "7.3.1", + "@typescript-eslint/utils": "7.3.1", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", - "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.3.1.tgz", + "integrity": "sha512-2tUf3uWggBDl4S4183nivWQ2HqceOZh1U4hhu4p1tPiIJoRRXrab7Y+Y0p+dozYwZVvLPRI6r5wKe9kToF9FIw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", - "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.3.1.tgz", + "integrity": "sha512-tLpuqM46LVkduWP7JO7yVoWshpJuJzxDOPYIVWUUZbW+4dBpgGeUdl/fQkhuV0A8eGnphYw3pp8d2EnvPOfxmQ==", "dev": true, "requires": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/visitor-keys": "7.3.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -6317,27 +6320,27 @@ } }, "@typescript-eslint/utils": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", - "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.3.1.tgz", + "integrity": "sha512-jIERm/6bYQ9HkynYlNZvXpzmXWZGhMbrOvq3jJzOSOlKXsVjrrolzWBjDW6/TvT5Q3WqaN4EkmcfdQwi9tDjBQ==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/scope-manager": "7.3.1", + "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/typescript-estree": "7.3.1", "semver": "^7.5.4" } }, "@typescript-eslint/visitor-keys": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", - "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.3.1.tgz", + "integrity": "sha512-9RMXwQF8knsZvfv9tdi+4D/j7dMG28X/wMJ8Jj6eOHyHWwDW4ngQJcqEczSsqIKKjFiLFr40Mnr7a5ulDD3vmw==", "dev": true, "requires": { - "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/types": "7.3.1", "eslint-visitor-keys": "^3.4.1" } }, @@ -6348,9 +6351,9 @@ "dev": true }, "@wordpress/env": { - "version": "9.2.0", - "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-9.2.0.tgz", - "integrity": "sha512-2gl65WYbkuTjnW2SHKjeqdpLTgnPc/xVvFiwG+2p/RJwDHSuw1xXSdFqFUh3+wC/4cuXy9b2ZBm/SYsBoc8DDw==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-9.6.0.tgz", + "integrity": "sha512-vXFcr+MfMhREEw+8TBrEtS4MlTJSAjEj5qtUHYK4dpN5DaD1LqQjPxgFFcCvKrZf0ZtT99NQqw+HHB7rYK64rg==", "requires": { "chalk": "^4.0.0", "copy-dir": "^1.3.0", @@ -6980,9 +6983,9 @@ } }, "dotenv": { - "version": "16.4.1", - "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.1.tgz", - "integrity": "sha512-CjA3y+Dr3FyFDOAMnxZEGtnW9KBR2M0JvvUtXNW+dYJL5ROWxP9DUHCwgFqpMk0OXCc0ljhaNTr2w/kutYIcHQ==" + "version": "16.4.5", + "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", + "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==" }, "eastasianwidth": { "version": "0.2.0", @@ -7055,16 +7058,16 @@ "dev": true }, "eslint": { - "version": "8.56.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", - "integrity": "sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==", + "version": "8.57.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.57.0.tgz", + "integrity": "sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.4", - "@eslint/js": "8.56.0", - "@humanwhocodes/config-array": "^0.11.13", + "@eslint/js": "8.57.0", + "@humanwhocodes/config-array": "^0.11.14", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "@ungap/structured-clone": "^1.2.0", @@ -7125,9 +7128,9 @@ "requires": {} }, "eslint-plugin-playwright": { - "version": "0.22.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.22.2.tgz", - "integrity": "sha512-LtOB9myIX1O7HHqg9vtvBLjvXq1MXKuXIcD1nS+qZiMUJV6s9HBdilURAr9pIFc9kEelbVF54hOJ8pMxHvJP7g==", + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-1.5.4.tgz", + "integrity": "sha512-J38Wy3Vc2f9y73J+KRmgXgbYI8TZ3zbz6qBbTj3PhpFndUS572jZ7kqQ3rJ9si5BaMHT7lmZzraO+3UjwIDV4Q==", "dev": true, "requires": { "globals": "^13.23.0" @@ -8419,9 +8422,9 @@ } }, "npm-check-updates": { - "version": "16.14.14", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.14.14.tgz", - "integrity": "sha512-Y3ajS/Ep40jM489rLBdz9jehn/BMil5s9fA4PSr2ZJxxSmtLWCSmRqsI2IEZ9Nb3MTMu8a3s7kBs0l+JbjdkTA==", + "version": "16.14.17", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.14.17.tgz", + "integrity": "sha512-ElnDdXKe60f8S6RhzFeaGuH2TFJmt2cU2HjLdowldabdm27nWFCxV2ebeP3xGbQkzp2+RPDQNdW9HqU1lcY8ag==", "dev": true, "requires": { "chalk": "^5.3.0", @@ -8925,18 +8928,18 @@ "dev": true }, "playwright": { - "version": "1.41.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.41.0.tgz", - "integrity": "sha512-XOsfl5ZtAik/T9oek4V0jAypNlaCNzuKOwVhqhgYT3os6kH34PzbRb74F0VWcLYa5WFdnmxl7qyAHBXvPv7lqQ==", + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.42.1.tgz", + "integrity": "sha512-PgwB03s2DZBcNRoW+1w9E+VkLBxweib6KTXM0M3tkiT4jVxKSi6PmVJ591J+0u10LUrgxB7dLRbiJqO5s2QPMg==", "requires": { "fsevents": "2.3.2", - "playwright-core": "1.41.0" + "playwright-core": "1.42.1" } }, "playwright-core": { - "version": "1.41.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.41.0.tgz", - "integrity": "sha512-UGKASUhXmvqm2Lxa1fNr8sFwAtqjpgBRr9jQ7XBI8Rn5uFiEowGUGwrruUQsVPIom4bk7Lt+oLGpXobnXzrBIw==" + "version": "1.42.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.42.1.tgz", + "integrity": "sha512-mxz6zclokgrke9p1vtdy/COWBH+eOZgYUVVU34C73M+4j4HLlQJHtfcqiqqxpP0o8HhMkflvfbquLX5dg6wlfA==" }, "prelude-ls": { "version": "1.2.1", @@ -9616,9 +9619,9 @@ } }, "ts-api-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.1.tgz", - "integrity": "sha512-lC/RGlPmwdrIBFTX59wwNzqh7aR2otPNPR/5brHZm/XKFYKsfqxihXUe9pU3JI+3vGkl+vyCoNNnPhJn3aLK1A==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.3.0.tgz", + "integrity": "sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==", "dev": true, "requires": {} }, @@ -9663,9 +9666,9 @@ } }, "typescript": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", - "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.3.tgz", + "integrity": "sha512-KrPd3PKaCLr78MalgiwJnA25Nm8HAmdwN3mYUYZgG/wizIo9EainNVQI9/yDavtVFRN2h3k8uf3GLHuhDMgEHg==", "dev": true }, "unique-filename": { diff --git a/tests/pw/package.json b/tests/pw/package.json index 355cddccc6..301a023f9c 100644 --- a/tests/pw/package.json +++ b/tests/pw/package.json @@ -51,20 +51,20 @@ "author": "", "license": "ISC", "devDependencies": { - "@typescript-eslint/eslint-plugin": "^6.21.0", - "@typescript-eslint/parser": "^6.21.0", - "eslint": "^8.56.0", + "@typescript-eslint/eslint-plugin": "^7.3.1", + "@typescript-eslint/parser": "^7.3.1", + "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-playwright": "^0.22.2", - "npm-check-updates": "^16.14.14", + "eslint-plugin-playwright": "^1.5.4", + "npm-check-updates": "^16.14.17", "prettier": "^3.2.5", - "typescript": "^5.3.3" + "typescript": "^5.4.3" }, "dependencies": { - "@faker-js/faker": "^8.4.0", - "@playwright/test": "1.41", - "@wordpress/env": "^9.2.0", - "dotenv": "^16.4.1", + "@faker-js/faker": "^8.4.1", + "@playwright/test": "1.42", + "@wordpress/env": "^9.6.0", + "dotenv": "^16.4.5", "mysqlconnector": "^2.0.6", "php-serialize": "^4.1.1", "zod": "^3.22.4" From 1a4b99af670d24783c773527b42209e85112fdc6 Mon Sep 17 00:00:00 2001 From: shashwata Date: Fri, 22 Mar 2024 14:53:19 +0600 Subject: [PATCH 18/31] log git action seto outcome --- .github/workflows/e2e_api_tests.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index 9bc01e7e04..16e1d96e69 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -73,7 +73,7 @@ jobs: if: success() uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 16 cache: npm - name: Composer install and build (Dokan-lite) @@ -173,6 +173,14 @@ jobs: # cd tests/pw # npm run pw:deps-only + - name: log 2 + if: always() + run: | + echo "wp-env outcome: " ${{ steps.wp-env.outcome }} + echo "db-port outcome: " ${{ steps.db-port.outcome }} + echo "playwright-version outcome: " ${{ steps.playwright-version.outcome }} + echo "pw-install outcome: " ${{ steps.pw-install.outcome }} + # Run e2e tests - name: 🧪 Running the e2e tests id: e2e-test @@ -191,6 +199,12 @@ jobs: cd tests/pw npm run test:api:lite + - name: log 2 + if: always() + run: | + echo "E2E test outcome: " ${{ steps.e2e-test.outcome }} + echo "API test outcome: " ${{ steps.api-test.outcome }} + # Prepare test summary - name: Prepare test summary id: prepare-test-summary From 06228d0704f75a2acac7f1b3c076dd374a8263ba Mon Sep 17 00:00:00 2001 From: shashwata Date: Fri, 22 Mar 2024 15:03:42 +0600 Subject: [PATCH 19/31] update condition --- .github/workflows/e2e_api_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index 16e1d96e69..a7ea74fced 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -173,7 +173,7 @@ jobs: # cd tests/pw # npm run pw:deps-only - - name: log 2 + - name: log 1 if: always() run: | echo "wp-env outcome: " ${{ steps.wp-env.outcome }} @@ -193,7 +193,7 @@ jobs: # Run API tests - name: 🧪 Running the api tests id: api-test - if: steps.db-port.outcome == 'success' || ( steps.db-port.outcome == 'success' && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) + if: ${{ steps.db-port.outcome }} == 'success' || ( steps.db-port.outcome == 'success' && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) timeout-minutes: 5 run: | cd tests/pw From 1c83db7647603187afabe84b2ede3ec6b37c07e0 Mon Sep 17 00:00:00 2001 From: shashwata Date: Fri, 22 Mar 2024 15:08:34 +0600 Subject: [PATCH 20/31] update condition --- .github/workflows/e2e_api_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index a7ea74fced..96b4022ecb 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -193,7 +193,7 @@ jobs: # Run API tests - name: 🧪 Running the api tests id: api-test - if: ${{ steps.db-port.outcome }} == 'success' || ( steps.db-port.outcome == 'success' && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) + if: ${{ steps.db-port.outcome }} == 'success' timeout-minutes: 5 run: | cd tests/pw From 29d7b825756afcdcdeb1a428fd85e54515c8043f Mon Sep 17 00:00:00 2001 From: shashwata Date: Mon, 1 Apr 2024 09:31:59 +0600 Subject: [PATCH 21/31] update yml --- .github/workflows/e2e_api_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index 96b4022ecb..2dbe25e3f1 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -193,7 +193,7 @@ jobs: # Run API tests - name: 🧪 Running the api tests id: api-test - if: ${{ steps.db-port.outcome }} == 'success' + if: steps.db-port.outcome == 'success' || (steps.db-port.outcome == 'success' && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) timeout-minutes: 5 run: | cd tests/pw From 61bafa80b3752c4ac4e361bc38930d5e2b2baec4 Mon Sep 17 00:00:00 2001 From: shashwata Date: Mon, 1 Apr 2024 09:35:09 +0600 Subject: [PATCH 22/31] update yml --- .github/workflows/e2e_api_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index 2dbe25e3f1..01001dad8c 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -184,7 +184,7 @@ jobs: # Run e2e tests - name: 🧪 Running the e2e tests id: e2e-test - if: success() || ( success() && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'E2E' || github.event.inputs.testsuite == 'All'))) + if: success() || ( success() && ${{ (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'E2E' || github.event.inputs.testsuite == 'All')) }} ) timeout-minutes: 40 run: | cd tests/pw @@ -193,7 +193,7 @@ jobs: # Run API tests - name: 🧪 Running the api tests id: api-test - if: steps.db-port.outcome == 'success' || (steps.db-port.outcome == 'success' && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) + if: ${{ steps.db-port.outcome == 'success' || (steps.db-port.outcome == 'success' && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) }} timeout-minutes: 5 run: | cd tests/pw From db084502d68f68d409aedf79a5c0103cfd5cc8d7 Mon Sep 17 00:00:00 2001 From: shashwata Date: Mon, 1 Apr 2024 10:31:05 +0600 Subject: [PATCH 23/31] update yml --- .github/workflows/e2e_api_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index 01001dad8c..00aef3d363 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -184,7 +184,7 @@ jobs: # Run e2e tests - name: 🧪 Running the e2e tests id: e2e-test - if: success() || ( success() && ${{ (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'E2E' || github.event.inputs.testsuite == 'All')) }} ) + if: success() || ${{ ( success() && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'E2E' || github.event.inputs.testsuite == 'All'))) }} timeout-minutes: 40 run: | cd tests/pw @@ -193,7 +193,7 @@ jobs: # Run API tests - name: 🧪 Running the api tests id: api-test - if: ${{ steps.db-port.outcome == 'success' || (steps.db-port.outcome == 'success' && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) }} + if: ${{ steps.db-port.outcome == 'success' }} || ${{ (steps.db-port.outcome == 'success' && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) }} timeout-minutes: 5 run: | cd tests/pw From 4e6b9419a102cd511226d249c7ff9dee22daf655 Mon Sep 17 00:00:00 2001 From: shashwata Date: Mon, 1 Apr 2024 10:40:39 +0600 Subject: [PATCH 24/31] update packages --- tests/pw/package-lock.json | 200 ++++++++++++++++++++----------------- tests/pw/package.json | 6 +- 2 files changed, 110 insertions(+), 96 deletions(-) diff --git a/tests/pw/package-lock.json b/tests/pw/package-lock.json index 6450d8d417..7a82006ac4 100644 --- a/tests/pw/package-lock.json +++ b/tests/pw/package-lock.json @@ -18,12 +18,12 @@ "zod": "^3.22.4" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^7.3.1", - "@typescript-eslint/parser": "^7.3.1", + "@typescript-eslint/eslint-plugin": "^7.4.0", + "@typescript-eslint/parser": "^7.4.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-playwright": "^1.5.4", - "npm-check-updates": "^16.14.17", + "npm-check-updates": "^16.14.18", "prettier": "^3.2.5", "typescript": "^5.4.3" } @@ -626,17 +626,23 @@ "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, + "node_modules/@types/semver-utils": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@types/semver-utils/-/semver-utils-1.1.3.tgz", + "integrity": "sha512-T+YwkslhsM+CeuhYUxyAjWm7mJ5am/K10UX40RuA6k6Lc7eGtq8iY2xOzy7Vq0GOqhl/xZl5l2FwURZMTPTUww==", + "dev": true + }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.3.1.tgz", - "integrity": "sha512-STEDMVQGww5lhCuNXVSQfbfuNII5E08QWkvAw5Qwf+bj2WT+JkG1uc+5/vXA3AOYMDHVOSpL+9rcbEUiHIm2dw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.4.0.tgz", + "integrity": "sha512-yHMQ/oFaM7HZdVrVm/M2WHaNPgyuJH4WelkSVEWSSsir34kxW2kDJCxlXRhhGWEsMN0WAW/vLpKfKVcm8k+MPw==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "7.3.1", - "@typescript-eslint/type-utils": "7.3.1", - "@typescript-eslint/utils": "7.3.1", - "@typescript-eslint/visitor-keys": "7.3.1", + "@typescript-eslint/scope-manager": "7.4.0", + "@typescript-eslint/type-utils": "7.4.0", + "@typescript-eslint/utils": "7.4.0", + "@typescript-eslint/visitor-keys": "7.4.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -662,15 +668,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.3.1.tgz", - "integrity": "sha512-Rq49+pq7viTRCH48XAbTA+wdLRrB/3sRq4Lpk0oGDm0VmnjBrAOVXH/Laalmwsv2VpekiEfVFwJYVk6/e8uvQw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.4.0.tgz", + "integrity": "sha512-ZvKHxHLusweEUVwrGRXXUVzFgnWhigo4JurEj0dGF1tbcGh6buL+ejDdjxOQxv6ytcY1uhun1p2sm8iWStlgLQ==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "7.3.1", - "@typescript-eslint/types": "7.3.1", - "@typescript-eslint/typescript-estree": "7.3.1", - "@typescript-eslint/visitor-keys": "7.3.1", + "@typescript-eslint/scope-manager": "7.4.0", + "@typescript-eslint/types": "7.4.0", + "@typescript-eslint/typescript-estree": "7.4.0", + "@typescript-eslint/visitor-keys": "7.4.0", "debug": "^4.3.4" }, "engines": { @@ -690,13 +696,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.3.1.tgz", - "integrity": "sha512-fVS6fPxldsKY2nFvyT7IP78UO1/I2huG+AYu5AMjCT9wtl6JFiDnsv4uad4jQ0GTFzcUV5HShVeN96/17bTBag==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.4.0.tgz", + "integrity": "sha512-68VqENG5HK27ypafqLVs8qO+RkNc7TezCduYrx8YJpXq2QGZ30vmNZGJJJC48+MVn4G2dCV8m5ZTVnzRexTVtw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.3.1", - "@typescript-eslint/visitor-keys": "7.3.1" + "@typescript-eslint/types": "7.4.0", + "@typescript-eslint/visitor-keys": "7.4.0" }, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -707,13 +713,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.3.1.tgz", - "integrity": "sha512-iFhaysxFsMDQlzJn+vr3OrxN8NmdQkHks4WaqD4QBnt5hsq234wcYdyQ9uquzJJIDAj5W4wQne3yEsYA6OmXGw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.4.0.tgz", + "integrity": "sha512-247ETeHgr9WTRMqHbbQdzwzhuyaJ8dPTuyuUEMANqzMRB1rj/9qFIuIXK7l0FX9i9FXbHeBQl/4uz6mYuCE7Aw==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "7.3.1", - "@typescript-eslint/utils": "7.3.1", + "@typescript-eslint/typescript-estree": "7.4.0", + "@typescript-eslint/utils": "7.4.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -734,9 +740,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.3.1.tgz", - "integrity": "sha512-2tUf3uWggBDl4S4183nivWQ2HqceOZh1U4hhu4p1tPiIJoRRXrab7Y+Y0p+dozYwZVvLPRI6r5wKe9kToF9FIw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.4.0.tgz", + "integrity": "sha512-mjQopsbffzJskos5B4HmbsadSJQWaRK0UxqQ7GuNA9Ga4bEKeiO6b2DnB6cM6bpc8lemaPseh0H9B/wyg+J7rw==", "dev": true, "engines": { "node": "^18.18.0 || >=20.0.0" @@ -747,13 +753,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.3.1.tgz", - "integrity": "sha512-tLpuqM46LVkduWP7JO7yVoWshpJuJzxDOPYIVWUUZbW+4dBpgGeUdl/fQkhuV0A8eGnphYw3pp8d2EnvPOfxmQ==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.4.0.tgz", + "integrity": "sha512-A99j5AYoME/UBQ1ucEbbMEmGkN7SE0BvZFreSnTd1luq7yulcHdyGamZKizU7canpGDWGJ+Q6ZA9SyQobipePg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.3.1", - "@typescript-eslint/visitor-keys": "7.3.1", + "@typescript-eslint/types": "7.4.0", + "@typescript-eslint/visitor-keys": "7.4.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -799,17 +805,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.3.1.tgz", - "integrity": "sha512-jIERm/6bYQ9HkynYlNZvXpzmXWZGhMbrOvq3jJzOSOlKXsVjrrolzWBjDW6/TvT5Q3WqaN4EkmcfdQwi9tDjBQ==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.4.0.tgz", + "integrity": "sha512-NQt9QLM4Tt8qrlBVY9lkMYzfYtNz8/6qwZg8pI3cMGlPnj6mOpRxxAm7BMJN9K0AiY+1BwJ5lVC650YJqYOuNg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "7.3.1", - "@typescript-eslint/types": "7.3.1", - "@typescript-eslint/typescript-estree": "7.3.1", + "@typescript-eslint/scope-manager": "7.4.0", + "@typescript-eslint/types": "7.4.0", + "@typescript-eslint/typescript-estree": "7.4.0", "semver": "^7.5.4" }, "engines": { @@ -824,12 +830,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.3.1.tgz", - "integrity": "sha512-9RMXwQF8knsZvfv9tdi+4D/j7dMG28X/wMJ8Jj6eOHyHWwDW4ngQJcqEczSsqIKKjFiLFr40Mnr7a5ulDD3vmw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.4.0.tgz", + "integrity": "sha512-0zkC7YM0iX5Y41homUUeW1CHtZR01K3ybjM1l6QczoMuay0XKtrb93kv95AxUGwdjGr64nNqnOCwmEl616N8CA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/types": "7.4.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -3610,11 +3616,12 @@ } }, "node_modules/npm-check-updates": { - "version": "16.14.17", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.14.17.tgz", - "integrity": "sha512-ElnDdXKe60f8S6RhzFeaGuH2TFJmt2cU2HjLdowldabdm27nWFCxV2ebeP3xGbQkzp2+RPDQNdW9HqU1lcY8ag==", + "version": "16.14.18", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.14.18.tgz", + "integrity": "sha512-9iaRe9ohx9ykdbLjPRIYcq1A0RkrPYUx9HmQK1JIXhfxtJCNE/+497H9Z4PGH6GWRALbz5KF+1iZoySK2uSEpQ==", "dev": true, "dependencies": { + "@types/semver-utils": "^1.1.1", "chalk": "^5.3.0", "cli-table3": "^0.6.3", "commander": "^10.0.1", @@ -6223,17 +6230,23 @@ "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", "dev": true }, + "@types/semver-utils": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@types/semver-utils/-/semver-utils-1.1.3.tgz", + "integrity": "sha512-T+YwkslhsM+CeuhYUxyAjWm7mJ5am/K10UX40RuA6k6Lc7eGtq8iY2xOzy7Vq0GOqhl/xZl5l2FwURZMTPTUww==", + "dev": true + }, "@typescript-eslint/eslint-plugin": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.3.1.tgz", - "integrity": "sha512-STEDMVQGww5lhCuNXVSQfbfuNII5E08QWkvAw5Qwf+bj2WT+JkG1uc+5/vXA3AOYMDHVOSpL+9rcbEUiHIm2dw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.4.0.tgz", + "integrity": "sha512-yHMQ/oFaM7HZdVrVm/M2WHaNPgyuJH4WelkSVEWSSsir34kxW2kDJCxlXRhhGWEsMN0WAW/vLpKfKVcm8k+MPw==", "dev": true, "requires": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "7.3.1", - "@typescript-eslint/type-utils": "7.3.1", - "@typescript-eslint/utils": "7.3.1", - "@typescript-eslint/visitor-keys": "7.3.1", + "@typescript-eslint/scope-manager": "7.4.0", + "@typescript-eslint/type-utils": "7.4.0", + "@typescript-eslint/utils": "7.4.0", + "@typescript-eslint/visitor-keys": "7.4.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -6243,54 +6256,54 @@ } }, "@typescript-eslint/parser": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.3.1.tgz", - "integrity": "sha512-Rq49+pq7viTRCH48XAbTA+wdLRrB/3sRq4Lpk0oGDm0VmnjBrAOVXH/Laalmwsv2VpekiEfVFwJYVk6/e8uvQw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.4.0.tgz", + "integrity": "sha512-ZvKHxHLusweEUVwrGRXXUVzFgnWhigo4JurEj0dGF1tbcGh6buL+ejDdjxOQxv6ytcY1uhun1p2sm8iWStlgLQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "7.3.1", - "@typescript-eslint/types": "7.3.1", - "@typescript-eslint/typescript-estree": "7.3.1", - "@typescript-eslint/visitor-keys": "7.3.1", + "@typescript-eslint/scope-manager": "7.4.0", + "@typescript-eslint/types": "7.4.0", + "@typescript-eslint/typescript-estree": "7.4.0", + "@typescript-eslint/visitor-keys": "7.4.0", "debug": "^4.3.4" } }, "@typescript-eslint/scope-manager": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.3.1.tgz", - "integrity": "sha512-fVS6fPxldsKY2nFvyT7IP78UO1/I2huG+AYu5AMjCT9wtl6JFiDnsv4uad4jQ0GTFzcUV5HShVeN96/17bTBag==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.4.0.tgz", + "integrity": "sha512-68VqENG5HK27ypafqLVs8qO+RkNc7TezCduYrx8YJpXq2QGZ30vmNZGJJJC48+MVn4G2dCV8m5ZTVnzRexTVtw==", "dev": true, "requires": { - "@typescript-eslint/types": "7.3.1", - "@typescript-eslint/visitor-keys": "7.3.1" + "@typescript-eslint/types": "7.4.0", + "@typescript-eslint/visitor-keys": "7.4.0" } }, "@typescript-eslint/type-utils": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.3.1.tgz", - "integrity": "sha512-iFhaysxFsMDQlzJn+vr3OrxN8NmdQkHks4WaqD4QBnt5hsq234wcYdyQ9uquzJJIDAj5W4wQne3yEsYA6OmXGw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.4.0.tgz", + "integrity": "sha512-247ETeHgr9WTRMqHbbQdzwzhuyaJ8dPTuyuUEMANqzMRB1rj/9qFIuIXK7l0FX9i9FXbHeBQl/4uz6mYuCE7Aw==", "dev": true, "requires": { - "@typescript-eslint/typescript-estree": "7.3.1", - "@typescript-eslint/utils": "7.3.1", + "@typescript-eslint/typescript-estree": "7.4.0", + "@typescript-eslint/utils": "7.4.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" } }, "@typescript-eslint/types": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.3.1.tgz", - "integrity": "sha512-2tUf3uWggBDl4S4183nivWQ2HqceOZh1U4hhu4p1tPiIJoRRXrab7Y+Y0p+dozYwZVvLPRI6r5wKe9kToF9FIw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.4.0.tgz", + "integrity": "sha512-mjQopsbffzJskos5B4HmbsadSJQWaRK0UxqQ7GuNA9Ga4bEKeiO6b2DnB6cM6bpc8lemaPseh0H9B/wyg+J7rw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.3.1.tgz", - "integrity": "sha512-tLpuqM46LVkduWP7JO7yVoWshpJuJzxDOPYIVWUUZbW+4dBpgGeUdl/fQkhuV0A8eGnphYw3pp8d2EnvPOfxmQ==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.4.0.tgz", + "integrity": "sha512-A99j5AYoME/UBQ1ucEbbMEmGkN7SE0BvZFreSnTd1luq7yulcHdyGamZKizU7canpGDWGJ+Q6ZA9SyQobipePg==", "dev": true, "requires": { - "@typescript-eslint/types": "7.3.1", - "@typescript-eslint/visitor-keys": "7.3.1", + "@typescript-eslint/types": "7.4.0", + "@typescript-eslint/visitor-keys": "7.4.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -6320,27 +6333,27 @@ } }, "@typescript-eslint/utils": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.3.1.tgz", - "integrity": "sha512-jIERm/6bYQ9HkynYlNZvXpzmXWZGhMbrOvq3jJzOSOlKXsVjrrolzWBjDW6/TvT5Q3WqaN4EkmcfdQwi9tDjBQ==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.4.0.tgz", + "integrity": "sha512-NQt9QLM4Tt8qrlBVY9lkMYzfYtNz8/6qwZg8pI3cMGlPnj6mOpRxxAm7BMJN9K0AiY+1BwJ5lVC650YJqYOuNg==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "7.3.1", - "@typescript-eslint/types": "7.3.1", - "@typescript-eslint/typescript-estree": "7.3.1", + "@typescript-eslint/scope-manager": "7.4.0", + "@typescript-eslint/types": "7.4.0", + "@typescript-eslint/typescript-estree": "7.4.0", "semver": "^7.5.4" } }, "@typescript-eslint/visitor-keys": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.3.1.tgz", - "integrity": "sha512-9RMXwQF8knsZvfv9tdi+4D/j7dMG28X/wMJ8Jj6eOHyHWwDW4ngQJcqEczSsqIKKjFiLFr40Mnr7a5ulDD3vmw==", + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.4.0.tgz", + "integrity": "sha512-0zkC7YM0iX5Y41homUUeW1CHtZR01K3ybjM1l6QczoMuay0XKtrb93kv95AxUGwdjGr64nNqnOCwmEl616N8CA==", "dev": true, "requires": { - "@typescript-eslint/types": "7.3.1", + "@typescript-eslint/types": "7.4.0", "eslint-visitor-keys": "^3.4.1" } }, @@ -8422,11 +8435,12 @@ } }, "npm-check-updates": { - "version": "16.14.17", - "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.14.17.tgz", - "integrity": "sha512-ElnDdXKe60f8S6RhzFeaGuH2TFJmt2cU2HjLdowldabdm27nWFCxV2ebeP3xGbQkzp2+RPDQNdW9HqU1lcY8ag==", + "version": "16.14.18", + "resolved": "https://registry.npmjs.org/npm-check-updates/-/npm-check-updates-16.14.18.tgz", + "integrity": "sha512-9iaRe9ohx9ykdbLjPRIYcq1A0RkrPYUx9HmQK1JIXhfxtJCNE/+497H9Z4PGH6GWRALbz5KF+1iZoySK2uSEpQ==", "dev": true, "requires": { + "@types/semver-utils": "^1.1.1", "chalk": "^5.3.0", "cli-table3": "^0.6.3", "commander": "^10.0.1", diff --git a/tests/pw/package.json b/tests/pw/package.json index 301a023f9c..b2df5ef0e2 100644 --- a/tests/pw/package.json +++ b/tests/pw/package.json @@ -51,12 +51,12 @@ "author": "", "license": "ISC", "devDependencies": { - "@typescript-eslint/eslint-plugin": "^7.3.1", - "@typescript-eslint/parser": "^7.3.1", + "@typescript-eslint/eslint-plugin": "^7.4.0", + "@typescript-eslint/parser": "^7.4.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", "eslint-plugin-playwright": "^1.5.4", - "npm-check-updates": "^16.14.17", + "npm-check-updates": "^16.14.18", "prettier": "^3.2.5", "typescript": "^5.4.3" }, From 03a049c26e54140cc410385ad6204b0540587f38 Mon Sep 17 00:00:00 2001 From: shashwata Date: Mon, 1 Apr 2024 11:11:03 +0600 Subject: [PATCH 25/31] fix: db port grab issue --- .github/workflows/e2e_api_tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index 00aef3d363..caff3b79c8 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -115,7 +115,7 @@ jobs: if: success() run: | cd tests/pw - echo "DB_PORT=$(docker ps -f ancestor='mariadb' -f name='tests-mysql' --format='{{.Ports}}' | sed -E 's/.*:(.*)->.*/\1/')" >> $GITHUB_ENV + echo "DB_PORT=$(docker ps -f ancestor='mariadb:lts' -f name='tests-mysql' --format='{{.Ports}}' | sed -E 's/.*:(.*)->.*/\1/')" >> $GITHUB_ENV # db port - name: DB PORT @@ -161,14 +161,14 @@ jobs: # Install browser binaries & OS dependencies if cache missed - name: Install Playwright browser binaries & OS dependencies id: pw-install - if: success() && steps.playwright-cache.outputs.cache-hit != 'true' + if: ${{ success() && steps.playwright-cache.outputs.cache-hit != 'true' }} run: | cd tests/pw npm run pw:browser-with-deps # # Install only the OS dependencies if cache hit not needed # - name: Install Playwright OS dependencies - # if: steps.playwright-cache.outputs.cache-hit == 'true' + # if: ${{ steps.playwright-cache.outputs.cache-hit == 'true' }} # run: | # cd tests/pw # npm run pw:deps-only @@ -193,7 +193,7 @@ jobs: # Run API tests - name: 🧪 Running the api tests id: api-test - if: ${{ steps.db-port.outcome == 'success' }} || ${{ (steps.db-port.outcome == 'success' && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) }} + if: ${{ always() && steps.db-port.outcome == 'success' }} || ${{ ( always() && steps.db-port.outcome == 'success' && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) }} timeout-minutes: 5 run: | cd tests/pw From 5457b09fe146e3b82ed82a49c9fdd1892c72ff63 Mon Sep 17 00:00:00 2001 From: shashwata Date: Mon, 1 Apr 2024 13:11:05 +0600 Subject: [PATCH 26/31] update yml --- .github/workflows/e2e_api_tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index caff3b79c8..9a9b43728c 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -184,7 +184,7 @@ jobs: # Run e2e tests - name: 🧪 Running the e2e tests id: e2e-test - if: success() || ${{ ( success() && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'E2E' || github.event.inputs.testsuite == 'All'))) }} + if: success() && (github.event_name != 'workflow_dispatch' || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'E2E' || github.event.inputs.testsuite == 'All'))) timeout-minutes: 40 run: | cd tests/pw @@ -193,7 +193,7 @@ jobs: # Run API tests - name: 🧪 Running the api tests id: api-test - if: ${{ always() && steps.db-port.outcome == 'success' }} || ${{ ( always() && steps.db-port.outcome == 'success' && (github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) }} + if: steps.db-port.outcome == 'success' && ( github.event_name != 'workflow_dispatch' || ( github.event_name == 'workflow_dispatch' && (github.event.inputs.testsuite == 'API' || github.event.inputs.testsuite == 'All'))) timeout-minutes: 5 run: | cd tests/pw From 07f3da5c43f44c51c4f3796abd26d9db2b5e04b1 Mon Sep 17 00:00:00 2001 From: shashwata Date: Mon, 1 Apr 2024 14:07:21 +0600 Subject: [PATCH 27/31] update: api env setup --- .github/workflows/e2e_api_tests.yml | 18 ++---------------- tests/pw/tests/api/_env.setup.ts | 2 +- tests/pw/utils/gitTestSummary.ts | 6 +++--- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/.github/workflows/e2e_api_tests.yml b/.github/workflows/e2e_api_tests.yml index 9a9b43728c..51a50c3806 100644 --- a/.github/workflows/e2e_api_tests.yml +++ b/.github/workflows/e2e_api_tests.yml @@ -161,26 +161,18 @@ jobs: # Install browser binaries & OS dependencies if cache missed - name: Install Playwright browser binaries & OS dependencies id: pw-install - if: ${{ success() && steps.playwright-cache.outputs.cache-hit != 'true' }} + if: success() && steps.playwright-cache.outputs.cache-hit != 'true' run: | cd tests/pw npm run pw:browser-with-deps # # Install only the OS dependencies if cache hit not needed # - name: Install Playwright OS dependencies - # if: ${{ steps.playwright-cache.outputs.cache-hit == 'true' }} + # if: steps.playwright-cache.outputs.cache-hit == 'true' # run: | # cd tests/pw # npm run pw:deps-only - - name: log 1 - if: always() - run: | - echo "wp-env outcome: " ${{ steps.wp-env.outcome }} - echo "db-port outcome: " ${{ steps.db-port.outcome }} - echo "playwright-version outcome: " ${{ steps.playwright-version.outcome }} - echo "pw-install outcome: " ${{ steps.pw-install.outcome }} - # Run e2e tests - name: 🧪 Running the e2e tests id: e2e-test @@ -199,12 +191,6 @@ jobs: cd tests/pw npm run test:api:lite - - name: log 2 - if: always() - run: | - echo "E2E test outcome: " ${{ steps.e2e-test.outcome }} - echo "API test outcome: " ${{ steps.api-test.outcome }} - # Prepare test summary - name: Prepare test summary id: prepare-test-summary diff --git a/tests/pw/tests/api/_env.setup.ts b/tests/pw/tests/api/_env.setup.ts index efea882de7..e0e8d61d0d 100644 --- a/tests/pw/tests/api/_env.setup.ts +++ b/tests/pw/tests/api/_env.setup.ts @@ -185,7 +185,7 @@ setup.describe('setup dokan settings', () => { }); }); -setup.describe.skip('setup dokan settings e2e', () => { +setup.describe('setup dokan settings e2e', () => { let productAdvertisingPage: ProductAdvertisingPage; let reverseWithdrawsPage: ReverseWithdrawsPage; let aPage: Page; diff --git a/tests/pw/utils/gitTestSummary.ts b/tests/pw/utils/gitTestSummary.ts index fffcd8391e..a9df0304ee 100644 --- a/tests/pw/utils/gitTestSummary.ts +++ b/tests/pw/utils/gitTestSummary.ts @@ -16,7 +16,7 @@ const getTestResult = (suiteName, filePath) => { const getCoverageReport = filePath => { const coverageReport = readFile(filePath); if (!coverageReport) { - return []; + return; } return String(coverageReport.coverage); }; @@ -34,8 +34,8 @@ const addSummaryHeadingAndTable = core => { ]; const apiTestResult = getTestResult('API Tests', API_TEST_RESULT); const e2eTestResult = getTestResult('E2E Tests', E2E_TEST_RESULT); - apiTestResult && apiTestResult.push(getCoverageReport(API_COVERAGE)); - e2eTestResult && e2eTestResult.push('-'); + apiTestResult && apiTestResult?.push(getCoverageReport(API_COVERAGE)); + e2eTestResult && e2eTestResult?.push('-'); const commit_sha = SHA ? `Commit SHA: ${SHA}` : ''; if (apiTestResult || e2eTestResult) { core.summary.addHeading('Tests Summary').addRaw(commit_sha).addBreak().addBreak().addTable([tableHeader, apiTestResult, e2eTestResult]); From 3143539b0992337e1b6d4cd488cbc517fd94d1b2 Mon Sep 17 00:00:00 2001 From: shashwata Date: Mon, 1 Apr 2024 14:16:42 +0600 Subject: [PATCH 28/31] fix: storage state issue --- tests/pw/tests/api/_env.setup.ts | 7 +++++-- tests/pw/utils/gitTestSummary.ts | 10 ++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/tests/pw/tests/api/_env.setup.ts b/tests/pw/tests/api/_env.setup.ts index e0e8d61d0d..ea52913ae5 100644 --- a/tests/pw/tests/api/_env.setup.ts +++ b/tests/pw/tests/api/_env.setup.ts @@ -185,13 +185,16 @@ setup.describe('setup dokan settings', () => { }); }); -setup.describe('setup dokan settings e2e', () => { +setup.describe.skip('setup dokan settings e2e', () => { let productAdvertisingPage: ProductAdvertisingPage; let reverseWithdrawsPage: ReverseWithdrawsPage; let aPage: Page; let apiUtils: ApiUtils; - setup.beforeAll(async ({ browser }) => { + setup.beforeAll(async ({ browser, page }) => { + const loginPage = new LoginPage(page); + await loginPage.adminLogin(data.admin, data.auth.adminAuthFile); + const adminContext = await browser.newContext(data.auth.adminAuth); aPage = await adminContext.newPage(); productAdvertisingPage = new ProductAdvertisingPage(aPage); diff --git a/tests/pw/utils/gitTestSummary.ts b/tests/pw/utils/gitTestSummary.ts index a9df0304ee..2cb225cccc 100644 --- a/tests/pw/utils/gitTestSummary.ts +++ b/tests/pw/utils/gitTestSummary.ts @@ -3,13 +3,13 @@ const { SHA, PR_NUMBER, SYSTEM_INFO, API_TEST_RESULT, E2E_TEST_RESULT, API_COVER const replace = obj => Object.keys(obj).forEach(key => (typeof obj[key] == 'object' ? replace(obj[key]) : (obj[key] = String(obj[key])))); const readFile = filePath => (fs.existsSync(filePath) ? JSON.parse(fs.readFileSync(filePath, 'utf8')) : false); -const getTestResult = (suiteName, filePath) => { +const getTestResult = (suiteName, filePath, coverage) => { const testResult = readFile(filePath); if (!testResult) { return []; } replace(testResult); - const testSummary = [suiteName, testResult.total_tests, testResult.passed, testResult.failed, testResult.flaky, testResult.skipped, testResult.suite_duration_formatted]; + const testSummary = [suiteName, testResult.total_tests, testResult.passed, testResult.failed, testResult.flaky, testResult.skipped, testResult.suite_duration_formatted, coverage]; return testSummary; }; @@ -32,10 +32,8 @@ const addSummaryHeadingAndTable = core => { { data: 'Duration :alarm_clock:', header: true }, { data: 'Coverage :checkered_flag:', header: true }, ]; - const apiTestResult = getTestResult('API Tests', API_TEST_RESULT); - const e2eTestResult = getTestResult('E2E Tests', E2E_TEST_RESULT); - apiTestResult && apiTestResult?.push(getCoverageReport(API_COVERAGE)); - e2eTestResult && e2eTestResult?.push('-'); + const apiTestResult = getTestResult('API Tests', API_TEST_RESULT, getCoverageReport(API_COVERAGE)); + const e2eTestResult = getTestResult('E2E Tests', E2E_TEST_RESULT, '-'); const commit_sha = SHA ? `Commit SHA: ${SHA}` : ''; if (apiTestResult || e2eTestResult) { core.summary.addHeading('Tests Summary').addRaw(commit_sha).addBreak().addBreak().addTable([tableHeader, apiTestResult, e2eTestResult]); From 2f4e5c5e3f0ef2f3c3be4c7074b720388a15c16b Mon Sep 17 00:00:00 2001 From: shashwata Date: Mon, 1 Apr 2024 14:24:24 +0600 Subject: [PATCH 29/31] fix: api env issue --- tests/pw/tests/api/_env.setup.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/pw/tests/api/_env.setup.ts b/tests/pw/tests/api/_env.setup.ts index ea52913ae5..f06a65eaf4 100644 --- a/tests/pw/tests/api/_env.setup.ts +++ b/tests/pw/tests/api/_env.setup.ts @@ -185,7 +185,7 @@ setup.describe('setup dokan settings', () => { }); }); -setup.describe.skip('setup dokan settings e2e', () => { +setup.describe('setup dokan settings e2e', () => { let productAdvertisingPage: ProductAdvertisingPage; let reverseWithdrawsPage: ReverseWithdrawsPage; let aPage: Page; @@ -194,7 +194,7 @@ setup.describe.skip('setup dokan settings e2e', () => { setup.beforeAll(async ({ browser, page }) => { const loginPage = new LoginPage(page); await loginPage.adminLogin(data.admin, data.auth.adminAuthFile); - + const adminContext = await browser.newContext(data.auth.adminAuth); aPage = await adminContext.newPage(); productAdvertisingPage = new ProductAdvertisingPage(aPage); From 1988ca256dc7c1cdd529f7aba2276306ace93b9c Mon Sep 17 00:00:00 2001 From: shashwata Date: Mon, 1 Apr 2024 14:33:56 +0600 Subject: [PATCH 30/31] fix: env issue --- tests/pw/tests/api/_env.setup.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/pw/tests/api/_env.setup.ts b/tests/pw/tests/api/_env.setup.ts index f06a65eaf4..efea882de7 100644 --- a/tests/pw/tests/api/_env.setup.ts +++ b/tests/pw/tests/api/_env.setup.ts @@ -185,16 +185,13 @@ setup.describe('setup dokan settings', () => { }); }); -setup.describe('setup dokan settings e2e', () => { +setup.describe.skip('setup dokan settings e2e', () => { let productAdvertisingPage: ProductAdvertisingPage; let reverseWithdrawsPage: ReverseWithdrawsPage; let aPage: Page; let apiUtils: ApiUtils; - setup.beforeAll(async ({ browser, page }) => { - const loginPage = new LoginPage(page); - await loginPage.adminLogin(data.admin, data.auth.adminAuthFile); - + setup.beforeAll(async ({ browser }) => { const adminContext = await browser.newContext(data.auth.adminAuth); aPage = await adminContext.newPage(); productAdvertisingPage = new ProductAdvertisingPage(aPage); From df78ac1773152c89ff5f3968ea595c5c2e9830de Mon Sep 17 00:00:00 2001 From: shashwata Date: Tue, 2 Apr 2024 12:56:32 +0600 Subject: [PATCH 31/31] update: update locators --- tests/pw/pages/selectors.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/pw/pages/selectors.ts b/tests/pw/pages/selectors.ts index 74347f5c45..0fd04dcdfe 100644 --- a/tests/pw/pages/selectors.ts +++ b/tests/pw/pages/selectors.ts @@ -1,5 +1,4 @@ import { helpers } from '@utils/helpers'; -import { string } from 'zod'; export const selector = { // Login @@ -1176,8 +1175,8 @@ export const selector = { contentIframe: '#postdivrich iframe', contentHtmlBody: '#tinymce', sendAnnouncementTo: '#announcement_sender_type', // all_seller, selected_seller, enabled_seller, disabled_seller, featured_seller - saveAsDraft: '.draft-btn', - publish: '.publish-btn', + saveAsDraft: 'input.draft-btn', + publish: 'input.publish-btn', schedule: { addSchedule: 'span#timestamp a',