diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 0e1d28804..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,73 +0,0 @@ -version: 2 -jobs: - build-lint-benchmark: - docker: - - image: circleci/node:14.4.0-browsers - steps: - - checkout - - restore_cache: - keys: - - cache-{{ .Branch }}-{{ checksum "package.json" }} - - run: - name: Install system dependencies - command: sudo apt-get install -y libpng-dev - - run: - name: Install dependencies - command: npm install - - save_cache: - key: cache-{{ .Branch }}-{{ checksum "package.json" }} - paths: - - ~/.npm - - ~/.cache - - run: - name: Build application - command: npm run build - - run: - name: Install Lighthouse tools - command: sudo npm install -g @lhci/cli - - run: - name: Lighthouse audit - command: npx lhci autorun --upload.target=temporary-public-storage - - cypress: - docker: - - image: cypress/base:10 - environment: - TERM: xterm - parallelism: 1 - steps: - - checkout - - restore_cache: - keys: - - cache-{{ .Branch }}-{{ checksum "package.json" }} - - run: - name: Npm CI - command: npm ci - - run: - command: npx cypress verify - - save_cache: - key: cache-{{ .Branch }}-{{ checksum "package.json" }} - paths: - - ~/.npm - - ~/.cache - - persist_to_workspace: - root: ~/ - paths: - - project - - .cache/Cypress - - attach_workspace: - at: ~/ - - run: - name: Running E2E tests - command: npm run test:e2e:run - - store_artifacts: - path: cypress/videos - - store_artifacts: - path: cypress/screenshots - -workflows: - version: 2 - qa: - jobs: - - build-lint-benchmark: - context: Lighthouse diff --git a/.github/workflows/test-env-deploy.yml b/.github/workflows/test-env-deploy.yml index 5b21d2a1a..008dc43e8 100644 --- a/.github/workflows/test-env-deploy.yml +++ b/.github/workflows/test-env-deploy.yml @@ -173,9 +173,7 @@ jobs: CYPRESS_PERMISSIONS_USERS_PASSWORD: ${{ secrets.CYPRESS_PERMISSIONS_USERS_PASSWORD }} CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} COMMIT_INFO_MESSAGE: Critical tests triggered on PR - ${{ github.ref_name }} + CYPRESS_grepTags: '@critical' with: - command: npx cypress run --record --env tags=critical --spec cypress/e2e/navigation.js,cypress/e2e/products/createProduct.js,cypress/e2e/products/productsVariants.js --tag Critical, PR_Deploy - - uses: actions/upload-artifact@v1 - with: - name: cypress-videos - path: cypress/videos + record: true + tag: Critical, ${{github.event.action}} diff --git a/.github/workflows/tests-nightly.yml b/.github/workflows/tests-nightly.yml index 579cb1801..abe22eac4 100644 --- a/.github/workflows/tests-nightly.yml +++ b/.github/workflows/tests-nightly.yml @@ -3,14 +3,15 @@ name: Execute nightly tests on: workflow_dispatch: inputs: - tests: + tags: required: true description: 'Select tests to run' - default: 'All' + default: '@allEnv' type: choice options: - - 'All' - - 'Critical' + - '@allEnv' + - '@critical' + - '@stable' environment: required: true description: 'Environment to run tests against' @@ -87,7 +88,7 @@ jobs: run-tests-in-parallel: needs: revert-automation-env-to-snap - if: always() #Wait for revert-automation-env-to-snap, bot run always, even if skipped + if: ${{ always() && github.event_name != 'repository_dispatch' }} #Wait for revert-automation-env-to-snap, bot run always, even if skipped runs-on: ubuntu-latest container: cypress/browsers:node14.16.0-chrome89-ff86 strategy: @@ -131,33 +132,16 @@ jobs: CYPRESS_PERMISSIONS_USERS_PASSWORD: ${{ secrets.CYPRESS_PERMISSIONS_USERS_PASSWORD }} CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COMMIT_INFO_MESSAGE: All tests triggered via ${{github.event_name}} on ${{ steps.get-env-uri.outputs.ENV_URI }} + COMMIT_INFO_MESSAGE: All tests triggered via ${{ github.event_name}} on ${{ steps.get-env-uri.outputs.ENV_URI }} + CYPRESS_grepTags: ${{ github.event.inputs.tags }} with: parallel: true group: 'UI - Chrome' - command: npx cypress run --record --env tags=all --parallel --tag ${{ steps.get-env-uri.outputs.ENV_URI }}, All_Tests - - - name: Cypress run - Critical - if: ${{ github.event.inputs.tests == 'Critical' && github.event_name != 'repository_dispatch'}} - uses: cypress-io/github-action@v4 - env: - API_URI: ${{ steps.get-env-uri.outputs.ENV_URI }}graphql/ - APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }} - CYPRESS_baseUrl: ${{ steps.get-env-uri.outputs.ENV_URI }}dashboard/ - CYPRESS_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }} - CYPRESS_SECOND_USER_NAME: ${{ secrets.CYPRESS_SECOND_USER_NAME }} - CYPRESS_USER_PASSWORD: ${{ secrets.CYPRESS_USER_PASSWORD }} - CYPRESS_PERMISSIONS_USERS_PASSWORD: ${{ secrets.CYPRESS_PERMISSIONS_USERS_PASSWORD }} - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - COMMIT_INFO_MESSAGE: Critical tests triggered via ${{github.event_name}} on ${{ steps.get-env-uri.outputs.ENV_URI }} - with: - parallel: true - group: 'UI - Chrome' - command: npx cypress run --record --env tags=critical --spec cypress/e2e/navigation.js,cypress/e2e/products/createProduct.js,cypress/e2e/products/productsVariants.js --parallel --tag ${{ steps.get-env-uri.outputs.ENV_URI }}, Critical + record: true + tag: ${{ steps.get-env-uri.outputs.ENV_URI }},${{ github.event.inputs.tags }} run-tests-on-release: - if: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.project != 'PROD' && github.event.client_payload.project != 'ENTERPRISE'}} + if: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.environment != 'PROD' && github.event.client_payload.environment != 'ENTERPRISE'}} runs-on: ubuntu-latest container: cypress/browsers:node14.16.0-chrome89-ff86 strategy: @@ -173,32 +157,14 @@ jobs: id: version env: version: ${{github.event.client_payload.version}} - pattern: \\. run: | - echo "::set-output name=version::$(echo $version | sed s/$pattern// | head -n 1 )" - - - name: Get formatted version - demo - if: ${{ github.event.client_payload.project == 'DEMO' }} - id: version-demo - env: - version: ${{github.event.client_payload.version}} - pattern: demo- - run: | - echo "::set-output name=version::$(echo $version | sed s/$pattern// | head -n 1 )" - - - name: Get domain - id: domain - env: - correct-version: ${{ steps.version-demo.outputs.version-demo || steps.version.outputs.version }} - run: | - echo "::set-output name=version::$(echo https://v${{ steps.version-demo.outputs.version-demo }}.staging.saleor.cloud/ | head -n 1 )" - + echo "::set-output name=formatted_version::$(echo $version | grep -Eo "\d\.\d" | sed s/\\.// | head -n 1 )" - name: Cypress run - automatically uses: cypress-io/github-action@v4 env: - API_URI: ${{ steps.domain.outputs.domain }}graphql/ + API_URI: https://v${{ steps.version.outputs.formatted_version }}.staging.saleor.cloud/graphql/ APP_MOUNT_URI: ${{ secrets.APP_MOUNT_URI }} - CYPRESS_baseUrl: ${{ steps.domain.outputs.domain }}dashboard/ + CYPRESS_baseUrl: https://v${{ steps.version.outputs.formatted_version }}.staging.saleor.cloud/dashboard/ CYPRESS_USER_NAME: ${{ secrets.CYPRESS_USER_NAME }} CYPRESS_SECOND_USER_NAME: ${{ secrets.CYPRESS_SECOND_USER_NAME }} CYPRESS_USER_PASSWORD: ${{ secrets.CYPRESS_USER_PASSWORD }} @@ -206,7 +172,9 @@ jobs: CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} COMMIT_INFO_MESSAGE: Critical triggered via release - ${{github.event.client_payload.project}} ${{github.event.client_payload.version}}, ${{github.event.client_payload.pullRequestUrl}} + CYPRESS_grepTags: ${{ github.event.inputs.tags }} with: parallel: true group: 'UI - Chrome' - command: npx cypress run --record --env tags=critical --spec cypress/e2e/navigation.js,cypress/e2e/products/createProduct.js,cypress/e2e/products/productsVariants.js --parallel --tag ${{github.event.client_payload.environment}}, Critical + record: true + tag: ${{github.event.client_payload.project}}, ${{github.event.client_payload.environment}}, Critical, https://v${{ steps.version.outputs.formatted_version }}.staging.saleor.cloud \ No newline at end of file diff --git a/cypress.config.js b/cypress.config.js index 6b5af67f9..6c6fe2608 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -5,15 +5,18 @@ module.exports = defineConfig({ projectId: "51ef7c", chromeWebSecurity: false, videoUploadOnPasses: false, - defaultCommandTimeout: 15000, - requestTimeout: 15000, + defaultCommandTimeout: 20000, + requestTimeout: 20000, viewportWidth: 1400, viewportHeight: 660, e2e: { - // We've imported your old cypress plugins here. - // You may want to clean this up later by importing these. + env: { + grepFilterSpecs: true + }, setupNodeEvents(on, config) { - return require("./cypress/plugins/index.js")(on, config); + config = require("./cypress/support/cypress-grep/plugin")(config); + config = require("./cypress/plugins/index.js")(on, config); + return config; }, baseUrl: "http://localhost:9000/", specPattern: "cypress/e2e/**/*.{js,jsx,ts,tsx}" diff --git a/cypress/e2e/apps.js b/cypress/e2e/apps.js index a1896c311..e625468e6 100644 --- a/cypress/e2e/apps.js +++ b/cypress/e2e/apps.js @@ -11,31 +11,29 @@ import { appDetailsUrl, urlList } from "../fixtures/urlList"; import { ONE_PERMISSION_USERS } from "../fixtures/users"; import { createApp, getApp } from "../support/api/requests/Apps"; import { deleteAppsStartsWith } from "../support/api/utils/appUtils"; -import filterTests from "../support/filterTests"; -filterTests({ definedTags: ["all"] }, () => { - describe("Tests for apps", () => { - const startsWith = "Apps"; - const name = `${startsWith}${faker.datatype.number()}`; +describe("Tests for apps", () => { + const startsWith = "Apps"; + const name = `${startsWith}${faker.datatype.number()}`; - let createdApp; + let createdApp; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteAppsStartsWith(startsWith); - createApp(name, "MANAGE_APPS").then(app => { - createdApp = app; - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteAppsStartsWith(startsWith); + createApp(name, "MANAGE_APPS").then(app => { + createdApp = app; }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest( - "auth", - ONE_PERMISSION_USERS.app - ); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest("auth", ONE_PERMISSION_USERS.app); + }); - it("should create app", () => { + it( + "should create app. TC: SALEOR_3001", + { tags: ["@app", "@allEnv", "@stable"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; cy.visit(urlList.apps) @@ -59,9 +57,13 @@ filterTests({ definedTags: ["all"] }, () => { const token = app.tokens.find(element => element.name === "Default"); expect(token).to.be.ok; }); - }); + } + ); - it("should create webhook", () => { + it( + "should create webhook. TC: SALEOR_3002", + { tags: ["@app", "@allEnv", "@stable"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; const targetUrl = `http://example.${randomName}`; @@ -79,9 +81,13 @@ filterTests({ definedTags: ["all"] }, () => { expect(webhooks[0].name).to.eq(randomName); expect(webhooks[0].targetUrl).to.eq(targetUrl); }); - }); + } + ); - it("should create token", () => { + it( + "should create token. TC: SALEOR_3003", + { tags: ["@app", "@allEnv", "@stable"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; let expectedToken; @@ -107,6 +113,6 @@ filterTests({ definedTags: ["all"] }, () => { ); expect(token.authToken).to.eq(tokenLastFourDigits); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/catalog/categories.js b/cypress/e2e/catalog/categories.js index d1181b2cd..e37ef2b16 100644 --- a/cypress/e2e/catalog/categories.js +++ b/cypress/e2e/catalog/categories.js @@ -19,63 +19,64 @@ import { deleteCategoriesStartsWith } from "../../support/api/utils/catalog/cate import * as channelsUtils from "../../support/api/utils/channelsUtils"; import * as productsUtils from "../../support/api/utils/products/productsUtils"; import { deleteShippingStartsWith } from "../../support/api/utils/shippingUtils"; -import filterTests from "../../support/filterTests"; import { createCategory, updateCategory } from "../../support/pages/catalog/categoriesPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("As an admin I want to manage categories", () => { - const startsWith = "CyCategories"; - const name = `${startsWith}${faker.datatype.number()}`; +describe("As an admin I want to manage categories", () => { + const startsWith = "CyCategories"; + const name = `${startsWith}${faker.datatype.number()}`; - let attribute; - let category; - let productType; - let product; + let attribute; + let category; + let productType; + let product; - let defaultChannel; + let defaultChannel; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - productsUtils.deleteProductsStartsWith(startsWith); - deleteCategoriesStartsWith(startsWith); - deleteShippingStartsWith(startsWith); - channelsUtils.deleteChannelsStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + productsUtils.deleteProductsStartsWith(startsWith); + deleteCategoriesStartsWith(startsWith); + deleteShippingStartsWith(startsWith); + channelsUtils.deleteChannelsStartsWith(startsWith); - channelsUtils - .getDefaultChannel() - .then(channel => { - defaultChannel = channel; - productsUtils.createTypeAttributeAndCategoryForProduct({ name }); - }) - .then( - ({ - category: categoryResp, - attribute: attributeResp, - productType: productTypeResp - }) => { - category = categoryResp; - attribute = attributeResp; - productType = productTypeResp; - productsUtils.createProductInChannel({ - name, - channelId: defaultChannel.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id - }); - } - ) - .then(({ product: productResp }) => (product = productResp)); - }); + channelsUtils + .getDefaultChannel() + .then(channel => { + defaultChannel = channel; + productsUtils.createTypeAttributeAndCategoryForProduct({ name }); + }) + .then( + ({ + category: categoryResp, + attribute: attributeResp, + productType: productTypeResp + }) => { + category = categoryResp; + attribute = attributeResp; + productType = productTypeResp; + productsUtils.createProductInChannel({ + name, + channelId: defaultChannel.id, + productTypeId: productType.id, + attributeId: attribute.id, + categoryId: category.id + }); + } + ) + .then(({ product: productResp }) => (product = productResp)); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should be able to create category. TC: SALEOR_0201", () => { + it( + "should be able to create category. TC: SALEOR_0201", + { tags: ["@category", "@allEnv"] }, + () => { const categoryName = `${startsWith}${faker.datatype.number()}`; cy.visit(urlList.categories) @@ -91,9 +92,13 @@ filterTests({ definedTags: ["all"] }, () => { const descriptionResp = JSON.parse(newCategory.description); expect(descriptionResp.blocks[0].data.text).to.eq(categoryName); }); - }); + } + ); - it("should be able to create category as subcategory. TC: SALEOR_0202", () => { + it( + "should be able to create category as subcategory. TC: SALEOR_0202", + { tags: ["@category", "@allEnv", "@stable"] }, + () => { const categoryName = `${startsWith}${faker.datatype.number()}`; cy.visit(categoryDetailsUrl(category.id)) @@ -106,9 +111,13 @@ filterTests({ definedTags: ["all"] }, () => { getCategory(category.id).then(categoryResp => { expect(categoryResp.children.edges[0].node.name).to.eq(categoryName); }); - }); + } + ); - it("should be able to add product to category. TC: SALEOR_0203", () => { + it( + "should be able to add product to category. TC: SALEOR_0203", + { tags: ["@category", "@allEnv", "@stable"] }, + () => { cy.visit(categoryDetailsUrl(category.id)) .get(CATEGORY_DETAILS.productsTab) .click() @@ -116,9 +125,13 @@ filterTests({ definedTags: ["all"] }, () => { .click() .url() .should("include", urlList.addProduct); - }); + } + ); - it("should be able to remove product from category. TC: SALEOR_0204", () => { + it( + "should be able to remove product from category. TC: SALEOR_0204", + { tags: ["@category", "@allEnv"] }, + () => { cy.visit(categoryDetailsUrl(category.id)) .get(CATEGORY_DETAILS.productsTab) .click(); @@ -137,17 +150,25 @@ filterTests({ definedTags: ["all"] }, () => { getCategory(category.id).then(categoryResp => { expect(categoryResp.products.edges.length).to.be.eq(0); }); - }); + } + ); - it("should be able to enter category details page. TC: SALEOR_0205", () => { + it( + "should be able to enter category details page. TC: SALEOR_0205", + { tags: ["@category", "@allEnv"] }, + () => { cy.visit(urlList.categories) .get(SHARED_ELEMENTS.searchInput) .type(category.name); cy.contains(SHARED_ELEMENTS.tableRow, category.name).click(); cy.contains(SHARED_ELEMENTS.header, category.name).should("be.visible"); - }); + } + ); - it("should be able to delete category. TC: SALEOR_0206", () => { + it( + "should be able to delete category. TC: SALEOR_0206", + { tags: ["@category", "@allEnv", "@stable"] }, + () => { const categoryName = `${startsWith}${faker.datatype.number()}`; createCategoryRequest({ @@ -162,9 +183,13 @@ filterTests({ definedTags: ["all"] }, () => { .waitForRequestAndCheckIfNoErrors("@CategoryDelete"); getCategory(categoryResp.id).should("be.null"); }); - }); + } + ); - it("should be able to update category. TC: SALEOR_0207", () => { + it( + "should be able to update category. TC: SALEOR_0207", + { tags: ["@category", "@allEnv", "@stable"] }, + () => { const categoryName = `${startsWith}${faker.datatype.number()}`; const updatedName = `${startsWith}updatedCategory`; @@ -184,9 +209,13 @@ filterTests({ definedTags: ["all"] }, () => { const descriptionText = descriptionJson.blocks[0].data.text; expect(descriptionText).to.eq(updatedName); }); - }); + } + ); - it("should be able to delete several categories on categories list page. TC: SALEOR_0209", () => { + it( + "should be able to delete several categories on categories list page. TC: SALEOR_0209", + { tags: ["@category", "@allEnv"] }, + () => { const firstCategoryName = `${startsWith}${faker.datatype.number()}`; const secondCategoryName = `${startsWith}${faker.datatype.number()}`; let firstCategory; @@ -219,9 +248,13 @@ filterTests({ definedTags: ["all"] }, () => { getCategory(firstCategory.id).should("be.null"); getCategory(secondCategory.id).should("be.null"); }); - }); + } + ); - it("should be able to remove subcategory from category. TC: SALEOR_0208", () => { + it( + "should be able to remove subcategory from category. TC: SALEOR_0208", + { tags: ["@category", "@allEnv", "@stable"] }, + () => { const subCategoryName = `${startsWith}${faker.datatype.number()}`; const mainCategoryName = `${startsWith}${faker.datatype.number()}`; let subCategory; @@ -255,6 +288,6 @@ filterTests({ definedTags: ["all"] }, () => { .then(categoryResp => { expect(categoryResp.children.edges).to.be.empty; }); - }); - }); + } + ); }); diff --git a/cypress/e2e/catalog/collections.js b/cypress/e2e/catalog/collections.js index 4d8b0a843..890441fcb 100644 --- a/cypress/e2e/catalog/collections.js +++ b/cypress/e2e/catalog/collections.js @@ -82,282 +82,318 @@ filterTests({ definedTags: ["all"] }, () => { cy.clearSessionData().loginUserViaRequest(); }); - xit("should create hidden collection. TC: SALEOR_0301", () => { - const collectionName = `${startsWith}${faker.datatype.number()}`; - let collection; + xit( + "should create hidden collection. TC: SALEOR_0301", + { tags: ["@collection", "@allEnv"] }, + () => { + const collectionName = `${startsWith}${faker.datatype.number()}`; + let collection; - cy.visit(urlList.collections); - cy.softExpectSkeletonIsVisible(); + cy.visit(urlList.collections); + cy.expectSkeletonIsVisible(); - createCollection(collectionName, false, defaultChannel) - .then(collectionResp => { - collection = collectionResp; - assignProductsToCollection(name); - }) - .then(() => { - getCollection({ - collectionId: collection.id, - channelSlug: defaultChannel.slug - }); - }) - .then(({ collection: resp }) => { - const isVisible = isCollectionVisible(resp, collection.id); - expect(isVisible).to.equal(false); - }); - }); - - it("should create published collection. TC: SALEOR_0302", () => { - const collectionName = `${startsWith}${faker.datatype.number()}`; - let collection; - - cy.visit(urlList.collections); - cy.softExpectSkeletonIsVisible(); - - createCollection(collectionName, true, defaultChannel) - .then(collectionResp => { - collection = collectionResp; - assignProductsToCollection(name); - getCollection({ - collectionId: collection.id, - channelSlug: defaultChannel.slug - }); - }) - .then(({ collection: resp }) => { - const isVisible = isCollectionVisible(resp, collection.id); - expect(isVisible).to.equal(true); - }); - }); - - it("create collection not available for channel. TC: SALEOR_0303", () => { - const collectionName = `${startsWith}${faker.datatype.number()}`; - let collection; - let channel; - - createChannel({ name: collectionName }) - .then(channelResp => { - channel = channelResp; - updateChannelInProduct(product.id, channel.id); - }) - .then(() => { - cy.visit(urlList.collections); - cy.softExpectSkeletonIsVisible(); - createCollection(collectionName, true, channel); - }) - .then(collectionResp => { - collection = collectionResp; - assignProductsToCollection(name); - getCollection({ - collectionId: collection.id, - channelSlug: defaultChannel.slug - }); - }) - .then(({ collection: resp }) => { - const isVisible = isCollectionVisible(resp, collection.id); - expect(isVisible).to.equal(false); - }); - }); - - it("create published collection with products hidden in listings. TC: SALEOR_0304", () => { - // Products "hidden in listings" are not displayed in Category listings or search results, - // but are listed on Collections - const collectionName = `${startsWith}${faker.datatype.number()}`; - let collection; - let createdProduct; - - productsUtils - .createProductInChannel({ - name: collectionName, - channelId: defaultChannel.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - visibleInListings: false - }) - .then(({ product: productResp }) => (createdProduct = productResp)); - cy.visit(urlList.collections); - cy.softExpectSkeletonIsVisible(); - createCollection(collectionName, true, defaultChannel) - .then(collectionResp => { - collection = collectionResp; - assignProductsToCollection(collectionName); - }) - .then(() => { - getCollection({ - collectionId: collection.id, - channelSlug: defaultChannel.slug - }); - }) - .then(({ collection: resp }) => { - const isVisible = isProductInCollectionVisible( - resp, - createdProduct.id - ); - expect(isVisible).to.equal(true); - }) - .then(() => { - searchInShop(createdProduct.name); - }) - .then(resp => { - const isVisible = isProductVisibleInSearchResult( - resp, - createdProduct.name - ); - expect(isVisible).to.equal(false); - }); - }); - - it("should delete collection. TC: SALEOR_0305", () => { - const collectionName = `${startsWith}${faker.datatype.number()}`; - - createCollectionRequest(collectionName).then(collectionResp => { - cy.visit(collectionDetailsUrl(collectionResp.id)) - .get(BUTTON_SELECTORS.deleteButton) - .click() - .addAliasToGraphRequest("RemoveCollection") - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@RemoveCollection"); - getCollection({ collectionId: collectionResp.id, auth: "auth" }) - .its("collection") - .should("be.null"); - }); - }); - - it("delete several collections on collections list page. TC: SALEOR_0309", () => { - const deleteSeveral = "delete-several-"; - const firstCollectionName = `${deleteSeveral}${startsWith}${faker.datatype.number()}`; - const secondCollectionName = `${deleteSeveral}${startsWith}${faker.datatype.number()}`; - let firstCollection; - let secondCollection; - - createCollectionRequest(firstCollectionName).then(collectionResp => { - firstCollection = collectionResp; - }); - - createCollectionRequest(secondCollectionName).then(collectionResp => { - secondCollection = collectionResp; - cy.visit(urlList.collections) - .searchInTable(deleteSeveral) - .get(collectionRow(firstCollection.id)) - .find(BUTTON_SELECTORS.checkbox) - .click() - .get(collectionRow(secondCollection.id)) - .find(BUTTON_SELECTORS.checkbox) - .click() - .get(BUTTON_SELECTORS.deleteIcon) - .click() - .addAliasToGraphRequest("CollectionBulkDelete") - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@CollectionBulkDelete"); - - getCollection({ collectionId: firstCollection.id, auth: "auth" }) - .its("collection") - .should("be.null"); - getCollection({ collectionId: secondCollection.id, auth: "auth" }) - .its("collection") - .should("be.null"); - }); - }); - - xit("should assign product to collection. TC: SALEOR_0307", () => { - const collectionName = `Assign-${startsWith}${faker.datatype.number()}`; - const productName = `Product-To-Assign-${startsWith}${faker.datatype.number()}`; - - let collection; - let productToAssign; - - createCollectionRequest(collectionName).then(collectionResp => { - collection = collectionResp; - - productsUtils - .createProductInChannel({ - name: productName, - channelId: defaultChannel.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - visibleInListings: false + createCollection(collectionName, false, defaultChannel) + .then(collectionResp => { + collection = collectionResp; + assignProductsToCollection(name); }) - .then(({ product: productResp }) => { - productToAssign = productResp; - - cy.visit(collectionDetailsUrl(collection.id)); - assignProductsToCollection(productToAssign.name); - - getCollection({ collectionId: collection.id, auth: "auth" }) - .its("collection.products.edges") - .should("have.length", 1) - .then(productArray => { - expect(productArray[0].node.id).to.equal(productToAssign.id); - }); - }); - }); - }); - - it("remove product from collection. TC: SALEOR_0308", () => { - const collectionName = `Remove-With-Assigned-Product-${startsWith}${faker.datatype.number()}`; - const productName = `Product-To-Assign-${startsWith}${faker.datatype.number()}`; - let collection; - let productToAssign; - - createCollectionRequest(collectionName).then(collectionResp => { - collection = collectionResp; - - productsUtils - .createProductInChannel({ - name: productName, - channelId: defaultChannel.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - visibleInListings: false - }) - .then(({ product: productResp }) => { - productToAssign = productResp; - - addProductToCollection({ + .then(() => { + getCollection({ collectionId: collection.id, - productId: productToAssign.id + channelSlug: defaultChannel.slug }); - - cy.visit(collectionDetailsUrl(collection.id)); - - getProductDetails(productToAssign.id, defaultChannel.slug, "auth") - .its("body.data.product.collections") - .should("have.length", 1); - - getCollection({ collectionId: collection.id, auth: "auth" }) - .its("collection.products.edges") - .should("have.length", 1); - - removeProductsFromCollection(productToAssign.name); - - getCollection({ collectionId: collection.id, auth: "auth" }) - .its("collection.products.edges") - .should("be.empty"); + }) + .then(({ collection: resp }) => { + const isVisible = isCollectionVisible(resp, collection.id); + expect(isVisible).to.equal(false); }); - }); - }); + } + ); - it("should update collection. TC: SALEOR_0306", () => { - const collectionName = `${startsWith}${faker.datatype.number()}`; - const updatedName = `${startsWith}updatedCollection`; + it( + "should create published collection. TC: SALEOR_0302", + { tags: ["@collection", "@allEnv", "@stable"] }, + () => { + const collectionName = `${startsWith}${faker.datatype.number()}`; + let collection; - createCollectionRequest(collectionName) - .then(collectionResp => { - cy.visitAndWaitForProgressBarToDisappear( - collectionDetailsUrl(collectionResp.id) - ); - updateCollection({ name: updatedName, description: updatedName }); - getCollection({ collectionId: collectionResp.id, auth: "auth" }); - }) - .then(({ collection: collectionResp }) => { - expect(collectionResp.name).to.eq(updatedName); - const descriptionJson = JSON.parse(collectionResp.description); - const descriptionText = descriptionJson.blocks[0].data.text; - expect(descriptionText).to.eq(updatedName); + cy.visit(urlList.collections); + cy.expectSkeletonIsVisible(); + + createCollection(collectionName, true, defaultChannel) + .then(collectionResp => { + collection = collectionResp; + assignProductsToCollection(name); + getCollection({ + collectionId: collection.id, + channelSlug: defaultChannel.slug + }); + }) + .then(({ collection: resp }) => { + const isVisible = isCollectionVisible(resp, collection.id); + expect(isVisible).to.equal(true); + }); + } + ); + + it( + "create collection not available for channel. TC: SALEOR_0303", + { tags: ["@collection", "@allEnv", "@stable"] }, + () => { + const collectionName = `${startsWith}${faker.datatype.number()}`; + let collection; + let channel; + + createChannel({ name: collectionName }) + .then(channelResp => { + channel = channelResp; + updateChannelInProduct(product.id, channel.id); + }) + .then(() => { + cy.visit(urlList.collections); + cy.expectSkeletonIsVisible(); + createCollection(collectionName, true, channel); + }) + .then(collectionResp => { + collection = collectionResp; + assignProductsToCollection(name); + getCollection({ + collectionId: collection.id, + channelSlug: defaultChannel.slug + }); + }) + .then(({ collection: resp }) => { + const isVisible = isCollectionVisible(resp, collection.id); + expect(isVisible).to.equal(false); + }); + } + ); + + it( + "create published collection with products hidden in listings. TC: SALEOR_0304", + { tags: ["@collection", "@allEnv", "@stable"] }, + () => { + // Products "hidden in listings" are not displayed in Category listings or search results, + // but are listed on Collections + const collectionName = `${startsWith}${faker.datatype.number()}`; + let collection; + let createdProduct; + + productsUtils + .createProductInChannel({ + name: collectionName, + channelId: defaultChannel.id, + productTypeId: productType.id, + attributeId: attribute.id, + categoryId: category.id, + visibleInListings: false + }) + .then(({ product: productResp }) => (createdProduct = productResp)); + cy.visit(urlList.collections); + cy.expectSkeletonIsVisible(); + createCollection(collectionName, true, defaultChannel) + .then(collectionResp => { + collection = collectionResp; + assignProductsToCollection(collectionName); + }) + .then(() => { + getCollection({ + collectionId: collection.id, + channelSlug: defaultChannel.slug + }); + }) + .then(({ collection: resp }) => { + const isVisible = isProductInCollectionVisible( + resp, + createdProduct.id + ); + expect(isVisible).to.equal(true); + }) + .then(() => { + searchInShop(createdProduct.name); + }) + .then(resp => { + const isVisible = isProductVisibleInSearchResult( + resp, + createdProduct.name + ); + expect(isVisible).to.equal(false); + }); + } + ); + + it( + "should delete collection. TC: SALEOR_0305", + { tags: ["@collection", "@allEnv", "@stable"] }, + () => { + const collectionName = `${startsWith}${faker.datatype.number()}`; + + createCollectionRequest(collectionName).then(collectionResp => { + cy.visit(collectionDetailsUrl(collectionResp.id)) + .get(BUTTON_SELECTORS.deleteButton) + .click() + .addAliasToGraphRequest("RemoveCollection") + .get(BUTTON_SELECTORS.submit) + .click() + .waitForRequestAndCheckIfNoErrors("@RemoveCollection"); + getCollection({ collectionId: collectionResp.id, auth: "auth" }) + .its("collection") + .should("be.null"); }); - }); + } + ); + + it( + "delete several collections on collections list page. TC: SALEOR_0309", + { tags: ["@collection", "@allEnv"] }, + () => { + const deleteSeveral = "delete-several-"; + const firstCollectionName = `${deleteSeveral}${startsWith}${faker.datatype.number()}`; + const secondCollectionName = `${deleteSeveral}${startsWith}${faker.datatype.number()}`; + let firstCollection; + let secondCollection; + + createCollectionRequest(firstCollectionName).then(collectionResp => { + firstCollection = collectionResp; + }); + + createCollectionRequest(secondCollectionName).then(collectionResp => { + secondCollection = collectionResp; + cy.visit(urlList.collections) + .searchInTable(deleteSeveral) + .get(collectionRow(firstCollection.id)) + .find(BUTTON_SELECTORS.checkbox) + .click() + .get(collectionRow(secondCollection.id)) + .find(BUTTON_SELECTORS.checkbox) + .click() + .get(BUTTON_SELECTORS.deleteIcon) + .click() + .addAliasToGraphRequest("CollectionBulkDelete") + .get(BUTTON_SELECTORS.submit) + .click() + .waitForRequestAndCheckIfNoErrors("@CollectionBulkDelete"); + + getCollection({ collectionId: firstCollection.id, auth: "auth" }) + .its("collection") + .should("be.null"); + getCollection({ collectionId: secondCollection.id, auth: "auth" }) + .its("collection") + .should("be.null"); + }); + } + ); + + xit( + "should assign product to collection. TC: SALEOR_0307", + { tags: ["@collection", "@allEnv"] }, + () => { + const collectionName = `Assign-${startsWith}${faker.datatype.number()}`; + const productName = `Product-To-Assign-${startsWith}${faker.datatype.number()}`; + + let collection; + let productToAssign; + + createCollectionRequest(collectionName).then(collectionResp => { + collection = collectionResp; + + productsUtils + .createProductInChannel({ + name: productName, + channelId: defaultChannel.id, + productTypeId: productType.id, + attributeId: attribute.id, + categoryId: category.id, + visibleInListings: false + }) + .then(({ product: productResp }) => { + productToAssign = productResp; + + cy.visit(collectionDetailsUrl(collection.id)); + assignProductsToCollection(productToAssign.name); + + getCollection({ collectionId: collection.id, auth: "auth" }) + .its("collection.products.edges") + .should("have.length", 1) + .then(productArray => { + expect(productArray[0].node.id).to.equal(productToAssign.id); + }); + }); + }); + } + ); + + it( + "remove product from collection. TC: SALEOR_0308", + { tags: ["@collection", "@allEnv"] }, + () => { + const collectionName = `Remove-With-Assigned-Product-${startsWith}${faker.datatype.number()}`; + const productName = `Product-To-Assign-${startsWith}${faker.datatype.number()}`; + let collection; + let productToAssign; + + createCollectionRequest(collectionName).then(collectionResp => { + collection = collectionResp; + + productsUtils + .createProductInChannel({ + name: productName, + channelId: defaultChannel.id, + productTypeId: productType.id, + attributeId: attribute.id, + categoryId: category.id, + visibleInListings: false + }) + .then(({ product: productResp }) => { + productToAssign = productResp; + + addProductToCollection({ + collectionId: collection.id, + productId: productToAssign.id + }); + + cy.visit(collectionDetailsUrl(collection.id)); + + getProductDetails(productToAssign.id, defaultChannel.slug, "auth") + .its("body.data.product.collections") + .should("have.length", 1); + + getCollection({ collectionId: collection.id, auth: "auth" }) + .its("collection.products.edges") + .should("have.length", 1); + + removeProductsFromCollection(productToAssign.name); + + getCollection({ collectionId: collection.id, auth: "auth" }) + .its("collection.products.edges") + .should("be.empty"); + }); + }); + } + ); + + it( + "should update collection. TC: SALEOR_0306", + { tags: ["@collection", "@allEnv"] }, + () => { + const collectionName = `${startsWith}${faker.datatype.number()}`; + const updatedName = `${startsWith}updatedCollection`; + + createCollectionRequest(collectionName) + .then(collectionResp => { + cy.visitAndWaitForProgressBarToDisappear( + collectionDetailsUrl(collectionResp.id) + ); + updateCollection({ name: updatedName, description: updatedName }); + getCollection({ collectionId: collectionResp.id, auth: "auth" }); + }) + .then(({ collection: collectionResp }) => { + expect(collectionResp.name).to.eq(updatedName); + const descriptionJson = JSON.parse(collectionResp.description); + const descriptionText = descriptionJson.blocks[0].data.text; + expect(descriptionText).to.eq(updatedName); + }); + } + ); }); }); diff --git a/cypress/e2e/catalog/giftCards/activateGiftCards.js b/cypress/e2e/catalog/giftCards/activateGiftCards.js index 86d6c25da..df03b5b7b 100644 --- a/cypress/e2e/catalog/giftCards/activateGiftCards.js +++ b/cypress/e2e/catalog/giftCards/activateGiftCards.js @@ -20,59 +20,60 @@ import { } from "../../../support/api/utils/ordersUtils"; import * as productsUtils from "../../../support/api/utils/products/productsUtils"; import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils"; -import filterTests from "../../../support/filterTests"; import { changeGiftCardActiveStatus, enterAndSelectGiftCards } from "../../../support/pages/catalog/giftCardPage"; -filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { - describe("As a admin I want to use enabled gift card in checkout", () => { - const startsWith = "GiftCardsCheckout"; - const productPrice = 50; - const shippingPrice = 50; - const email = "example@example.com"; - const giftCardData = { - amount: 150, - currency: "USD" - }; +describe("As a admin I want to use enabled gift card in checkout", () => { + const startsWith = "GiftCardsCheckout"; + const productPrice = 50; + const shippingPrice = 50; + const email = "example@example.com"; + const giftCardData = { + amount: 150, + currency: "USD" + }; - let defaultChannel; - let address; - let dataForCheckout; + let defaultChannel; + let address; + let dataForCheckout; - before(() => { - const name = `${startsWith}${faker.datatype.number()}`; + before(() => { + const name = `${startsWith}${faker.datatype.number()}`; - cy.clearSessionData().loginUserViaRequest(); + cy.clearSessionData().loginUserViaRequest(); - channelsUtils.deleteChannelsStartsWith(startsWith); - productsUtils.deleteProductsStartsWith(startsWith); - deleteShippingStartsWith(startsWith); - deleteGiftCardsWithTagStartsWith(startsWith); + channelsUtils.deleteChannelsStartsWith(startsWith); + productsUtils.deleteProductsStartsWith(startsWith); + deleteShippingStartsWith(startsWith); + deleteGiftCardsWithTagStartsWith(startsWith); - productsUtils - .createProductWithShipping({ name, shippingPrice, productPrice }) - .then(resp => { - defaultChannel = resp.defaultChannel; - address = resp.address; + productsUtils + .createProductWithShipping({ name, shippingPrice, productPrice }) + .then(resp => { + defaultChannel = resp.defaultChannel; + address = resp.address; - dataForCheckout = { - address, - email, - auth: "token", - channelSlug: defaultChannel.slug, - shippingMethodName: resp.shippingMethod.name, - variantsList: resp.variantsList - }; - }); - }); + dataForCheckout = { + address, + email, + auth: "token", + channelSlug: defaultChannel.slug, + shippingMethodName: resp.shippingMethod.name, + variantsList: resp.variantsList + }; + }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should be able to enable gift card and use it in checkout. TC: SALEOR_1006", () => { + it( + "should be able to enable gift card and use it in checkout. TC: SALEOR_1006", + { tags: ["@giftCard", "@allEnv"] }, + () => { const expectedGiftCardBalance = giftCardData.amount - productPrice - shippingPrice; @@ -102,9 +103,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { .then(dataAsExpected => { expect(dataAsExpected).to.be.true; }); - }); + } + ); - it("should not be able to disable gift card and use it in checkout. TC: SALEOR_1007", () => { + it( + "should not be able to disable gift card and use it in checkout. TC: SALEOR_1007", + { tags: ["@giftCard", "@allEnv", "@stable"] }, + () => { giftCardData.tag = `${startsWith}${faker.datatype.number()}`; let giftCard; @@ -128,9 +133,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { .then(dataAsExpected => { expect(dataAsExpected).to.be.true; }); - }); + } + ); - it("should not be able to disable several gift cards on gift card list page and use it in checkout. TC: SALEOR_1013", () => { + it( + "should not be able to disable several gift cards on gift card list page and use it in checkout. TC: SALEOR_1013", + { tags: ["@giftCard", "@allEnv", "@stable"] }, + () => { const firstGiftCardName = `${startsWith}${faker.datatype.number()}`; const secondGiftCardName = `${startsWith}${faker.datatype.number()}`; const amount = 10; @@ -178,9 +187,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expectedAmount: amount }).then(dataAsExpected => expect(dataAsExpected).to.be.true); }); - }); + } + ); - xit("should be able to enable several gift cards on gift card list page and use it in checkout. TC: SALEOR_1012", () => { + xit( + "should be able to enable several gift cards on gift card list page and use it in checkout. TC: SALEOR_1012", + { tags: ["@giftCard", "@allEnv"] }, + () => { const firstGiftCardName = `${startsWith}${faker.datatype.number()}`; const secondGiftCardName = `${startsWith}${faker.datatype.number()}`; const amount = 10; @@ -228,6 +241,6 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expectedOrderPrice }).then(isDataAsExpected => expect(isDataAsExpected).to.be.true); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/catalog/giftCards/createGiftCard.js b/cypress/e2e/catalog/giftCards/createGiftCard.js index 14bf3daa1..488ec26eb 100644 --- a/cypress/e2e/catalog/giftCards/createGiftCard.js +++ b/cypress/e2e/catalog/giftCards/createGiftCard.js @@ -6,7 +6,6 @@ import faker from "faker"; import { getGiftCardsWithCode } from "../../../support/api/requests/GiftCard"; import { deleteGiftCardsWithTagStartsWith } from "../../../support/api/utils/catalog/giftCardUtils"; import { addToDate } from "../../../support/api/utils/misc"; -import filterTests from "../../../support/filterTests"; import { formatDate } from "../../../support/formatData/formatDate"; import { expiryPeriods, @@ -16,22 +15,24 @@ import { setExpiryPeriod } from "../../../support/pages/catalog/giftCardPage"; -filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { - describe("As an admin I want to create gift card", () => { - const startsWith = "GiftCards"; - const amount = 50; - const currency = "USD"; +describe("As an admin I want to create gift card", () => { + const startsWith = "GiftCards"; + const amount = 50; + const currency = "USD"; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteGiftCardsWithTagStartsWith(startsWith); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteGiftCardsWithTagStartsWith(startsWith); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should be able to create never expire gift card. TC: SALEOR_1001", () => { + it( + "should be able to create never expire gift card. TC: SALEOR_1001", + { tags: ["@giftCard", "@allEnv", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; let giftCard; @@ -51,9 +52,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expect(giftCardsResp[0].node.initialBalance.amount).to.eq(amount); expect(giftCardsResp[0].node.initialBalance.currency).to.eq(currency); }); - }); + } + ); - it("should be able to create gift card with two moths expiry. TC: SALEOR_1002", () => { + it( + "should be able to create gift card with two moths expiry. TC: SALEOR_1002", + { tags: ["@giftCard", "@allEnv", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; let giftCard; const expectedExpiryDate = addToDate(new Date(), 2, "M"); @@ -76,9 +81,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expect(giftCardsResp[0].node.initialBalance.currency).to.eq(currency); expect(giftCardsResp[0].node.expiryDate).to.eq(expectedExpiryDate); }); - }); + } + ); - it("should be able to create gift card with date expiry. TC: SALEOR_1003", () => { + it( + "should be able to create gift card with date expiry. TC: SALEOR_1003", + { tags: ["@giftCard", "@allEnv", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; const date = formatDate(new Date(new Date().getFullYear() + 2, 1, 1)); let giftCard; @@ -101,6 +110,6 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expect(giftCardsResp[0].node.initialBalance.currency).to.eq(currency); expect(giftCardsResp[0].node.expiryDate).to.eq(date); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/catalog/giftCards/purchaseGiftCard.js b/cypress/e2e/catalog/giftCards/purchaseGiftCard.js index 6e1b62f63..e487f1b65 100644 --- a/cypress/e2e/catalog/giftCards/purchaseGiftCard.js +++ b/cypress/e2e/catalog/giftCards/purchaseGiftCard.js @@ -9,88 +9,87 @@ import { createShipping, deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils"; -import filterTests from "../../../support/filterTests"; -filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { - describe("As a customer I should be able to purchase gift card as a product", () => { - const startsWith = "GiftCardsCheckout"; - const productPrice = 50; - const shippingPrice = 50; - const email = "example@example.com"; +describe("As a customer I should be able to purchase gift card as a product", () => { + const startsWith = "GiftCardsCheckout"; + const productPrice = 50; + const shippingPrice = 50; + const email = "example@example.com"; - let defaultChannel; - let productType; - let attribute; - let category; - let shippingMethod; - let variants; - let address; - const giftCardData = { - amount: 150, - currency: "USD" - }; + let defaultChannel; + let productType; + let attribute; + let category; + let shippingMethod; + let variants; + let address; + const giftCardData = { + amount: 150, + currency: "USD" + }; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - channelsUtils.deleteChannelsStartsWith(startsWith); - productsUtils.deleteProductsStartsWith(startsWith); - deleteShippingStartsWith(startsWith); - deleteGiftCardsWithTagStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + channelsUtils.deleteChannelsStartsWith(startsWith); + productsUtils.deleteProductsStartsWith(startsWith); + deleteShippingStartsWith(startsWith); + deleteGiftCardsWithTagStartsWith(startsWith); - const name = `${startsWith}${faker.datatype.number()}`; + const name = `${startsWith}${faker.datatype.number()}`; - productsUtils - .createTypeAttributeAndCategoryForProduct({ name, kind: "GIFT_CARD" }) - .then( - ({ - productType: productTypeResp, - attribute: attributeResp, - category: categoryResp - }) => { - productType = productTypeResp; - attribute = attributeResp; - category = categoryResp; + productsUtils + .createTypeAttributeAndCategoryForProduct({ name, kind: "GIFT_CARD" }) + .then( + ({ + productType: productTypeResp, + attribute: attributeResp, + category: categoryResp + }) => { + productType = productTypeResp; + attribute = attributeResp; + category = categoryResp; - channelsUtils.getDefaultChannel(); - } - ) - .then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }) - .then(addresses => { - address = addresses.plAddress; - createShipping({ - channelId: defaultChannel.id, - name, - address, - price: shippingPrice - }); - }) - .then( - ({ shippingMethod: shippingMethodResp, warehouse: warehouse }) => { - shippingMethod = shippingMethodResp; - productsUtils.createProductInChannel({ - name, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - price: productPrice - }); - } - ) - .then(({ variantsList: variantsResp }) => { - variants = variantsResp; + channelsUtils.getDefaultChannel(); + } + ) + .then(channel => { + defaultChannel = channel; + cy.fixture("addresses"); + }) + .then(addresses => { + address = addresses.plAddress; + createShipping({ + channelId: defaultChannel.id, + name, + address, + price: shippingPrice }); - }); + }) + .then(({ shippingMethod: shippingMethodResp, warehouse: warehouse }) => { + shippingMethod = shippingMethodResp; + productsUtils.createProductInChannel({ + name, + channelId: defaultChannel.id, + warehouseId: warehouse.id, + productTypeId: productType.id, + attributeId: attribute.id, + categoryId: category.id, + price: productPrice + }); + }) + .then(({ variantsList: variantsResp }) => { + variants = variantsResp; + }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should be able to purchase gift card as a product. TC: SALEOR_1008", () => { + it( + "should be able to purchase gift card as a product. TC: SALEOR_1008", + { tags: ["@giftCard", "@allEnv", "@stable"] }, + () => { giftCardData.tag = `${startsWith}${faker.datatype.number()}`; createWaitingForCaptureOrder({ @@ -102,6 +101,6 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { }).then(({ order }) => { expect(order.id).to.be.ok; }); - }); - }); + } + ); }); diff --git a/cypress/e2e/catalog/giftCards/updatingGiftCards.js b/cypress/e2e/catalog/giftCards/updatingGiftCards.js index 0be7ed807..8df4cdf51 100644 --- a/cypress/e2e/catalog/giftCards/updatingGiftCards.js +++ b/cypress/e2e/catalog/giftCards/updatingGiftCards.js @@ -11,23 +11,24 @@ import { getGiftCardWithId } from "../../../support/api/requests/GiftCard"; import { deleteGiftCardsWithTagStartsWith } from "../../../support/api/utils/catalog/giftCardUtils"; -import filterTests from "../../../support/filterTests"; import { formatDate } from "../../../support/formatData/formatDate"; -filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { - describe("As an admin I want to update gift card", () => { - const startsWith = "GiftCards"; +describe("As an admin I want to update gift card", () => { + const startsWith = "GiftCards"; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteGiftCardsWithTagStartsWith(startsWith); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteGiftCardsWithTagStartsWith(startsWith); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should be able to delete gift card. TC: SALEOR_1004", () => { + it( + "should be able to delete gift card. TC: SALEOR_1004", + { tags: ["@giftCard", "@allEnv", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; createGiftCard({ @@ -46,9 +47,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { .waitForRequestAndCheckIfNoErrors("@DeleteGiftCard"); getGiftCardWithId(giftCard.id).should("be.null"); }); - }); + } + ); - it("should be able to update gift card. TC: SALEOR_1005", () => { + it( + "should be able to update gift card. TC: SALEOR_1005", + { tags: ["@giftCard", "@allEnv", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; const updatedName = `${startsWith}${faker.datatype.number()}`; const date = formatDate(new Date(new Date().getFullYear() + 2, 1, 1)); @@ -85,6 +90,6 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { ); expect(giftCard.expiryDate).to.eq(date); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/checkout/clickAndCollect.js b/cypress/e2e/checkout/clickAndCollect.js index b47a7d12a..10a59cc13 100644 --- a/cypress/e2e/checkout/clickAndCollect.js +++ b/cypress/e2e/checkout/clickAndCollect.js @@ -22,7 +22,6 @@ import { createShipping, deleteShippingStartsWith } from "../../support/api/utils/shippingUtils"; -import filterTests from "../../support/filterTests"; import { createWarehouse, pickupOptions, @@ -30,68 +29,70 @@ import { visitSetPublicStockAndEnablePickup } from "../../support/pages/warehousePage"; -filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { - describe("Warehouses in checkout", () => { - const startsWith = `CyWarehouseCheckout`; - let defaultChannel; - let usAddress; - let secondUsAddress; - let plAddress; - let productData; - let checkoutData; - let variantsInOtherWarehouse; +describe("Warehouses in checkout", () => { + const startsWith = `CyWarehouseCheckout`; + let defaultChannel; + let usAddress; + let secondUsAddress; + let plAddress; + let productData; + let checkoutData; + let variantsInOtherWarehouse; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteShippingStartsWith(startsWith); - deleteProductsStartsWith(startsWith); - cy.fixture("addresses") - .then(addresses => { - usAddress = addresses.usAddress; - secondUsAddress = addresses.secondUsAddress; - plAddress = addresses.plAddress; - getDefaultChannel(); - }) - .then(channelResp => { - defaultChannel = channelResp; - createTypeAttributeAndCategoryForProduct({ name: startsWith }); - }) - .then(({ attribute, productType, category }) => { - productData = { - attributeId: attribute.id, - categoryId: category.id, - channelId: defaultChannel.id, - productTypeId: productType.id, - quantityInWarehouse: 100 - }; - checkoutData = { - returnAvailableCollectionPoints: true, - channelSlug: defaultChannel.slug, - email: "example@example.com", - address: secondUsAddress - }; - createShipping({ - channelId: defaultChannel.id, - name: startsWith, - address: secondUsAddress - }); - }) - .then(({ warehouse: warehouseResp }) => { - productData.name = startsWith; - productData.warehouseId = warehouseResp.id; - updateWarehouse({ id: productData.warehouseId, isPrivate: false }); - createProductInChannel(productData); - }) - .then(({ variantsList }) => { - variantsInOtherWarehouse = variantsList; + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteShippingStartsWith(startsWith); + deleteProductsStartsWith(startsWith); + cy.fixture("addresses") + .then(addresses => { + usAddress = addresses.usAddress; + secondUsAddress = addresses.secondUsAddress; + plAddress = addresses.plAddress; + getDefaultChannel(); + }) + .then(channelResp => { + defaultChannel = channelResp; + createTypeAttributeAndCategoryForProduct({ name: startsWith }); + }) + .then(({ attribute, productType, category }) => { + productData = { + attributeId: attribute.id, + categoryId: category.id, + channelId: defaultChannel.id, + productTypeId: productType.id, + quantityInWarehouse: 100 + }; + checkoutData = { + returnAvailableCollectionPoints: true, + channelSlug: defaultChannel.slug, + email: "example@example.com", + address: secondUsAddress + }; + createShipping({ + channelId: defaultChannel.id, + name: startsWith, + address: secondUsAddress }); - }); + }) + .then(({ warehouse: warehouseResp }) => { + productData.name = startsWith; + productData.warehouseId = warehouseResp.id; + updateWarehouse({ id: productData.warehouseId, isPrivate: false }); + createProductInChannel(productData); + }) + .then(({ variantsList }) => { + variantsInOtherWarehouse = variantsList; + }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - xit("should create warehouse with all warehouses pickup and private stock", () => { + xit( + "should create warehouse with all warehouses pickup and private stock", + { tags: ["@checkout", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; let warehouse; @@ -122,9 +123,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expect(clickAndCollectOption.isPrivate).to.eq(true); expect(clickAndCollectOption.name).to.eq(warehouse.name); }); - }); + } + ); - xit("should create warehouse with all warehouses pickup and public stock", () => { + xit( + "should create warehouse with all warehouses pickup and public stock", + { tags: ["@checkout", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; let warehouse; @@ -155,9 +160,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expect(clickAndCollectOption.isPrivate).to.eq(false); expect(clickAndCollectOption.name).to.eq(warehouse.name); }); - }); + } + ); - xit("should create warehouse with local stock only pickup and public stock", () => { + xit( + "should create warehouse with local stock only pickup and public stock", + { tags: ["@checkout", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; let warehouse; let variantsInLocalStock; @@ -196,17 +205,25 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expect(clickAndCollectOption.isPrivate).to.eq(false); expect(clickAndCollectOption.name).to.eq(warehouse.name); }); - }); + } + ); - xit("should not be possible to set local pickup when private stock", () => { + xit( + "should not be possible to set local pickup when private stock", + { tags: ["@checkout", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; createWarehouse({ name, address: usAddress }); cy.get(WAREHOUSES_DETAILS.clickAndCollectLocalStockRadioButton).should( "not.exist" ); - }); + } + ); - it("should create order with warehouse address", () => { + it( + "should create order with warehouse address", + { tags: ["@checkout", "@allEnv"] }, + () => { let checkout; checkoutData.variantsList = variantsInOtherWarehouse; createCheckout(checkoutData) @@ -228,6 +245,6 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { cy.expectCorrectBasicAddress(order.shippingAddress, secondUsAddress); cy.expectCorrectBasicAddress(order.billingAddress, usAddress); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/checkout/productWithoutShipping.js b/cypress/e2e/checkout/productWithoutShipping.js index 1cd85cb6a..9d3792313 100644 --- a/cypress/e2e/checkout/productWithoutShipping.js +++ b/cypress/e2e/checkout/productWithoutShipping.js @@ -19,83 +19,81 @@ import { createShipping, deleteShippingStartsWith } from "../../support/api/utils/shippingUtils"; -import filterTests from "../../support/filterTests"; -filterTests({ definedTags: ["all"] }, () => { - describe("Products without shipment option", () => { - const startsWith = "WithoutShipmentCheckout-"; - const name = `${startsWith}${faker.datatype.number()}`; - const nameProdWithoutShipping = `${startsWith}${faker.datatype.number()}`; +describe("Products without shipment option", () => { + const startsWith = "WithoutShipmentCheckout-"; + const name = `${startsWith}${faker.datatype.number()}`; + const nameProdWithoutShipping = `${startsWith}${faker.datatype.number()}`; - let channel; - let address; - let warehouse; - let shippingMethod; - let productWithShipping; - let productWithoutShipping; + let channel; + let address; + let warehouse; + let shippingMethod; + let productWithShipping; + let productWithoutShipping; - before(() => { - cy.clearSessionData().loginUserViaRequest(); + before(() => { + cy.clearSessionData().loginUserViaRequest(); - deleteProductsStartsWith(startsWith); - deleteShippingStartsWith(startsWith); - deleteChannelsStartsWith(startsWith); + deleteProductsStartsWith(startsWith); + deleteShippingStartsWith(startsWith); + deleteChannelsStartsWith(startsWith); - createChannel({ - name + createChannel({ + name + }) + .then(channelResp => { + channel = channelResp; + cy.fixture("addresses"); }) - .then(channelResp => { - channel = channelResp; - cy.fixture("addresses"); - }) - .then(({ usAddress }) => { - address = usAddress; - createShipping({ + .then(({ usAddress }) => { + address = usAddress; + createShipping({ + channelId: channel.id, + name, + address, + minProductPrice: 100 + }); + }) + .then( + ({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => { + warehouse = warehouseResp; + shippingMethod = shippingMethodResp; + createTypeAttributeAndCategoryForProduct({ name }); + } + ) + .then( + ({ + attribute: attributeResp, + productType: productTypeResp, + category: categoryResp + }) => { + createProductInChannel({ + attributeId: attributeResp.id, + categoryId: categoryResp.id, channelId: channel.id, name, - address, - minProductPrice: 100 - }); - }) - .then( - ({ - warehouse: warehouseResp, - shippingMethod: shippingMethodResp - }) => { - warehouse = warehouseResp; - shippingMethod = shippingMethodResp; - createTypeAttributeAndCategoryForProduct({ name }); - } - ) - .then( - ({ - attribute: attributeResp, - productType: productTypeResp, - category: categoryResp - }) => { - createProductInChannel({ - attributeId: attributeResp.id, - categoryId: categoryResp.id, - channelId: channel.id, - name, - productTypeId: productTypeResp.id, - warehouseId: warehouse.id - }).then(({ variantsList }) => (productWithShipping = variantsList)); - createProductInChannel({ - attributeId: attributeResp.id, - categoryId: categoryResp.id, - channelId: channel.id, - name: nameProdWithoutShipping, - productTypeId: productTypeResp.id, - warehouseId: warehouse.id - }).then( - ({ variantsList }) => (productWithoutShipping = variantsList) - ); - } - ); - }); + productTypeId: productTypeResp.id, + warehouseId: warehouse.id + }).then(({ variantsList }) => (productWithShipping = variantsList)); + createProductInChannel({ + attributeId: attributeResp.id, + categoryId: categoryResp.id, + channelId: channel.id, + name: nameProdWithoutShipping, + productTypeId: productTypeResp.id, + warehouseId: warehouse.id + }).then( + ({ variantsList }) => (productWithoutShipping = variantsList) + ); + } + ); + }); - it("should be not possible to buy product without shipping option", () => { + it( + "should be not possible to buy product without shipping option", + { tags: ["@checkout", "@allEnv", "@stable"] }, + () => { createCheckout({ channelSlug: channel.slug, email: "example@example.com", @@ -122,6 +120,6 @@ filterTests({ definedTags: ["all"] }, () => { "shippingMethodId" ); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/checkout/purchaseWithProductTypes.js b/cypress/e2e/checkout/purchaseWithProductTypes.js index da44a72a3..538da84bb 100644 --- a/cypress/e2e/checkout/purchaseWithProductTypes.js +++ b/cypress/e2e/checkout/purchaseWithProductTypes.js @@ -18,38 +18,38 @@ import { updateShippingInCheckout } from "../../support/api/utils/ordersUtils"; import { createDigitalAndPhysicalProductWithNewDataAndDefaultChannel } from "../../support/api/utils/products/productsUtils"; -import filterTests from "../../support/filterTests"; -filterTests({ definedTags: ["all", "refactored"] }, () => { - describe("As an unlogged customer I want to order physical and digital products", () => { - const startsWith = `CyPurchaseByType`; - const email = `${startsWith}@example.com`; - const testsMessage = "Check order status"; - const digitalName = `${startsWith}${faker.datatype.number()}`; - const physicalName = `${startsWith}${faker.datatype.number()}`; - const { softExpect } = chai; +describe("As an unlogged customer I want to order physical and digital products", () => { + const startsWith = `CyPurchaseByType`; + const email = `${startsWith}@example.com`; + const testsMessage = "Check order status"; + const digitalName = `${startsWith}${faker.datatype.number()}`; + const physicalName = `${startsWith}${faker.datatype.number()}`; - let defaultChannel; - let address; - let shippingMethod; - let digitalVariants; - let physicalVariants; + let defaultChannel; + let address; + let shippingMethod; + let digitalVariants; + let physicalVariants; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - createDigitalAndPhysicalProductWithNewDataAndDefaultChannel({ - physicalProductName: physicalName, - digitalProductName: digitalName - }).then(resp => { - defaultChannel = resp.defaultChannel; - address = resp.address; - shippingMethod = resp.shippingMethod; - digitalVariants = resp.digitalVariants; - physicalVariants = resp.physicalVariants; - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + createDigitalAndPhysicalProductWithNewDataAndDefaultChannel({ + physicalProductName: physicalName, + digitalProductName: digitalName + }).then(resp => { + defaultChannel = resp.defaultChannel; + address = resp.address; + shippingMethod = resp.shippingMethod; + digitalVariants = resp.digitalVariants; + physicalVariants = resp.physicalVariants; }); + }); - it("should purchase digital product as unlogged customer. TC: SALEOR_0402", () => { + it( + "should purchase digital product as unlogged customer. TC: SALEOR_0402", + { tags: ["@checkout", "@allEnv", "@stable"] }, + () => { createAndCompleteCheckoutWithoutShipping({ channelSlug: defaultChannel.slug, email, @@ -61,15 +61,19 @@ filterTests({ definedTags: ["all", "refactored"] }, () => { getOrder(order.id); }) .then(order => { - softExpect( + expect( order.isShippingRequired, "Check if is shipping required in order" ).to.eq(false); expect(order.status, testsMessage).to.be.eq("UNFULFILLED"); }); - }); + } + ); - it("should purchase physical product as unlogged customer. TC: SALEOR_0403", () => { + it( + "should purchase physical product as unlogged customer. TC: SALEOR_0403", + { tags: ["@checkout", "@allEnv", "@stable"] }, + () => { createWaitingForCaptureOrder({ channelSlug: defaultChannel.slug, email, @@ -81,15 +85,19 @@ filterTests({ definedTags: ["all", "refactored"] }, () => { getOrder(order.id); }) .then(order => { - softExpect( + expect( order.isShippingRequired, "Check if is shipping required in order" ).to.eq(true); expect(order.status, testsMessage).to.be.eq("UNFULFILLED"); }); - }); + } + ); - it("should purchase multiple products with all product types as unlogged customer. TC: SALEOR_0404", () => { + it( + "should purchase multiple products with all product types as unlogged customer. TC: SALEOR_0404", + { tags: ["@checkout", "@allEnv"] }, + () => { let checkout; createCheckout({ @@ -137,12 +145,12 @@ filterTests({ definedTags: ["all", "refactored"] }, () => { getOrder(order.id); }) .then(order => { - softExpect( + expect( order.isShippingRequired, "Check if is shipping required in order" ).to.eq(true); expect(order.status, testsMessage).to.be.eq("UNFULFILLED"); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/checkout/stocksInCheckout.js b/cypress/e2e/checkout/stocksInCheckout.js index b32b68653..fdbed7f07 100644 --- a/cypress/e2e/checkout/stocksInCheckout.js +++ b/cypress/e2e/checkout/stocksInCheckout.js @@ -10,58 +10,59 @@ import { import { getVariants } from "../../support/api/requests/Product"; import { createWaitingForCaptureOrder } from "../../support/api/utils/ordersUtils"; import { createNewProductWithSeveralVariants } from "../../support/api/utils/products/productsUtils"; -import filterTests from "../../support/filterTests"; -filterTests({ definedTags: ["all", "refactored"] }, () => { - describe("Manage products stocks in checkout", () => { - const startsWith = "CyStocksCheckout-"; - const name = `${startsWith}${faker.datatype.number()}`; +describe("Manage products stocks in checkout", () => { + const startsWith = "CyStocksCheckout-"; + const name = `${startsWith}${faker.datatype.number()}`; - let defaultChannel; - let address; - let shippingMethod; - let variantsWithLowStock; - let variantsWithoutTrackInventory; - let lastVariantInStock; + let defaultChannel; + let address; + let shippingMethod; + let variantsWithLowStock; + let variantsWithoutTrackInventory; + let lastVariantInStock; - before(() => { - cy.clearSessionData().loginUserViaRequest(); + before(() => { + cy.clearSessionData().loginUserViaRequest(); - const variantsData = [ - { - name: "variantsWithLowStock", - trackInventory: true, - quantityInWarehouse: 1 - }, - { - name: "variantsWithoutTrackInventory", - trackInventory: false, - quantityInWarehouse: 0 - }, - { - name: "lastVariantInStock", - trackInventory: true, - quantityInWarehouse: 1 - } - ]; + const variantsData = [ + { + name: "variantsWithLowStock", + trackInventory: true, + quantityInWarehouse: 1 + }, + { + name: "variantsWithoutTrackInventory", + trackInventory: false, + quantityInWarehouse: 0 + }, + { + name: "lastVariantInStock", + trackInventory: true, + quantityInWarehouse: 1 + } + ]; - createNewProductWithSeveralVariants(name, variantsData).then(resp => { - defaultChannel = resp.defaultChannel; - address = resp.address; - shippingMethod = resp.shippingMethod; - variantsWithLowStock = resp.createdVariants.find( - variant => variant.name === "variantsWithLowStock" - ); - variantsWithoutTrackInventory = resp.createdVariants.find( - variant => variant.name === "variantsWithoutTrackInventory" - ); - lastVariantInStock = resp.createdVariants.find( - variant => variant.name === "lastVariantInStock" - ); - }); + createNewProductWithSeveralVariants(name, variantsData).then(resp => { + defaultChannel = resp.defaultChannel; + address = resp.address; + shippingMethod = resp.shippingMethod; + variantsWithLowStock = resp.createdVariants.find( + variant => variant.name === "variantsWithLowStock" + ); + variantsWithoutTrackInventory = resp.createdVariants.find( + variant => variant.name === "variantsWithoutTrackInventory" + ); + lastVariantInStock = resp.createdVariants.find( + variant => variant.name === "lastVariantInStock" + ); }); + }); - it("should not be possible to add product with quantity greater than stock to checkout. TC: SALEOR_0405", () => { + it( + "should not be possible to add product with quantity greater than stock to checkout. TC: SALEOR_0405", + { tags: ["@checkout", "@allEnv", "@stable"] }, + () => { createCheckout({ channelSlug: defaultChannel.slug, address, @@ -79,9 +80,13 @@ filterTests({ definedTags: ["all", "refactored"] }, () => { "should return error on field quantity" ).to.have.property("field", "quantity"); }); - }); + } + ); - it("should buy product with no quantity if tracking is not set. TC: SALEOR_0406", () => { + it( + "should buy product with no quantity if tracking is not set. TC: SALEOR_0406", + { tags: ["@checkout", "@allEnv", "@stable"] }, + () => { createWaitingForCaptureOrder({ address, channelSlug: defaultChannel.slug, @@ -91,9 +96,13 @@ filterTests({ definedTags: ["all", "refactored"] }, () => { }).then(({ order }) => { expect(order, "order should be created").to.be.ok; }); - }); + } + ); - it("should create checkout with last product in stock. TC: SALEOR_0419", () => { + it( + "should create checkout with last product in stock. TC: SALEOR_0419", + { tags: ["@checkout", "@allEnv", "@stable"] }, + () => { createWaitingForCaptureOrder({ address, channelSlug: defaultChannel.slug, @@ -110,6 +119,6 @@ filterTests({ definedTags: ["all", "refactored"] }, () => { expect(variant.node.stocks[0].quantityAllocated).to.eq(1); expect(variant.node.stocks[0].quantity).to.eq(1); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/checkout/warehouses.js b/cypress/e2e/checkout/warehouses.js index f6a89ae20..67fe0fe63 100644 --- a/cypress/e2e/checkout/warehouses.js +++ b/cypress/e2e/checkout/warehouses.js @@ -14,17 +14,18 @@ import { createShipping, deleteShippingStartsWith } from "../../support/api/utils/shippingUtils"; -import filterTests from "../../support/filterTests"; -filterTests({ definedTags: ["all"] }, () => { - describe("Warehouses in checkout", () => { - const startsWith = `CyWarehouseCheckout`; - let defaultChannel; - let usAddress; - let plAddress; - let warehouse; +describe("Warehouses in checkout", () => { + const startsWith = `CyWarehouseCheckout`; + let defaultChannel; + let usAddress; + let plAddress; + let warehouse; - it("should not be possible to buy product for country not listed in warehouse", () => { + it( + "should not be possible to buy product for country not listed in warehouse", + { tags: ["@checkout", "@allEnv", "@stable"] }, + () => { cy.clearSessionData().loginUserViaRequest(); deleteShippingStartsWith(startsWith); deleteProductsStartsWith(startsWith); @@ -69,6 +70,6 @@ filterTests({ definedTags: ["all"] }, () => { .then(({ errors }) => { expect(errors[0]).to.have.property("field", "quantity"); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/attributes/attributeVariantSelection.js b/cypress/e2e/configuration/attributes/attributeVariantSelection.js index d9be4e422..d8136bb21 100644 --- a/cypress/e2e/configuration/attributes/attributeVariantSelection.js +++ b/cypress/e2e/configuration/attributes/attributeVariantSelection.js @@ -12,39 +12,40 @@ import { deleteProductsStartsWith } from "../../../support/api/utils/products/productsUtils"; import { createProductTypeWithNewVariantSelectionAttribute } from "../../../support/api/utils/productTypeUtils"; -import filterTests from "../../../support/filterTests"; import { fillUpVariantDetails } from "../../../support/pages/catalog/products/VariantsPage"; -filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { - describe("As an admin I want to use attributes in variant selection", () => { - const startsWith = "VarSel"; +describe("As an admin I want to use attributes in variant selection", () => { + const startsWith = "VarSel"; - const attributesTypes = [ - { key: "DROPDOWN", TC: "SALEOR_0534" }, - { key: "MULTISELECT", TC: "SALEOR_0535" }, - { key: "BOOLEAN", TC: "SALEOR_0536" }, - { key: "NUMERIC", TC: "SALEOR_0537" }, - { key: "SWATCH", TC: "SALEOR_0538" } - ]; - let channel; - let category; - let product; + const attributesTypes = [ + { key: "DROPDOWN", TC: "SALEOR_0534" }, + { key: "MULTISELECT", TC: "SALEOR_0535" }, + { key: "BOOLEAN", TC: "SALEOR_0536" }, + { key: "NUMERIC", TC: "SALEOR_0537" }, + { key: "SWATCH", TC: "SALEOR_0538" } + ]; + let channel; + let category; + let product; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteProductsStartsWith(startsWith); - getDefaultChannel().then(defaultChannel => (channel = defaultChannel)); - createCategory({ name: startsWith }).then( - categoryResp => (category = categoryResp) - ); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteProductsStartsWith(startsWith); + getDefaultChannel().then(defaultChannel => (channel = defaultChannel)); + createCategory({ name: startsWith }).then( + categoryResp => (category = categoryResp) + ); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - attributesTypes.forEach(attributeType => { - it(`should create variant with ${attributeType.key} attribute. TC: ${attributeType.TC}`, () => { + attributesTypes.forEach(attributeType => { + it( + `should create variant with ${attributeType.key} attribute. TC: ${attributeType.TC}`, + { tags: ["@attribute", "@allEnv"] }, + () => { const name = `${startsWith}${ attributeType.key }${faker.datatype.number()}`; @@ -91,7 +92,7 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expect(attributes[0].attribute.inputType).to.eq(inputType); cy.confirmationMessageShouldAppear(); }); - }); - }); + } + ); }); }); diff --git a/cypress/e2e/configuration/attributes/createContentAttribute.js b/cypress/e2e/configuration/attributes/createContentAttribute.js index 64ad41834..410453167 100644 --- a/cypress/e2e/configuration/attributes/createContentAttribute.js +++ b/cypress/e2e/configuration/attributes/createContentAttribute.js @@ -6,64 +6,62 @@ import faker from "faker"; import { ATTRIBUTES_DETAILS } from "../../../elements/attribute/attributes_details"; import { ATTRIBUTES_LIST } from "../../../elements/attribute/attributes_list"; import { urlList } from "../../../fixtures/urlList"; -import { - createAttribute, - getAttribute -} from "../../../support/api/requests/Attribute"; +import { getAttribute } from "../../../support/api/requests/Attribute"; import { deleteAttributesStartsWith } from "../../../support/api/utils/attributes/attributeUtils"; import { expectCorrectDataInAttribute } from "../../../support/api/utils/attributes/checkAttributeData"; -import filterTests from "../../../support/filterTests"; import { createAttributeWithInputType } from "../../../support/pages/attributesPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("As an admin I want to create content attribute", () => { - const startsWith = "AttrCont"; - const attributesTypes = [ - { type: "DROPDOWN", testCase: "SALEOR_0512" }, - { type: "MULTISELECT", testCase: "SALEOR_0513" }, - { type: "FILE", testCase: "SALEOR_0514" }, - { type: "RICH_TEXT", testCase: "SALEOR_0515" }, - { type: "BOOLEAN", testCase: "SALEOR_0516" }, - { type: "DATE", testCase: "SALEOR_0527" }, - { type: "DATE_TIME", testCase: "SALEOR_0528" } - ]; - const attributeReferenceType = [ - { type: "PRODUCT", testCase: "SALEOR_0517" }, - { type: "PAGE", testCase: "SALEOR_0518" } - ]; - const attributeNumericType = [ - { - unitSystem: "IMPERIAL", - unitsOf: "DISTANCE", - unit: "FT", - testCase: "SALEOR_0519" - }, - { - unitSystem: "METRIC", - unitsOf: "VOLUME", - unit: "CUBIC_CENTIMETER", - testCase: "SALEOR_0520" - }, - { unitSystem: "without selecting unit", testCase: "SALEOR_0521" } - ]; +describe("As an admin I want to create content attribute", () => { + const startsWith = "AttrCont"; + const attributesTypes = [ + { type: "DROPDOWN", testCase: "SALEOR_0512" }, + { type: "MULTISELECT", testCase: "SALEOR_0513" }, + { type: "FILE", testCase: "SALEOR_0514" }, + { type: "RICH_TEXT", testCase: "SALEOR_0515" }, + { type: "BOOLEAN", testCase: "SALEOR_0516" }, + { type: "DATE", testCase: "SALEOR_0527" }, + { type: "DATE_TIME", testCase: "SALEOR_0528" } + ]; + const attributeReferenceType = [ + { type: "PRODUCT", testCase: "SALEOR_0517" }, + { type: "PAGE", testCase: "SALEOR_0518" } + ]; + const attributeNumericType = [ + { + unitSystem: "IMPERIAL", + unitsOf: "DISTANCE", + unit: "FT", + testCase: "SALEOR_0519" + }, + { + unitSystem: "METRIC", + unitsOf: "VOLUME", + unit: "CUBIC_CENTIMETER", + testCase: "SALEOR_0520" + }, + { unitSystem: "without selecting unit", testCase: "SALEOR_0521" } + ]; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteAttributesStartsWith(startsWith); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteAttributesStartsWith(startsWith); + }); - beforeEach(() => { - cy.clearSessionData() - .loginUserViaRequest() - .visit(urlList.attributes) - .get(ATTRIBUTES_LIST.createAttributeButton) - .click() - .get(ATTRIBUTES_DETAILS.pageTypeAttributeCheckbox) - .click(); - }); + beforeEach(() => { + cy.clearSessionData() + .loginUserViaRequest() + .visit(urlList.attributes) + .get(ATTRIBUTES_LIST.createAttributeButton) + .click() + .get(ATTRIBUTES_DETAILS.pageTypeAttributeCheckbox) + .click(); + }); - attributesTypes.forEach(attributeType => { - it(`should be able to create ${attributeType.type} attribute. TC:${attributeType.testCase}`, () => { + attributesTypes.forEach(attributeType => { + it( + `should be able to create ${attributeType.type} attribute. TC:${attributeType.testCase}`, + { tags: ["@attribute", "@allEnv"] }, + () => { const attributeName = `${startsWith}${faker.datatype.number()}`; createAttributeWithInputType({ name: attributeName, @@ -78,11 +76,15 @@ filterTests({ definedTags: ["all"] }, () => { attributeType: attributeType.type }); }); - }); - }); + } + ); + }); - attributeReferenceType.forEach(entityType => { - it(`should be able to create reference to ${entityType.type} attribute. TC:${entityType.testCase}`, () => { + attributeReferenceType.forEach(entityType => { + it( + `should be able to create reference to ${entityType.type} attribute. TC:${entityType.testCase}`, + { tags: ["@attribute", "@allEnv"] }, + () => { const attributeType = "REFERENCE"; const attributeName = `${startsWith}${faker.datatype.number()}`; createAttributeWithInputType({ @@ -100,11 +102,15 @@ filterTests({ definedTags: ["all"] }, () => { entityType: entityType.type }); }); - }); - }); + } + ); + }); - attributeNumericType.forEach(numericSystemType => { - it(`should be able to create numeric ${numericSystemType.unitSystem} attribute. TC: ${numericSystemType.testCase}`, () => { + attributeNumericType.forEach(numericSystemType => { + it( + `should be able to create numeric ${numericSystemType.unitSystem} attribute. TC: ${numericSystemType.testCase}`, + { tags: ["@attribute", "@allEnv"] }, + () => { const attributeType = "NUMERIC"; const attributeName = `${startsWith}${faker.datatype.number()}`; createAttributeWithInputType({ @@ -122,10 +128,14 @@ filterTests({ definedTags: ["all"] }, () => { unit: numericSystemType.unit }); }); - }); - }); + } + ); + }); - it("should be able to create attribute without require value TC:SALEOR_0522", () => { + it( + "should be able to create attribute without require value TC:SALEOR_0522", + { tags: ["@attribute", "@allEnv"] }, + () => { const attributeType = "BOOLEAN"; const attributeName = `${startsWith}${faker.datatype.number()}`; createAttributeWithInputType({ @@ -143,6 +153,6 @@ filterTests({ definedTags: ["all"] }, () => { valueRequired: false }); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/attributes/createProductAttributes.js b/cypress/e2e/configuration/attributes/createProductAttributes.js index 759da001e..cd70594ca 100644 --- a/cypress/e2e/configuration/attributes/createProductAttributes.js +++ b/cypress/e2e/configuration/attributes/createProductAttributes.js @@ -13,59 +13,60 @@ import { } from "../../../support/api/requests/Attribute"; import { deleteAttributesStartsWith } from "../../../support/api/utils/attributes/attributeUtils"; import { expectCorrectDataInAttribute } from "../../../support/api/utils/attributes/checkAttributeData"; -import filterTests from "../../../support/filterTests"; import { createAttributeWithInputType, fillUpAttributeNameAndCode } from "../../../support/pages/attributesPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("As an admin I want to create product attribute", () => { - const startsWith = "AttrCreate"; - const attributesTypes = [ - { type: "DROPDOWN", testCase: "SALEOR_0501" }, - { type: "MULTISELECT", testCase: "SALEOR_0502" }, - { type: "FILE", testCase: "SALEOR_0503" }, - { type: "RICH_TEXT", testCase: "SALEOR_0504" }, - { type: "BOOLEAN", testCase: "SALEOR_0505" }, - { type: "DATE", testCase: "SALEOR_0523" }, - { type: "DATE_TIME", testCase: "SALEOR_0524" } - ]; - const attributeReferenceType = [ - { type: "PRODUCT", testCase: "SALEOR_0506" }, - { type: "PAGE", testCase: "SALEOR_0507" } - ]; - const attributeNumericType = [ - { - unitSystem: "IMPERIAL", - unitsOf: "DISTANCE", - unit: "FT", - testCase: "SALEOR_0508" - }, - { - unitSystem: "METRIC", - unitsOf: "VOLUME", - unit: "CUBIC_CENTIMETER", - testCase: "SALEOR_0509" - }, - { unitSystem: "without selecting unit", testCase: "SALEOR_0510" } - ]; +describe("As an admin I want to create product attribute", () => { + const startsWith = "AttrCreate"; + const attributesTypes = [ + { type: "DROPDOWN", testCase: "SALEOR_0501" }, + { type: "MULTISELECT", testCase: "SALEOR_0502" }, + { type: "FILE", testCase: "SALEOR_0503" }, + { type: "RICH_TEXT", testCase: "SALEOR_0504" }, + { type: "BOOLEAN", testCase: "SALEOR_0505" }, + { type: "DATE", testCase: "SALEOR_0523" }, + { type: "DATE_TIME", testCase: "SALEOR_0524" } + ]; + const attributeReferenceType = [ + { type: "PRODUCT", testCase: "SALEOR_0506" }, + { type: "PAGE", testCase: "SALEOR_0507" } + ]; + const attributeNumericType = [ + { + unitSystem: "IMPERIAL", + unitsOf: "DISTANCE", + unit: "FT", + testCase: "SALEOR_0508" + }, + { + unitSystem: "METRIC", + unitsOf: "VOLUME", + unit: "CUBIC_CENTIMETER", + testCase: "SALEOR_0509" + }, + { unitSystem: "without selecting unit", testCase: "SALEOR_0510" } + ]; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteAttributesStartsWith(startsWith); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteAttributesStartsWith(startsWith); + }); - beforeEach(() => { - cy.clearSessionData() - .loginUserViaRequest() - .visit(urlList.attributes) - .get(ATTRIBUTES_LIST.createAttributeButton) - .click(); - }); + beforeEach(() => { + cy.clearSessionData() + .loginUserViaRequest() + .visit(urlList.attributes) + .get(ATTRIBUTES_LIST.createAttributeButton) + .click(); + }); - attributesTypes.forEach(attributeType => { - it(`should be able to create ${attributeType.type} attribute. TC:${attributeType.testCase}`, () => { + attributesTypes.forEach(attributeType => { + it( + `should be able to create ${attributeType.type} attribute. TC:${attributeType.testCase}`, + { tags: ["@attribute", "@allEnv"] }, + () => { const attributeName = `${startsWith}${faker.datatype.number()}`; createAttributeWithInputType({ @@ -81,11 +82,15 @@ filterTests({ definedTags: ["all"] }, () => { attributeType: attributeType.type }); }); - }); - }); + } + ); + }); - attributeReferenceType.forEach(entityType => { - it(`should be able to create ${entityType.type} attribute. TC:${entityType.testCase}`, () => { + attributeReferenceType.forEach(entityType => { + it( + `should be able to create ${entityType.type} attribute. TC:${entityType.testCase}`, + { tags: ["@attribute", "@allEnv", "@stable"] }, + () => { const attributeType = "REFERENCE"; const attributeName = `${startsWith}${faker.datatype.number()}`; @@ -104,11 +109,15 @@ filterTests({ definedTags: ["all"] }, () => { entityType: entityType.type }); }); - }); - }); + } + ); + }); - attributeNumericType.forEach(numericSystemType => { - it(`should be able to create numeric ${numericSystemType.unitSystem} attribute. TC:${numericSystemType.testCase}`, () => { + attributeNumericType.forEach(numericSystemType => { + it( + `should be able to create numeric ${numericSystemType.unitSystem} attribute. TC:${numericSystemType.testCase}`, + { tags: ["@attribute", "@allEnv"] }, + () => { const attributeType = "NUMERIC"; const attributeName = `${startsWith}${faker.datatype.number()}`; @@ -127,10 +136,14 @@ filterTests({ definedTags: ["all"] }, () => { unit: numericSystemType.unit }); }); - }); - }); + } + ); + }); - it("should be able to create attribute without require value. TC:SALEOR_0511", () => { + it( + "should be able to create attribute without require value. TC:SALEOR_0511", + { tags: ["@attribute", "@allEnv", "@stable"] }, + () => { const attributeType = "BOOLEAN"; const attributeName = `${startsWith}${faker.datatype.number()}`; @@ -149,9 +162,13 @@ filterTests({ definedTags: ["all"] }, () => { valueRequired: false }); }); - }); + } + ); - it("should create swatch attribute. TC:SALEOR_0531", () => { + it( + "should create swatch attribute. TC:SALEOR_0531", + { tags: ["@attribute", "@allEnv", "@stable"] }, + () => { const attributeType = "SWATCH"; const attributeName = `${startsWith}${faker.datatype.number()}`; createAttributeWithInputType({ @@ -168,9 +185,13 @@ filterTests({ definedTags: ["all"] }, () => { valueRequired: true }); }); - }); + } + ); - it("should create swatch attribute with image. TC:SALEOR_0532", () => { + it( + "should create swatch attribute with image. TC:SALEOR_0532", + { tags: ["@attribute", "@allEnv", "@stable"] }, + () => { const attributeType = "SWATCH"; const attributeName = `${startsWith}${faker.datatype.number()}`; const swatchImage = "images/saleorDemoProductSneakers.png"; @@ -192,9 +213,13 @@ filterTests({ definedTags: ["all"] }, () => { .invoke("attr", "style") .should("include", "saleorDemoProductSneakers"); }); - }); + } + ); - it("should be able delete product attribute. TC:SALEOR_0525", () => { + it( + "should be able delete product attribute. TC:SALEOR_0525", + { tags: ["@attribute", "@allEnv", "@stable"] }, + () => { const attributeName = `${startsWith}${faker.datatype.number()}`; createAttribute({ @@ -209,9 +234,13 @@ filterTests({ definedTags: ["all"] }, () => { .waitForRequestAndCheckIfNoErrors("@AttributeDelete"); getAttribute(attribute.id).should("be.null"); }); - }); + } + ); - it("should be able update product attribute. TC:SALEOR_0526", () => { + it( + "should be able update product attribute. TC:SALEOR_0526", + { tags: ["@attribute", "@allEnv", "@stable"] }, + () => { const attributeName = `${startsWith}${faker.datatype.number()}`; const attributeUpdatedName = `${startsWith}${faker.datatype.number()}`; @@ -231,6 +260,6 @@ filterTests({ definedTags: ["all"] }, () => { expect(attribute.name).to.eq(attributeUpdatedName); expect(attribute.slug).to.eq(attributeUpdatedName); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/attributes/deleteAndUpdateContentAttribute.js b/cypress/e2e/configuration/attributes/deleteAndUpdateContentAttribute.js index 02b9acd6d..e807123ed 100644 --- a/cypress/e2e/configuration/attributes/deleteAndUpdateContentAttribute.js +++ b/cypress/e2e/configuration/attributes/deleteAndUpdateContentAttribute.js @@ -10,30 +10,31 @@ import { getAttribute } from "../../../support/api/requests/Attribute"; import { deleteAttributesStartsWith } from "../../../support/api/utils/attributes/attributeUtils"; -import filterTests from "../../../support/filterTests"; import { fillUpAttributeNameAndCode } from "../../../support/pages/attributesPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("As an admin I want to delete and update content attribute", () => { - const startsWith = "AttrContDel"; - let attribute; +describe("As an admin I want to delete and update content attribute", () => { + const startsWith = "AttrContDel"; + let attribute; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteAttributesStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteAttributesStartsWith(startsWith); + }); + + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + createAttribute({ + name: `${startsWith}${faker.datatype.number()}`, + type: "PAGE_TYPE" + }).then(attributeResp => { + attribute = attributeResp; }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - createAttribute({ - name: `${startsWith}${faker.datatype.number()}`, - type: "PAGE_TYPE" - }).then(attributeResp => { - attribute = attributeResp; - }); - }); - - it("should be able delete content attribute. TC:SALEOR_0529", () => { + it( + "should be able delete content attribute. TC:SALEOR_0529", + { tags: ["@attribute", "@allEnv", "@stable"] }, + () => { cy.visit(attributeDetailsUrl(attribute.id)) .get(BUTTON_SELECTORS.deleteButton) .click() @@ -42,9 +43,13 @@ filterTests({ definedTags: ["all"] }, () => { .click() .waitForRequestAndCheckIfNoErrors("@AttributeDelete"); getAttribute(attribute.id).should("be.null"); - }); + } + ); - it("should be able update content attribute. TC:SALEOR_0530", () => { + it( + "should be able update content attribute. TC:SALEOR_0530", + { tags: ["@attribute", "@allEnv", "@stable"] }, + () => { const attributeUpdatedName = `${startsWith}${faker.datatype.number()}`; cy.visit(attributeDetailsUrl(attribute.id)); @@ -57,6 +62,6 @@ filterTests({ definedTags: ["all"] }, () => { expect(attributeResp.name).to.eq(attributeUpdatedName); expect(attributeResp.slug).to.eq(attributeUpdatedName); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/attributes/filters.js b/cypress/e2e/configuration/attributes/filters.js index 17d09eeb3..4c4c7a437 100644 --- a/cypress/e2e/configuration/attributes/filters.js +++ b/cypress/e2e/configuration/attributes/filters.js @@ -19,35 +19,37 @@ import { showFilters } from "../../../support/pages/catalog/products/productsListPage"; -filterTests({ definedTags: ["all"] }, () => { - xdescribe("Tests for using attributes in filters", () => { - const startsWith = "AttrFilter"; +xdescribe("Tests for using attributes in filters", () => { + const startsWith = "AttrFilter"; - let attribute; + let attribute; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteProductsStartsWith(startsWith); - createTypeAttributeAndCategoryForProduct({ - name: startsWith, - attributeValues: [startsWith] - }).then(({ attribute: attributeResp, category, productType }) => { - attribute = attributeResp; - createProduct({ - attributeId: attribute.id, - attributeValue: startsWith, - categoryId: category.id, - productTypeId: productType.id, - name: startsWith - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteProductsStartsWith(startsWith); + createTypeAttributeAndCategoryForProduct({ + name: startsWith, + attributeValues: [startsWith] + }).then(({ attribute: attributeResp, category, productType }) => { + attribute = attributeResp; + createProduct({ + attributeId: attribute.id, + attributeValue: startsWith, + categoryId: category.id, + productTypeId: productType.id, + name: startsWith }); }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should use attribute as filter", () => { + it( + "should use attribute as filter", + { tags: ["@attribute", "@allEnv"] }, + () => { updateAttribute({ attributeId: attribute.id, filterableInDashboard: false @@ -58,9 +60,13 @@ filterTests({ definedTags: ["all"] }, () => { cy.contains(SHARED_ELEMENTS.tableRow, attribute.name).should( "be.visible" ); - }); + } + ); - it("should remove attribute from filters", () => { + it( + "should remove attribute from filters", + { tags: ["@attribute", "@allEnv"] }, + () => { updateAttribute({ attributeId: attribute.id, filterableInDashboard: true @@ -69,6 +75,6 @@ filterTests({ definedTags: ["all"] }, () => { enterProductListPage(); showFilters(); cy.get(getElementByDataTestId(attribute.name)).should("not.exist"); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/channels/channels.js b/cypress/e2e/configuration/channels/channels.js index 16e3bdf78..7cbde1e06 100644 --- a/cypress/e2e/configuration/channels/channels.js +++ b/cypress/e2e/configuration/channels/channels.js @@ -18,38 +18,38 @@ import { } from "../../../support/api/requests/ShippingMethod"; import { deleteChannelsStartsWith } from "../../../support/api/utils/channelsUtils"; import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils"; -import filterTests from "../../../support/filterTests"; import { createChannelByView } from "../../../support/pages/channelsPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("Channels", () => { - const channelStartsWith = `CyChannels`; - const randomName = `${channelStartsWith} ${faker.datatype.number()}`; - const currency = "PLN"; - const defaultCountry = "Poland"; - let shippingZone; +describe("Channels", () => { + const channelStartsWith = `CyChannels`; + const randomName = `${channelStartsWith} ${faker.datatype.number()}`; + const currency = "PLN"; + let shippingZone; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteChannelsStartsWith(channelStartsWith); - deleteShippingStartsWith(channelStartsWith); - createShippingZone(randomName, "US").then(shippingZoneResp => { - shippingZone = shippingZoneResp; - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteChannelsStartsWith(channelStartsWith); + deleteShippingStartsWith(channelStartsWith); + createShippingZone(randomName, "US").then(shippingZoneResp => { + shippingZone = shippingZoneResp; }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest( - "auth", - ONE_PERMISSION_USERS.channel - ); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest( + "auth", + ONE_PERMISSION_USERS.channel + ); + }); - it("should create new channel", () => { + it( + "should create new channel. TC: SALEOR_0701", + { tags: ["@channel", "@allEnv", "@stable"] }, + () => { const randomChannel = `${channelStartsWith} ${faker.datatype.number()}`; cy.addAliasToGraphRequest("Channels"); cy.visit(urlList.channels); - cy.softExpectSkeletonIsVisible(); + cy.expectSkeletonIsVisible(); cy.waitForRequestAndCheckIfNoErrors("@Channels"); createChannelByView({ name: randomChannel, currency }); cy.waitForRequestAndCheckIfNoErrors("@Channel"); @@ -83,16 +83,20 @@ filterTests({ definedTags: ["all"] }, () => { .click() .get(SELECT_CHANNELS_TO_ASSIGN.listOfChannels) .contains(randomChannel); - }); + } + ); - it("should create channel with shippingZone", () => { + it( + "should create channel with shippingZone. TC: SALEOR_0702", + { tags: ["@channel", "@allEnv"] }, + () => { // remove login after fixing SALEOR-3162 cy.clearSessionData().loginUserViaRequest(); const randomChannel = `${channelStartsWith} ${faker.datatype.number()}`; cy.addAliasToGraphRequest("Channels"); cy.visit(urlList.channels); - cy.softExpectSkeletonIsVisible(); + cy.expectSkeletonIsVisible(); cy.wait("@Channels"); createChannelByView({ name: randomChannel, @@ -106,9 +110,13 @@ filterTests({ definedTags: ["all"] }, () => { ); expect(assignedChannel).to.be.ok; }); - }); + } + ); - it("should validate slug name", () => { + it( + "should validate slug name. TC: SALEOR_0703", + { tags: ["@channel", "@allEnv", "@stable"] }, + () => { const randomChannel = `${channelStartsWith} ${faker.datatype.number()}`; createChannel({ isActive: false, @@ -117,17 +125,21 @@ filterTests({ definedTags: ["all"] }, () => { currencyCode: currency }); cy.visit(urlList.channels); - cy.softExpectSkeletonIsVisible(); + cy.expectSkeletonIsVisible(); createChannelByView({ name: randomChannel, currency }); cy.get(ADD_CHANNEL_FORM_SELECTORS.slugValidationMessage).should( "be.visible" ); - }); + } + ); - it("should validate duplicated currency", () => { + it( + "should validate not existing currency. TC: SALEOR_0704", + { tags: ["@channel", "@allEnv", "@stable"] }, + () => { const randomChannel = `${channelStartsWith} ${faker.datatype.number()}`; cy.visit(urlList.channels); - cy.softExpectSkeletonIsVisible(); + cy.expectSkeletonIsVisible(); createChannelByView({ name: randomChannel, currency: "notExistingCurrency" @@ -135,9 +147,13 @@ filterTests({ definedTags: ["all"] }, () => { cy.get(ADD_CHANNEL_FORM_SELECTORS.currencyValidationMessage).should( "be.visible" ); - }); + } + ); - it("should delete channel", () => { + it( + "should delete channel. TC: SALEOR_0705", + { tags: ["@channel", "@allEnv", "@stable"] }, + () => { const randomChannelToDelete = `${channelStartsWith} ${faker.datatype.number()}`; createChannel({ isActive: false, @@ -147,7 +163,7 @@ filterTests({ definedTags: ["all"] }, () => { }); cy.addAliasToGraphRequest("Channels"); cy.visit(urlList.channels); - cy.softExpectSkeletonIsVisible(); + cy.expectSkeletonIsVisible(); cy.wait("@Channels"); cy.contains(CHANNELS_SELECTORS.channelName, randomChannelToDelete) .parentsUntil(CHANNELS_SELECTORS.channelsTable) @@ -160,6 +176,6 @@ filterTests({ definedTags: ["all"] }, () => { cy.get(CHANNELS_SELECTORS.channelName) .contains(randomChannelToDelete) .should("not.exist"); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/channels/inactiveChannel.js b/cypress/e2e/configuration/channels/inactiveChannel.js index 6e28bc653..c4015354d 100644 --- a/cypress/e2e/configuration/channels/inactiveChannel.js +++ b/cypress/e2e/configuration/channels/inactiveChannel.js @@ -23,41 +23,42 @@ import { deleteProductsStartsWith } from "../../../support/api/utils/products/productsUtils"; import { isProductVisible } from "../../../support/api/utils/storeFront/storeFrontProductUtils"; -import filterTests from "../../../support/filterTests"; -filterTests({ definedTags: ["all"] }, () => { - describe("Tests on inactive channel", () => { - const channelStartsWith = `InactiveChannel`; - const randomName = `${channelStartsWith}${faker.datatype.number()}`; - const currency = "PLN"; +describe("Tests on inactive channel", () => { + const channelStartsWith = `InactiveChannel`; + const randomName = `${channelStartsWith}${faker.datatype.number()}`; + const currency = "PLN"; - let address; - let defaultChannel; - let newChannel; + let address; + let defaultChannel; + let newChannel; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteChannelsStartsWith(channelStartsWith); - deleteProductsStartsWith(channelStartsWith); - cy.fixture("addresses").then(({ plAddress }) => { - address = plAddress; - }); - getDefaultChannel().then(channel => (defaultChannel = channel)); - createChannel({ - isActive: false, - name: randomName, - slug: randomName, - currencyCode: currency - }).then(channel => { - newChannel = channel; - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteChannelsStartsWith(channelStartsWith); + deleteProductsStartsWith(channelStartsWith); + cy.fixture("addresses").then(({ plAddress }) => { + address = plAddress; }); - - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); + getDefaultChannel().then(channel => (defaultChannel = channel)); + createChannel({ + isActive: false, + name: randomName, + slug: randomName, + currencyCode: currency + }).then(channel => { + newChannel = channel; }); + }); - it("should not be possible to add products to order with inactive channel", () => { + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); + + it( + "should not be possible to add products to order with inactive channel. TC: SALEOR_0706", + { tags: ["@channel", "@allEnv"] }, + () => { cy.visit(urlList.orders) .get(ORDERS_SELECTORS.createOrder) .click() @@ -75,9 +76,13 @@ filterTests({ definedTags: ["all"] }, () => { }) .get(DRAFT_ORDER_SELECTORS.addProducts) .should("not.exist"); - }); + } + ); - it("should not be possible to create checkout with inactive channel", () => { + it( + "should not be possible to create checkout with inactive channel. TC: SALEOR_0707", + { tags: ["@channel", "@allEnv", "@stable"] }, + () => { const randomChannel = `${channelStartsWith}${faker.datatype.number()}`; createTypeAttributeAndCategoryForProduct({ name: randomChannel }) .then(({ productType, attribute, category }) => { @@ -103,9 +108,13 @@ filterTests({ definedTags: ["all"] }, () => { "checkout shouldn't be created with error in field channel" ).to.have.property("field", "channel"); }); - }); + } + ); - it("products in inactive channel should not be displayed", () => { + it( + "products in inactive channel should not be displayed. TC: SALEOR_0708", + { tags: ["@channel", "@allEnv", "@stable"] }, + () => { const randomChannel = `${channelStartsWith}${faker.datatype.number()}`; let channel; let product; @@ -151,6 +160,6 @@ filterTests({ definedTags: ["all"] }, () => { "product with active channel should be visible" ).to.be.eq(true); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/customer.js b/cypress/e2e/configuration/customer.js index 01969ef04..00709c529 100644 --- a/cypress/e2e/configuration/customer.js +++ b/cypress/e2e/configuration/customer.js @@ -8,35 +8,35 @@ import { CUSTOMERS_LIST } from "../../elements/customer/customers-list"; import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; import { SHARED_ELEMENTS } from "../../elements/shared/sharedElements"; import { customerDetailsUrl, urlList } from "../../fixtures/urlList"; -import { ONE_PERMISSION_USERS } from "../../fixtures/users"; import { addressCreate, createCustomer, deleteCustomersStartsWith, getCustomer } from "../../support/api/requests/Customer"; -import filterTests from "../../support/filterTests"; -filterTests({ definedTags: ["all"] }, () => { - describe("Tests for customer", () => { - const startsWith = `Customers`; - let address; - let secondAddress; +describe("Tests for customer", () => { + const startsWith = `Customers`; + let address; + let secondAddress; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteCustomersStartsWith(startsWith); - cy.fixture("addresses").then(({ usAddress, secondUsAddress }) => { - address = usAddress; - secondAddress = secondUsAddress; - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteCustomersStartsWith(startsWith); + cy.fixture("addresses").then(({ usAddress, secondUsAddress }) => { + address = usAddress; + secondAddress = secondUsAddress; }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should create customer", () => { + it( + "should create customer. TC: SALEOR_1201", + { tags: ["@customer", "@allEnv", "@stable"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; const email = `${randomName}@example.com`; const note = faker.lorem.paragraph(); @@ -65,19 +65,23 @@ filterTests({ definedTags: ["all"] }, () => { getCustomer(customer.id); }) .then(customer => { - chai - .softExpect(customer.firstName, "Expect correct first name") - .to.eq(randomName); - chai - .softExpect(customer.lastName, "Expect correct last name") - .to.eq(randomName); - chai.softExpect(customer.email, "Expect correct email").to.eq(email); - chai.softExpect(customer.note, "Expect correct note").to.eq(note); + expect(customer.firstName, "Expect correct first name").to.eq( + randomName + ); + expect(customer.lastName, "Expect correct last name").to.eq( + randomName + ); + expect(customer.email, "Expect correct email").to.eq(email); + expect(customer.note, "Expect correct note").to.eq(note); cy.expectCorrectFullAddress(customer.addresses[0], address); }); - }); + } + ); - it("should add address to customer", () => { + it( + "should add address to customer. TC: SALEOR_1204", + { tags: ["@customer", "@allEnv", "@stable"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; const email = `${randomName}@example.com`; @@ -95,9 +99,13 @@ filterTests({ definedTags: ["all"] }, () => { cy.expectCorrectFullAddress(addresses[0], secondAddress); }); }); - }); + } + ); - it("should remove address from customer", () => { + it( + "should remove address from customer. TC: SALEOR_1205", + { tags: ["@customer", "@allEnv", "@stable"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; const email = `${randomName}@example.com`; @@ -120,9 +128,13 @@ filterTests({ definedTags: ["all"] }, () => { expect(addresses).to.have.length(1); }); }); - }); + } + ); - it("should set address as default", () => { + it( + "should set address as default. TC: SALEOR_1206", + { tags: ["@customer", "@allEnv", "@stable"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; const email = `${randomName}@example.com`; let user; @@ -147,7 +159,7 @@ filterTests({ definedTags: ["all"] }, () => { getCustomer(user.id); }) .then(({ addresses }) => { - chai.softExpect(addresses[0].isDefaultShippingAddress).to.eq(true); + expect(addresses[0].isDefaultShippingAddress).to.eq(true); cy.get(BUTTON_SELECTORS.showMoreButton) .should("be.enabled") .click() @@ -160,9 +172,13 @@ filterTests({ definedTags: ["all"] }, () => { .then(({ addresses }) => { expect(addresses[0].isDefaultBillingAddress).to.be.true; }); - }); + } + ); - it("should update address", () => { + it( + "should update address. TC: SALEOR_1208", + { tags: ["@customer", "@allEnv", "@stable"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; const email = `${randomName}@example.com`; @@ -188,9 +204,13 @@ filterTests({ definedTags: ["all"] }, () => { cy.expectCorrectFullAddress(addedAddress, secondAddress); }); }); - }); + } + ); - it("should delete customer", () => { + it( + "should delete customer. TC: SALEOR_1203", + { tags: ["@customer", "@allEnv", "@stable"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; const email = `${randomName}@example.com`; @@ -204,9 +224,13 @@ filterTests({ definedTags: ["all"] }, () => { .wait("@RemoveCustomer"); getCustomer(user.id).should("be.null"); }); - }); + } + ); - it("should deactivate customer", () => { + it( + "should deactivate customer. TC: SALEOR_1209", + { tags: ["@customer", "@allEnv", "@stable"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; const email = `${randomName}@example.com`; @@ -222,9 +246,13 @@ filterTests({ definedTags: ["all"] }, () => { expect(isActive).to.be.false; }); }); - }); + } + ); - it("should update customer", () => { + it( + "should update customer. TC: SALEOR_1202", + { tags: ["@customer", "@allEnv", "@stable"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; const updatedName = `${startsWith}UpdatedName`; const email = `${randomName}@example.com`; @@ -244,18 +272,16 @@ filterTests({ definedTags: ["all"] }, () => { .click() .wait("@UpdateCustomer"); getCustomer(user.id).then(user => { - chai - .softExpect(user.firstName, "Expect correct first name") - .to.eq(updatedName); - chai - .softExpect(user.lastName, "Expect correct last name") - .to.eq(updatedName); - chai - .softExpect(user.email, "Expect correct email") - .to.eq(`${updatedName}@example.com`); - chai.softExpect(user.note, "Expect correct note").to.eq(updatedName); + expect(user.firstName, "Expect correct first name").to.eq( + updatedName + ); + expect(user.lastName, "Expect correct last name").to.eq(updatedName); + expect(user.email, "Expect correct email").to.eq( + `${updatedName}@example.com` + ); + expect(user.note, "Expect correct note").to.eq(updatedName); }); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/navigation.js b/cypress/e2e/configuration/navigation.js index db721300e..ea73e9cf7 100644 --- a/cypress/e2e/configuration/navigation.js +++ b/cypress/e2e/configuration/navigation.js @@ -8,33 +8,35 @@ import { getMenu } from "../../support/api/requests/Menu"; import { deleteMenusStartsWith } from "../../support/api/utils/navigationUtils"; -import filterTests from "../../support/filterTests"; import { createMenu, createNewMenuItem, MENU_ITEM_TYPES } from "../../support/pages/navigationPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("Tests for menu navigation", () => { - const startsWith = "Navigation"; - const randomName = `${startsWith}${faker.datatype.number()}`; +describe("Tests for menu navigation", () => { + const startsWith = "Navigation"; + const randomName = `${startsWith}${faker.datatype.number()}`; + let testCase = 1301; - let menu; + let menu; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteMenusStartsWith(startsWith); - createMenuViaApi(randomName).then( - ({ menu: menuResp }) => (menu = menuResp) - ); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteMenusStartsWith(startsWith); + createMenuViaApi(randomName).then( + ({ menu: menuResp }) => (menu = menuResp) + ); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should create a menu", () => { + it( + "should create a menu. TC: SALEOR_1301", + { tags: ["@menuNavigation", "@allEnv", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; createMenu(name) @@ -44,10 +46,15 @@ filterTests({ definedTags: ["all"] }, () => { .then(menuResp => { expect(menuResp.name).to.eq(name); }); - }); + } + ); - ["category", "collection", "page"].forEach(itemType => { - it(`should add new ${itemType} item to menu`, () => { + ["category", "collection", "page"].forEach(itemType => { + testCase += 1; + it( + `should add new ${itemType} item to menu. TC: SALEOR_${testCase}`, + { tags: ["@menuNavigation", "@allEnv", "@stable"] }, + () => { const itemName = `${startsWith}${faker.datatype.number()}`; let selectedItem; @@ -66,7 +73,7 @@ filterTests({ definedTags: ["all"] }, () => { const name = itemType !== "page" ? "name" : "title"; expect(itemOfType[name]).to.eq(selectedItem); }); - }); - }); + } + ); }); }); diff --git a/cypress/e2e/configuration/permissions.js b/cypress/e2e/configuration/permissions.js index 56f133413..387b4260e 100644 --- a/cypress/e2e/configuration/permissions.js +++ b/cypress/e2e/configuration/permissions.js @@ -21,20 +21,22 @@ import { getStaffMembersStartsWith } from "../../support/api/requests/StaffMembe import { deletePermissionGroupsStartsWith } from "../../support/api/utils/permissionGroupUtils.js"; import filterTests from "../../support/filterTests.js"; -filterTests({ definedTags: ["all"] }, () => { - describe("Permissions groups", () => { - const startsWith = "CyPermissions-"; +describe("Permissions groups", () => { + const startsWith = "CyPermissions-"; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deletePermissionGroupsStartsWith(startsWith); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deletePermissionGroupsStartsWith(startsWith); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should create permission group", () => { + it( + "should create permission group. TC: SALEOR_1401", + { tags: ["@permissions", "@allEnv", "@stable"] }, + () => { const permissionName = `${startsWith}${faker.datatype.number()}`; cy.visit(urlList.permissionsGroups) @@ -59,9 +61,13 @@ filterTests({ definedTags: ["all"] }, () => { PERMISSION_GROUP_LIST.permissionGroupRow, permissionName ).should("be.visible"); - }); + } + ); - it("should delete permission group", () => { + it( + "should delete permission group. TC: SALEOR_1402", + { tags: ["@permissions", "@allEnv"] }, + () => { const permissionName = `${startsWith}${faker.datatype.number()}`; let staffMember; getStaffMembersStartsWith(TEST_ADMIN_USER.email) @@ -86,9 +92,13 @@ filterTests({ definedTags: ["all"] }, () => { cy.get(SHARED_ELEMENTS.header).should("be.visible"); cy.contains(permissionName).should("not.exist"); }); - }); + } + ); - xit("should add user to permission group", () => { + xit( + "should add user to permission group. TC: SALEOR_1403", + { tags: ["@permissions", "@allEnv"] }, + () => { const permissionName = `${startsWith}${faker.datatype.number()}`; createPermissionGroup({ name: permissionName, @@ -119,9 +129,13 @@ filterTests({ definedTags: ["all"] }, () => { expect(resp.users).to.have.length(1); expect(resp.users[0].email).to.be.eq(TEST_ADMIN_USER.email); }); - }); + } + ); - it("should remove user from permission group", () => { + it( + "should remove user from permission group. TC: SALEOR_1404", + { tags: ["@permissions", "@allEnv", "@stable"] }, + () => { const permissionName = `${startsWith}${faker.datatype.number()}`; let staffMember; getStaffMembersStartsWith(TEST_ADMIN_USER.email) @@ -148,6 +162,6 @@ filterTests({ definedTags: ["all"] }, () => { cy.get(SHARED_ELEMENTS.header).should("be.visible"); cy.contains(permissionName).should("not.exist"); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/plugins/adyen.js b/cypress/e2e/configuration/plugins/adyen.js index f261fde75..ebc07bd96 100644 --- a/cypress/e2e/configuration/plugins/adyen.js +++ b/cypress/e2e/configuration/plugins/adyen.js @@ -23,98 +23,99 @@ import { createShipping, deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils"; -import filterTests from "../../../support/filterTests"; -filterTests({ definedTags: ["stagedOnly"] }, () => { - describe("Adyen payments", () => { - const startsWith = "CyChannelInDraftOrders-"; - const name = startsWith + faker.datatype.number(); - const email = `CyChannelInDraftOrders@example.com`; +describe("Adyen payments", () => { + const startsWith = "CyChannelInDraftOrders-"; + const name = startsWith + faker.datatype.number(); + const email = `CyChannelInDraftOrders@example.com`; - let address; - let defaultChannel; - let warehouse; - let shippingMethod; - let variantsList; - let checkout; - let paymentCards; - let cardData; + let address; + let defaultChannel; + let warehouse; + let shippingMethod; + let variantsList; + let checkout; + let paymentCards; + let cardData; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteProductsStartsWith(startsWith); - deleteShippingStartsWith(startsWith); - cy.fixture("cards").then(cardsResp => { - paymentCards = cardsResp.adyen; - cardData = { - clientData: paymentCards.clientData, - encryptedExpiryMonth: paymentCards.encryptedExpiryMonth, - encryptedExpiryYear: paymentCards.encryptedExpiryYear, - encryptedSecurityCode: paymentCards.encryptedSecurityCodes.matches - }; - }); - cy.fixture("addresses") - .then(addresses => { - address = addresses.usAddress; - getDefaultChannel(); - }) - .then(channelResp => { - defaultChannel = channelResp; - createShipping({ - channelId: channelResp.id, - name, - address, - price: 10 - }); - }) - .then( - ({ - warehouse: warehouseResp, - shippingZone: shippingZoneResp, - shippingMethod: shippingMethodResp - }) => { - warehouse = warehouseResp; - shippingMethod = shippingMethodResp; - } - ); - createTypeAttributeAndCategoryForProduct({ name }) - .then(({ productType, attribute, category }) => { - createProductInChannel({ - name, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id - }); - }) - .then(({ variantsList: variants }) => (variantsList = variants)); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteProductsStartsWith(startsWith); + deleteShippingStartsWith(startsWith); + cy.fixture("cards").then(cardsResp => { + paymentCards = cardsResp.adyen; + cardData = { + clientData: paymentCards.clientData, + encryptedExpiryMonth: paymentCards.encryptedExpiryMonth, + encryptedExpiryYear: paymentCards.encryptedExpiryYear, + encryptedSecurityCode: paymentCards.encryptedSecurityCodes.matches + }; }); - - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - createCheckout({ - channelSlug: defaultChannel.slug, - email, - variantsList, - address, - billingAddress: address, - auth: "token" + cy.fixture("addresses") + .then(addresses => { + address = addresses.usAddress; + getDefaultChannel(); }) - .then(({ checkout: checkoutResp }) => { - const shippingMethodId = getShippingMethodIdFromCheckout( - checkoutResp, - shippingMethod.name - ); - checkout = checkoutResp; - addShippingMethod(checkout.id, shippingMethodId); - }) - .then(({ checkout: checkoutResp }) => { - addAdyenPayment(checkout.id, checkoutResp.totalPrice.gross.amount); + .then(channelResp => { + defaultChannel = channelResp; + createShipping({ + channelId: channelResp.id, + name, + address, + price: 10 }); - }); + }) + .then( + ({ + warehouse: warehouseResp, + shippingZone: shippingZoneResp, + shippingMethod: shippingMethodResp + }) => { + warehouse = warehouseResp; + shippingMethod = shippingMethodResp; + } + ); + createTypeAttributeAndCategoryForProduct({ name }) + .then(({ productType, attribute, category }) => { + createProductInChannel({ + name, + channelId: defaultChannel.id, + warehouseId: warehouse.id, + productTypeId: productType.id, + attributeId: attribute.id, + categoryId: category.id + }); + }) + .then(({ variantsList: variants }) => (variantsList = variants)); + }); - it("should purchase products with simple card", () => { + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + createCheckout({ + channelSlug: defaultChannel.slug, + email, + variantsList, + address, + billingAddress: address, + auth: "token" + }) + .then(({ checkout: checkoutResp }) => { + const shippingMethodId = getShippingMethodIdFromCheckout( + checkoutResp, + shippingMethod.name + ); + checkout = checkoutResp; + addShippingMethod(checkout.id, shippingMethodId); + }) + .then(({ checkout: checkoutResp }) => { + addAdyenPayment(checkout.id, checkoutResp.totalPrice.gross.amount); + }); + }); + + it( + "should purchase products with simple card", + { tags: ["@payments", "@stagedOnly"] }, + () => { const simpleCard = cardData; simpleCard.encryptedCardNumber = paymentCards.cards.simpleCard.encryptedCardNumber; @@ -126,9 +127,13 @@ filterTests({ definedTags: ["stagedOnly"] }, () => { .then(order => { expect(order.paymentStatus).to.eq("FULLY_CHARGED"); }); - }); + } + ); - it("should purchase product with 3D secure 2 Auth", () => { + it( + "should purchase product with 3D secure 2 Auth", + { tags: ["@payments", "@stagedOnly"] }, + () => { const threeDSecureCard = cardData; threeDSecureCard.encryptedCardNumber = paymentCards.cards.threeDSecureTwoAuth.encryptedCardNumber; @@ -140,9 +145,13 @@ filterTests({ definedTags: ["stagedOnly"] }, () => { .then(order => { expect(order.paymentStatus).to.eq("FULLY_CHARGED"); }); - }); + } + ); - it("should purchase product with 3D secure 1 Auth", () => { + it( + "should purchase product with 3D secure 1 Auth", + { tags: ["@payments", "@stagedOnly"] }, + () => { const threeDSecureCardOneAuth = cardData; threeDSecureCardOneAuth.encryptedCardNumber = paymentCards.cards.threeDSecureOneAuth.encryptedCardNumber; @@ -155,9 +164,13 @@ filterTests({ definedTags: ["stagedOnly"] }, () => { .then(order => { expect(order.paymentStatus).to.eq("FULLY_CHARGED"); }); - }); + } + ); - it("should fail with unknown security number", () => { + it( + "should fail with unknown security number", + { tags: ["@payments", "@stagedOnly"] }, + () => { const simpleCard = cardData; simpleCard.encryptedCardNumber = paymentCards.cards.simpleCard.encryptedCardNumber; @@ -167,9 +180,13 @@ filterTests({ definedTags: ["stagedOnly"] }, () => { completeCheckout(checkout.id, simpleCard).then(({ errors }) => { expect(errors).to.have.length(1); }); - }); + } + ); - it("should fail with timeout in 3D authorization", () => { + it( + "should fail with timeout in 3D authorization", + { tags: ["@payments", "@stagedOnly"] }, + () => { const errorCard = cardData; errorCard.encryptedCardNumber = paymentCards.cards.errorCard.encryptedCardNumber; @@ -177,9 +194,13 @@ filterTests({ definedTags: ["stagedOnly"] }, () => { completeCheckout(checkout.id, errorCard).then(({ errors }) => { expect(errors).to.have.length(1); }); - }); + } + ); - it("should fail with closed account", () => { + it( + "should fail with closed account", + { tags: ["@payments", "@stagedOnly"] }, + () => { const closeAccount = cardData; closeAccount.encryptedCardNumber = paymentCards.cards.closeAccount.encryptedCardNumber; @@ -187,6 +208,6 @@ filterTests({ definedTags: ["stagedOnly"] }, () => { completeCheckout(checkout.id, closeAccount).then(({ errors }) => { expect(errors).to.have.length(1); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/plugins/plugins.js b/cypress/e2e/configuration/plugins/plugins.js index 3d7a69b5c..ae3761502 100644 --- a/cypress/e2e/configuration/plugins/plugins.js +++ b/cypress/e2e/configuration/plugins/plugins.js @@ -21,52 +21,53 @@ import { getMailActivationLinkForUserAndSubject, getMailsForUser } from "../../../support/api/utils/users"; -import filterTests from "../../../support/filterTests"; -filterTests({ definedTags: ["stagedOnly"], version: "3.1.0" }, () => { - describe("Plugins", () => { - const startsWith = "Plugins"; - const randomName = `${startsWith}${faker.datatype.number()}`; - let defaultChannel; +describe("Plugins", () => { + const startsWith = "Plugins"; + const randomName = `${startsWith}${faker.datatype.number()}`; + let defaultChannel; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteCustomersStartsWith(startsWith); - deleteChannelsStartsWith(startsWith); - createChannel({ name: randomName }); - getDefaultChannel().then(channel => (defaultChannel = channel)); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteCustomersStartsWith(startsWith); + deleteChannelsStartsWith(startsWith); + createChannel({ name: randomName }); + getDefaultChannel().then(channel => (defaultChannel = channel)); + }); - beforeEach(() => { - cy.clearSessionData() - .loginUserViaRequest() - .visit(urlList.plugins) - .softExpectSkeletonIsVisible(); - }); + beforeEach(() => { + cy.clearSessionData() + .loginUserViaRequest() + .visit(urlList.plugins) + .expectSkeletonIsVisible(); + }); - it("should change user email", () => { - const customerEmail = `${randomName}@example.com`; - cy.contains(PLUGINS_LIST.pluginRow, "User emails").click(); - cy.contains(PLUGINS_DETAILS.channel, defaultChannel.name) - .click() - .get(PLUGINS_DETAILS.accountConfirmationSubjectInput) - .clearAndType(randomName) - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear(); - customerRegistration({ - email: customerEmail, - channel: defaultChannel.slug + it("should change user email", { tags: ["@plugins", "@stagedOnly"] }, () => { + const customerEmail = `${randomName}@example.com`; + cy.contains(PLUGINS_LIST.pluginRow, "User emails").click(); + cy.contains(PLUGINS_DETAILS.channel, defaultChannel.name) + .click() + .get(PLUGINS_DETAILS.accountConfirmationSubjectInput) + .clearAndType(randomName) + .get(BUTTON_SELECTORS.confirm) + .click() + .confirmationMessageShouldDisappear(); + customerRegistration({ + email: customerEmail, + channel: defaultChannel.slug + }) + .then(() => { + getMailsForUser(customerEmail); }) - .then(() => { - getMailsForUser(customerEmail); - }) - .then(mails => { - expect(mails[0].Content.Headers.Subject[0]).to.eq(randomName); - }); - }); + .then(mails => { + expect(mails[0].Content.Headers.Subject[0]).to.eq(randomName); + }); + }); - it("should change admin email plugin", () => { + it( + "should change admin email plugin", + { tags: ["@plugins", "@stagedOnly"] }, + () => { const customerEmail = `${randomName}@example.com`; cy.contains(PLUGINS_LIST.pluginRow, "Admin emails") .click() @@ -87,6 +88,6 @@ filterTests({ definedTags: ["stagedOnly"], version: "3.1.0" }, () => { .then(link => { expect(link).to.be.ok; }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/plugins/stripe.js b/cypress/e2e/configuration/plugins/stripe.js index 2a74653a1..00099a78e 100644 --- a/cypress/e2e/configuration/plugins/stripe.js +++ b/cypress/e2e/configuration/plugins/stripe.js @@ -14,65 +14,66 @@ import { } from "../../../support/api/utils/ordersUtils"; import { createProductWithShipping } from "../../../support/api/utils/products/productsUtils"; import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils"; -import filterTests from "../../../support/filterTests"; -filterTests({ definedTags: ["stagedOnly"] }, () => { - describe("Stripe payments", () => { - const startsWith = "Stripe-"; - const email = `example@example.com`; +describe("Stripe payments", () => { + const startsWith = "Stripe-"; + const email = `example@example.com`; - let address; - let defaultChannel; - let shippingMethod; - let variantsList; - let checkout; - let paymentCards; - let cardData; + let address; + let defaultChannel; + let shippingMethod; + let variantsList; + let checkout; + let paymentCards; + let cardData; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteShippingStartsWith(startsWith); - cy.fixture("cards").then(({ stripe }) => { - paymentCards = stripe; - cardData = { - publicKey: paymentCards.publicApiKey, - cvc: 123, - expMonth: 10, - expYear: 50 - }; - }); - createProductWithShipping({ name: startsWith }).then(values => { - address = values.address; - defaultChannel = values.defaultChannel; - shippingMethod = values.shippingMethod; - variantsList = values.variantsList; - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteShippingStartsWith(startsWith); + cy.fixture("cards").then(({ stripe }) => { + paymentCards = stripe; + cardData = { + publicKey: paymentCards.publicApiKey, + cvc: 123, + expMonth: 10, + expYear: 50 + }; }); + createProductWithShipping({ name: startsWith }).then(values => { + address = values.address; + defaultChannel = values.defaultChannel; + shippingMethod = values.shippingMethod; + variantsList = values.variantsList; + }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - createCheckout({ - channelSlug: defaultChannel.slug, - email, - variantsList, - address, - billingAddress: address, - auth: "token" + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + createCheckout({ + channelSlug: defaultChannel.slug, + email, + variantsList, + address, + billingAddress: address, + auth: "token" + }) + .then(({ checkout: checkoutResp }) => { + checkout = checkoutResp; + const shippingMethodId = getShippingMethodIdFromCheckout( + checkoutResp, + shippingMethod.name + ); + addShippingMethod(checkout.id, shippingMethodId); }) - .then(({ checkout: checkoutResp }) => { - checkout = checkoutResp; - const shippingMethodId = getShippingMethodIdFromCheckout( - checkoutResp, - shippingMethod.name - ); - addShippingMethod(checkout.id, shippingMethodId); - }) - .then(({ checkout: checkoutResp }) => { - checkout = checkoutResp; - }); - }); + .then(({ checkout: checkoutResp }) => { + checkout = checkoutResp; + }); + }); - it("should purchase products with simple card", () => { + it( + "should purchase products with simple card", + { tags: ["@payments", "@stagedOnly"] }, + () => { const simpleCard = cardData; simpleCard.cardNumber = paymentCards.simpleCardNumber; addStripePaymentAndGetConfirmationData({ @@ -89,9 +90,13 @@ filterTests({ definedTags: ["stagedOnly"] }, () => { .then(order => { expect(order.paymentStatus).to.eq("FULLY_CHARGED"); }); - }); + } + ); - it("should not purchase products with card with insufficient funds", () => { + it( + "should not purchase products with card with insufficient funds", + { tags: ["@payments", "@stagedOnly"] }, + () => { const simpleCard = cardData; simpleCard.cardNumber = paymentCards.insufficientFundsCard; addStripePaymentAndGetConfirmationData({ @@ -101,9 +106,13 @@ filterTests({ definedTags: ["stagedOnly"] }, () => { }).then(resp => { expect(resp.body.error.code).to.equal("card_declined"); }); - }); + } + ); - it("should purchase products with 3D secure card", () => { + it( + "should purchase products with 3D secure card", + { tags: ["@payments", "@stagedOnly"] }, + () => { const threeDSecureCard = cardData; threeDSecureCard.cardNumber = paymentCards.threeDSecureAuthCard; addStripePaymentAndGetConfirmationData({ @@ -123,9 +132,13 @@ filterTests({ definedTags: ["stagedOnly"] }, () => { .then(order => { expect(order.paymentStatus).to.eq("FULLY_CHARGED"); }); - }); + } + ); - it("should not purchase product when 3D secure not pass", () => { + it( + "should not purchase product when 3D secure not pass", + { tags: ["@payments", "@stagedOnly"] }, + () => { const threeDSecureCard = cardData; threeDSecureCard.cardNumber = paymentCards.threeDSecureAuthCard; addStripePaymentAndGetConfirmationData({ @@ -142,6 +155,6 @@ filterTests({ definedTags: ["stagedOnly"] }, () => { .then(({ order }) => { expect(order).to.not.be.ok; }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/productTypes/attributesInProduductTypes.js b/cypress/e2e/configuration/productTypes/attributesInProduductTypes.js index d09ed9a3a..20b85e89d 100644 --- a/cypress/e2e/configuration/productTypes/attributesInProduductTypes.js +++ b/cypress/e2e/configuration/productTypes/attributesInProduductTypes.js @@ -15,28 +15,29 @@ import { } from "../../../support/api/requests/ProductType"; import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; import { deleteProductsStartsWith } from "../../../support/api/utils/products/productsUtils"; -import filterTests from "../../../support/filterTests"; -filterTests({ definedTags: ["all"] }, () => { - describe("As an admin I want to manage attributes in product types", () => { - const startsWith = "productType"; - let category; - let channel; - let attribute; +describe("As an admin I want to manage attributes in product types", () => { + const startsWith = "productType"; + let category; + let channel; + let attribute; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteProductsStartsWith(startsWith); - createAttribute({ name: startsWith }).then(resp => (attribute = resp)); - createCategory({ name: startsWith }).then(resp => (category = resp)); - getDefaultChannel().then(resp => (channel = resp)); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteProductsStartsWith(startsWith); + createAttribute({ name: startsWith }).then(resp => (attribute = resp)); + createCategory({ name: startsWith }).then(resp => (category = resp)); + getDefaultChannel().then(resp => (channel = resp)); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should be able to update product type with product attribute. TC: SALEOR_1503", () => { + it( + "should be able to update product type with product attribute. TC: SALEOR_1503", + { tags: ["@productType", "@allEnv", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; createTypeProduct({ name }) @@ -55,9 +56,13 @@ filterTests({ definedTags: ["all"] }, () => { .then(productType => { expect(productType.productAttributes[0].name).to.eq(startsWith); }); - }); + } + ); - it("should be able to update product type with variant attribute. TC: SALEOR_1504", () => { + it( + "should be able to update product type with variant attribute. TC: SALEOR_1504", + { tags: ["@productType", "@allEnv", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; createTypeProduct({ name, hasVariants: false }) @@ -80,9 +85,13 @@ filterTests({ definedTags: ["all"] }, () => { startsWith ); }); - }); + } + ); - it("should be able to remove variant attribute from product type. TC: SALEOR_1506", () => { + it( + "should be able to remove variant attribute from product type. TC: SALEOR_1506", + { tags: ["@productType", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; let productType; @@ -109,9 +118,13 @@ filterTests({ definedTags: ["all"] }, () => { .then(productTypeResp => { expect(productTypeResp.assignedVariantAttributes).to.be.empty; }); - }); + } + ); - it("should be able to remove product attribute from product type. TC: SALEOR_1507", () => { + it( + "should be able to remove product attribute from product type. TC: SALEOR_1507", + { tags: ["@productType", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; let productType; @@ -138,9 +151,13 @@ filterTests({ definedTags: ["all"] }, () => { .then(productTypeResp => { expect(productTypeResp.assignedVariantAttributes).to.be.empty; }); - }); + } + ); - it("should be able to select attribute as variant selection. TC: SALEOR_1508", () => { + it( + "should be able to select attribute as variant selection. TC: SALEOR_1508", + { tags: ["@productType", "@allEnv", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; let productType; @@ -169,6 +186,6 @@ filterTests({ definedTags: ["all"] }, () => { productType.assignedVariantAttributes[0].variantSelection ).to.eq(true); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/productTypes/createProductType.js b/cypress/e2e/configuration/productTypes/createProductType.js index 7a79e1994..3128df4ab 100644 --- a/cypress/e2e/configuration/productTypes/createProductType.js +++ b/cypress/e2e/configuration/productTypes/createProductType.js @@ -6,26 +6,27 @@ import faker from "faker"; import { urlList } from "../../../fixtures/urlList"; import { getProductType } from "../../../support/api/requests/ProductType"; import { deleteProductsStartsWith } from "../../../support/api/utils/products/productsUtils"; -import filterTests from "../../../support/filterTests"; import { createProductType } from "../../../support/pages/productTypePage"; -filterTests({ definedTags: ["all"] }, () => { - describe("As an admin I want to create product types", () => { - const startsWith = "productType"; +describe("As an admin I want to create product types", () => { + const startsWith = "productType"; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteProductsStartsWith(startsWith); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteProductsStartsWith(startsWith); + }); - beforeEach(() => { - cy.clearSessionData() - .loginUserViaRequest() - .visit(urlList.productTypes) - .softExpectSkeletonIsVisible(); - }); + beforeEach(() => { + cy.clearSessionData() + .loginUserViaRequest() + .visit(urlList.productTypes) + .expectSkeletonIsVisible(); + }); - it("should be able to create product type without shipping required. TC: SALEOR_1501", () => { + it( + "should be able to create product type without shipping required. TC: SALEOR_1501", + { tags: ["@productType", "@allEnv", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; createProductType({ name }) @@ -37,9 +38,13 @@ filterTests({ definedTags: ["all"] }, () => { expect(productType.isShippingRequired).to.be.false; expect(productType.kind).to.be.eq("NORMAL"); }); - }); + } + ); - it("should be able to create product type with shipping required. TC: SALEOR_1502", () => { + it( + "should be able to create product type with shipping required. TC: SALEOR_1502", + { tags: ["@productType", "@allEnv", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; const shippingWeight = 10; @@ -53,9 +58,13 @@ filterTests({ definedTags: ["all"] }, () => { expect(productType.weight.value).to.eq(shippingWeight); expect(productType.kind).to.be.eq("NORMAL"); }); - }); + } + ); - it("should be able to create product type with gift card kind. TC: SALEOR_1510", () => { + it( + "should be able to create product type with gift card kind. TC: SALEOR_1510", + { tags: ["@productType", "@allEnv", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; createProductType({ name, giftCard: true }) @@ -67,6 +76,6 @@ filterTests({ definedTags: ["all"] }, () => { expect(productType.isShippingRequired).to.be.false; expect(productType.kind).to.be.eq("GIFT_CARD"); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/productTypes/deleteProductType.js b/cypress/e2e/configuration/productTypes/deleteProductType.js index 3e616febd..0ed2b37d1 100644 --- a/cypress/e2e/configuration/productTypes/deleteProductType.js +++ b/cypress/e2e/configuration/productTypes/deleteProductType.js @@ -4,7 +4,6 @@ import faker from "faker"; import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements"; import { productTypeDetailsUrl } from "../../../fixtures/urlList"; import { createAttribute } from "../../../support/api/requests/Attribute"; import { createCategory } from "../../../support/api/requests/Category"; @@ -18,28 +17,29 @@ import { createProductInChannel, deleteProductsStartsWith } from "../../../support/api/utils/products/productsUtils"; -import filterTests from "../../../support/filterTests"; -filterTests({ definedTags: ["all"] }, () => { - describe("As an admin I want to manage product types", () => { - const startsWith = "productType"; - let category; - let channel; - let attribute; +describe("As an admin I want to manage product types", () => { + const startsWith = "productType"; + let category; + let channel; + let attribute; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteProductsStartsWith(startsWith); - createAttribute({ name: startsWith }).then(resp => (attribute = resp)); - createCategory({ name: startsWith }).then(resp => (category = resp)); - getDefaultChannel().then(resp => (channel = resp)); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteProductsStartsWith(startsWith); + createAttribute({ name: startsWith }).then(resp => (attribute = resp)); + createCategory({ name: startsWith }).then(resp => (category = resp)); + getDefaultChannel().then(resp => (channel = resp)); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should be able to delete product type. TC: SALEOR_1505", () => { + it( + "should be able to delete product type. TC: SALEOR_1505", + { tags: ["@productType", "@allEnv", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; createTypeProduct({ name, hasVariants: false }).then(productType => { @@ -54,9 +54,13 @@ filterTests({ definedTags: ["all"] }, () => { .waitForRequestAndCheckIfNoErrors("@ProductTypeDelete"); getProductType(productType.id).should("be.null"); }); - }); + } + ); - it("should be able to delete product type with assigned product. TC: SALEOR_1509", () => { + it( + "should be able to delete product type with assigned product. TC: SALEOR_1509", + { tags: ["@productType", "@allEnv", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; let productType; @@ -89,6 +93,6 @@ filterTests({ definedTags: ["all"] }, () => { .its("body.data.product") .should("be.null"); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/shippingMethods/channelsInShipping.js b/cypress/e2e/configuration/shippingMethods/channelsInShipping.js index 8d074fcea..4dd67a9fb 100644 --- a/cypress/e2e/configuration/shippingMethods/channelsInShipping.js +++ b/cypress/e2e/configuration/shippingMethods/channelsInShipping.js @@ -13,25 +13,26 @@ import { } from "../../../support/api/requests/ShippingMethod"; import * as channelsUtils from "../../../support/api/utils/channelsUtils"; import * as shippingUtils from "../../../support/api/utils/shippingUtils"; -import filterTests from "../../../support/filterTests"; import { selectChannelInHeader } from "../../../support/pages/channelsPage"; import { enterAndSelectShippings, enterShippingZone } from "../../../support/pages/shippingZones"; -filterTests({ definedTags: ["all"] }, () => { - describe("As a staff user I want have different shipping method prices for each channel", () => { - const startsWith = "ChannelShippingMethod"; - let defaultChannel; +describe("As a staff user I want have different shipping method prices for each channel", () => { + const startsWith = "ChannelShippingMethod"; + let defaultChannel; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - shippingUtils.deleteShippingStartsWith(startsWith); - channelsUtils.deleteChannelsStartsWith(startsWith); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + shippingUtils.deleteShippingStartsWith(startsWith); + channelsUtils.deleteChannelsStartsWith(startsWith); + }); - it("should be able to display different price for each channel. TC: SALEOR_0805", () => { + it( + "should be able to display different price for each channel. TC: SALEOR_0805", + { tags: ["@shipping", "@allEnv"] }, + () => { const shippingName = `${startsWith}${faker.datatype.number()}`; const defaultChannelPrice = 11; const createdChannelPrice = 7; @@ -114,6 +115,6 @@ filterTests({ definedTags: ["all"] }, () => { expect(text).to.includes(createdChannelCurrency); }); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/shippingMethods/createShippingMethod.js b/cypress/e2e/configuration/shippingMethods/createShippingMethod.js index 246ace2a8..f503238fa 100644 --- a/cypress/e2e/configuration/shippingMethods/createShippingMethod.js +++ b/cypress/e2e/configuration/shippingMethods/createShippingMethod.js @@ -13,103 +13,104 @@ import { createWaitingForCaptureOrder } from "../../../support/api/utils/ordersU import * as productsUtils from "../../../support/api/utils/products/productsUtils"; import * as shippingUtils from "../../../support/api/utils/shippingUtils"; import { isShippingAvailableInCheckout } from "../../../support/api/utils/storeFront/checkoutUtils"; -import filterTests from "../../../support/filterTests"; import { createShippingRate, createShippingZone, rateOptions } from "../../../support/pages/shippingMethodPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("As a staff user I want to create shipping zone and rate", () => { - const startsWith = "CreateShippingMethods-"; - const name = `${startsWith}${faker.datatype.number()}`; - const secondName = `${startsWith}${faker.datatype.number()}`; - const price = 8; - const secondVariantPrice = 2; - const deliveryTime = { min: 2, max: 5 }; - let defaultChannel; - let address; - let variantsList; - let secondVariantsList; - let warehouse; - let attribute; - let category; - let productType; +describe("As a staff user I want to create shipping zone and rate", () => { + const startsWith = "CreateShippingMethods-"; + const name = `${startsWith}${faker.datatype.number()}`; + const secondName = `${startsWith}${faker.datatype.number()}`; + const price = 8; + const secondVariantPrice = 2; + const deliveryTime = { min: 2, max: 5 }; + let defaultChannel; + let address; + let variantsList; + let secondVariantsList; + let warehouse; + let attribute; + let category; + let productType; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - productsUtils.deleteProductsStartsWith(startsWith); - shippingUtils.deleteShippingStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + productsUtils.deleteProductsStartsWith(startsWith); + shippingUtils.deleteShippingStartsWith(startsWith); - channelsUtils - .getDefaultChannel() - .then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }) - .then(addresses => { - address = addresses.usAddress; - createWarehouse({ name, address }); - }) - .then(warehouseResp => { - warehouse = warehouseResp; - productsUtils.createTypeAttributeAndCategoryForProduct({ - name: startsWith - }); - }) - .then( - ({ - productType: productTypeResp, - category: categoryResp, - attribute: attributeResp - }) => { - attribute = attributeResp; - category = categoryResp; - productType = productTypeResp; + channelsUtils + .getDefaultChannel() + .then(channel => { + defaultChannel = channel; + cy.fixture("addresses"); + }) + .then(addresses => { + address = addresses.usAddress; + createWarehouse({ name, address }); + }) + .then(warehouseResp => { + warehouse = warehouseResp; + productsUtils.createTypeAttributeAndCategoryForProduct({ + name: startsWith + }); + }) + .then( + ({ + productType: productTypeResp, + category: categoryResp, + attribute: attributeResp + }) => { + attribute = attributeResp; + category = categoryResp; + productType = productTypeResp; - productsUtils.createProductInChannel({ - name, - channelId: defaultChannel.id, - productTypeId: productTypeResp.id, - attributeId: attributeResp.id, - categoryId: categoryResp.id, - warehouseId: warehouse.id, - quantityInWarehouse: 10, - price - }); - } - ) - .then(({ variantsList: variantsListResp, product }) => { - variantsList = variantsListResp; - createVariant({ - productId: product.id, - sku: secondName, - attributeId: attribute.id, - attributeName: "value2", + productsUtils.createProductInChannel({ + name, + channelId: defaultChannel.id, + productTypeId: productTypeResp.id, + attributeId: attributeResp.id, + categoryId: categoryResp.id, warehouseId: warehouse.id, quantityInWarehouse: 10, - channelId: defaultChannel.id, - price: secondVariantPrice, - weight: 10 + price }); - }) - .then(variantsListResp => { - secondVariantsList = variantsListResp; + } + ) + .then(({ variantsList: variantsListResp, product }) => { + variantsList = variantsListResp; + createVariant({ + productId: product.id, + sku: secondName, + attributeId: attribute.id, + attributeName: "value2", + warehouseId: warehouse.id, + quantityInWarehouse: 10, + channelId: defaultChannel.id, + price: secondVariantPrice, + weight: 10 }); - }); + }) + .then(variantsListResp => { + secondVariantsList = variantsListResp; + }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should be able to create price based shipping method. TC: SALEOR_0803", () => { + it( + "should be able to create price based shipping method. TC: SALEOR_0803", + { tags: ["@shipping", "@allEnv"] }, + () => { const shippingName = `${startsWith}${faker.datatype.number()}`; cy.clearSessionData().loginUserViaRequest( "auth", ONE_PERMISSION_USERS.shipping ); - cy.visit(urlList.shippingMethods).softExpectSkeletonIsVisible(); + cy.visit(urlList.shippingMethods).expectSkeletonIsVisible(); createShippingZone( shippingName, warehouse.name, @@ -147,15 +148,19 @@ filterTests({ definedTags: ["all"] }, () => { ); expect(isShippingAvailable).to.be.false; }); - }); + } + ); - it("should be able to create weight based shipping method. TC: SALEOR_0804", () => { + it( + "should be able to create weight based shipping method. TC: SALEOR_0804", + { tags: ["@shipping", "@allEnv"] }, + () => { const shippingName = `${startsWith}${faker.datatype.number()}`; cy.clearSessionData().loginUserViaRequest( "auth", ONE_PERMISSION_USERS.shipping ); - cy.visit(urlList.shippingMethods).softExpectSkeletonIsVisible(); + cy.visit(urlList.shippingMethods).expectSkeletonIsVisible(); createShippingZone( shippingName, warehouse.name, @@ -193,6 +198,6 @@ filterTests({ definedTags: ["all"] }, () => { ); expect(isShippingAvailable).to.be.false; }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/shippingMethods/editShippingMethod.js b/cypress/e2e/configuration/shippingMethods/editShippingMethod.js index 8440f3fad..677efc782 100644 --- a/cypress/e2e/configuration/shippingMethods/editShippingMethod.js +++ b/cypress/e2e/configuration/shippingMethods/editShippingMethod.js @@ -12,50 +12,51 @@ import { } from "../../../support/api/requests/ShippingMethod"; import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils"; -import filterTests from "../../../support/filterTests"; import { fillUpShippingRate, saveRateAfterUpdate } from "../../../support/pages/shippingMethodPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("As a user I should be able to update and delete shipping method", () => { - const startsWith = "EditShipping-"; - const name = `${startsWith}${faker.datatype.number()}`; - const price = 10; +describe("As a user I should be able to update and delete shipping method", () => { + const startsWith = "EditShipping-"; + const name = `${startsWith}${faker.datatype.number()}`; + const price = 10; - let defaultChannel; - let shippingZone; - let shippingMethod; + let defaultChannel; + let shippingZone; + let shippingMethod; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteShippingStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteShippingStartsWith(startsWith); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - createShippingZone(name, "US", defaultChannel.id); - }) - .then(shippingZoneResp => { - shippingZone = shippingZoneResp; - }); - }); - - beforeEach(() => { - const rateName = `${startsWith}${faker.datatype.number()}`; - - cy.clearSessionData().loginUserViaRequest(); - createShippingRate({ - name: rateName, - shippingZone: shippingZone.id - }).then(({ shippingMethod: shippingResp }) => { - shippingMethod = shippingResp; - addChannelToShippingMethod(shippingMethod.id, defaultChannel.id, 1); + getDefaultChannel() + .then(channel => { + defaultChannel = channel; + createShippingZone(name, "US", defaultChannel.id); + }) + .then(shippingZoneResp => { + shippingZone = shippingZoneResp; }); - }); + }); - it("should be able to update shipping rate. TC: SALEOR_0806", () => { + beforeEach(() => { + const rateName = `${startsWith}${faker.datatype.number()}`; + + cy.clearSessionData().loginUserViaRequest(); + createShippingRate({ + name: rateName, + shippingZone: shippingZone.id + }).then(({ shippingMethod: shippingResp }) => { + shippingMethod = shippingResp; + addChannelToShippingMethod(shippingMethod.id, defaultChannel.id, 1); + }); + }); + + it( + "should be able to update shipping rate. TC: SALEOR_0806", + { tags: ["@shipping", "@allEnv", "@stable"] }, + () => { const updatedRateName = `${startsWith}Updated`; const deliveryTime = { min: 1, max: 7 }; @@ -68,19 +69,23 @@ filterTests({ definedTags: ["all"] }, () => { saveRateAfterUpdate(); getShippingZone(shippingZone.id).then(({ shippingMethods }) => { expect(shippingMethods).to.have.length(1); - chai - .softExpect(shippingMethods[0].minimumDeliveryDays) - .to.be.eq(deliveryTime.min); - chai - .softExpect(shippingMethods[0].maximumDeliveryDays) - .to.be.eq(deliveryTime.max); - chai - .softExpect(shippingMethods[0].channelListings[0].price.amount) - .to.be.eq(price); + expect(shippingMethods[0].minimumDeliveryDays).to.be.eq( + deliveryTime.min + ); + expect(shippingMethods[0].maximumDeliveryDays).to.be.eq( + deliveryTime.max + ); + expect(shippingMethods[0].channelListings[0].price.amount).to.be.eq( + price + ); }); - }); + } + ); - it("should be able to delete shipping rate. TC: SALEOR_0807", () => { + it( + "should be able to delete shipping rate. TC: SALEOR_0807", + { tags: ["@shipping", "@allEnv", "@stable"] }, + () => { cy.visit( shippingRateUrl(shippingZone.id, shippingMethod.id) ).deleteElementWithReqAlias("DeleteShippingRate"); @@ -90,6 +95,6 @@ filterTests({ definedTags: ["all"] }, () => { ); expect(deletedShipping).to.be.not.ok; }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/shippingMethods/editShippingZone.js b/cypress/e2e/configuration/shippingMethods/editShippingZone.js index 2ffaf4381..60d18671a 100644 --- a/cypress/e2e/configuration/shippingMethods/editShippingZone.js +++ b/cypress/e2e/configuration/shippingMethods/editShippingZone.js @@ -12,46 +12,45 @@ import { import { createWarehouse } from "../../../support/api/requests/Warehouse"; import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils"; -import filterTests from "../../../support/filterTests"; import { fillUpShippingZoneData } from "../../../support/pages/shippingMethodPage"; import { enterAndSelectShippings } from "../../../support/pages/shippingZones"; -filterTests({ definedTags: ["all"] }, () => { - describe("As a user I should be able to update and delete shipping zone", () => { - const startsWith = "EditShipping-"; - const name = `${startsWith}${faker.datatype.number()}`; +describe("As a user I should be able to update and delete shipping zone", () => { + const startsWith = "EditShipping-"; + const name = `${startsWith}${faker.datatype.number()}`; - let defaultChannel; - let shippingZone; - let plAddress; + let defaultChannel; + let shippingZone; + let plAddress; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteShippingStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteShippingStartsWith(startsWith); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }) - .then(addresses => { - plAddress = addresses.plAddress; - createWarehouse({ name, address: plAddress }); - }); + getDefaultChannel() + .then(channel => { + defaultChannel = channel; + cy.fixture("addresses"); + }) + .then(addresses => { + plAddress = addresses.plAddress; + createWarehouse({ name, address: plAddress }); + }); + }); + + beforeEach(() => { + const rateName = `${startsWith}${faker.datatype.number()}`; + + cy.clearSessionData().loginUserViaRequest(); + createShippingZone(name, "US", defaultChannel.id).then(shippingZoneResp => { + shippingZone = shippingZoneResp; }); + }); - beforeEach(() => { - const rateName = `${startsWith}${faker.datatype.number()}`; - - cy.clearSessionData().loginUserViaRequest(); - createShippingZone(name, "US", defaultChannel.id).then( - shippingZoneResp => { - shippingZone = shippingZoneResp; - } - ); - }); - - it("should be able to update shipping zone. TC: SALEOR_0808", () => { + it( + "should be able to update shipping zone. TC: SALEOR_0808", + { tags: ["@shipping", "@allEnv"] }, + () => { const updatedName = `${startsWith}Updated`; cy.visit(shippingZoneDetailsUrl(shippingZone.id)); @@ -62,22 +61,30 @@ filterTests({ definedTags: ["all"] }, () => { warehouseName: name }); getShippingZone(shippingZone.id).then(shippingZone => { - chai.softExpect(shippingZone.channels).to.have.length(0); - chai.softExpect(shippingZone.name).to.eq(updatedName); - chai.softExpect(shippingZone.description).to.eq(updatedName); - chai.softExpect(shippingZone.warehouses[0].name).to.eq(name); + expect(shippingZone.channels).to.have.length(0); + expect(shippingZone.name).to.eq(updatedName); + expect(shippingZone.description).to.eq(updatedName); + expect(shippingZone.warehouses[0].name).to.eq(name); expect(shippingZone.countries.find(el => el.code === "PL")).to.be.ok; }); - }); + } + ); - it("should be able to delete shipping zone. TC: SALEOR_0809", () => { + it( + "should be able to delete shipping zone. TC: SALEOR_0809", + { tags: ["@shipping", "@allEnv"] }, + () => { cy.visit( shippingZoneDetailsUrl(shippingZone.id) ).deleteElementWithReqAlias("DeleteShippingZone"); getShippingZone(shippingZone.id).should("be.null"); - }); + } + ); - it("should be able to delete several shipping zones on shipping zones list page. TC: SALEOR_0810", () => { + it( + "should be able to delete several shipping zones on shipping zones list page. TC: SALEOR_0810", + { tags: ["@shipping", "@allEnv"] }, + () => { let secondShippingZone; createShippingZone(`${startsWith}Second`, "US", defaultChannel.id).then( @@ -94,6 +101,6 @@ filterTests({ definedTags: ["all"] }, () => { getShippingZone(secondShippingZone.id).should("be.null"); } ); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/shippingMethods/postalCodes.js b/cypress/e2e/configuration/shippingMethods/postalCodes.js index f34bf78d2..df6bb1eb0 100644 --- a/cypress/e2e/configuration/shippingMethods/postalCodes.js +++ b/cypress/e2e/configuration/shippingMethods/postalCodes.js @@ -16,80 +16,81 @@ import { } from "../../../support/api/utils/products/productsUtils"; import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils"; import { isShippingAvailableInCheckout } from "../../../support/api/utils/storeFront/checkoutUtils"; -import filterTests from "../../../support/filterTests"; import { createRateWithPostalCode, postalCodesOptions } from "../../../support/pages/shippingMethodPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("As a user I want to create shipping method with postal codes", () => { - const startsWith = "CyShippingMethods-"; - const name = `${startsWith}${faker.datatype.number()}`; +describe("As a user I want to create shipping method with postal codes", () => { + const startsWith = "CyShippingMethods-"; + const name = `${startsWith}${faker.datatype.number()}`; - const price = 10; + const price = 10; - let defaultChannel; - let usAddress; - let secondUsAddress; - let shippingZone; - let warehouse; - let variantsList; + let defaultChannel; + let usAddress; + let secondUsAddress; + let shippingZone; + let warehouse; + let variantsList; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteShippingStartsWith(startsWith); - deleteProductsStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteShippingStartsWith(startsWith); + deleteProductsStartsWith(startsWith); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }) - .then( - ({ - usAddress: usAddressResp, - secondUsAddress: secondUsAddressResp - }) => { - usAddress = usAddressResp; - secondUsAddress = secondUsAddressResp; - createShippingZone(name, "US", defaultChannel.id); - } - ) - .then(shippingZoneResp => { - shippingZone = shippingZoneResp; - createWarehouse({ - name, - shippingZone: shippingZone.id, - address: usAddress - }); - }) - .then(warehouseResp => { - warehouse = warehouseResp; - createTypeAttributeAndCategoryForProduct({ name }); - }) - .then(({ attribute, productType, category }) => { - createProductInChannel({ - name, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - attributeId: attribute.id, - categoryId: category.id, - productTypeId: productType.id - }); - }) - .then(({ variantsList: variantsListResp }) => { - variantsList = variantsListResp; + getDefaultChannel() + .then(channel => { + defaultChannel = channel; + cy.fixture("addresses"); + }) + .then( + ({ + usAddress: usAddressResp, + secondUsAddress: secondUsAddressResp + }) => { + usAddress = usAddressResp; + secondUsAddress = secondUsAddressResp; + createShippingZone(name, "US", defaultChannel.id); + } + ) + .then(shippingZoneResp => { + shippingZone = shippingZoneResp; + createWarehouse({ + name, + shippingZone: shippingZone.id, + address: usAddress }); - }); + }) + .then(warehouseResp => { + warehouse = warehouseResp; + createTypeAttributeAndCategoryForProduct({ name }); + }) + .then(({ attribute, productType, category }) => { + createProductInChannel({ + name, + channelId: defaultChannel.id, + warehouseId: warehouse.id, + attributeId: attribute.id, + categoryId: category.id, + productTypeId: productType.id + }); + }) + .then(({ variantsList: variantsListResp }) => { + variantsList = variantsListResp; + }); + }); - beforeEach(() => { - cy.clearSessionData() - .loginUserViaRequest("auth", ONE_PERMISSION_USERS.shipping) - .visit(shippingZoneDetailsUrl(shippingZone.id)); - }); + beforeEach(() => { + cy.clearSessionData() + .loginUserViaRequest("auth", ONE_PERMISSION_USERS.shipping) + .visit(shippingZoneDetailsUrl(shippingZone.id)); + }); - it("should be able to create shipping method with included postal codes. TC: SALEOR_0801", () => { + it( + "should be able to create shipping method with included postal codes. TC: SALEOR_0801", + { tags: ["@shipping", "@allEnv", "@stable"] }, + () => { const rateName = `${startsWith}${faker.datatype.number()}`; createRateWithPostalCode({ @@ -105,9 +106,13 @@ filterTests({ definedTags: ["all"] }, () => { isShippingAvailableForAddress(secondUsAddress, rateName).then( isAvailable => expect(isAvailable).to.be.false ); - }); + } + ); - it("should be able to create shipping method with excluded postal codes. TC: SALEOR_0802", () => { + it( + "should be able to create shipping method with excluded postal codes. TC: SALEOR_0802", + { tags: ["@shipping", "@allEnv", "@stable"] }, + () => { const rateName = `${startsWith}${faker.datatype.number()}`; createRateWithPostalCode({ @@ -123,17 +128,17 @@ filterTests({ definedTags: ["all"] }, () => { isShippingAvailableForAddress(secondUsAddress, rateName).then( isAvailable => expect(isAvailable).to.be.true ); - }); - - function isShippingAvailableForAddress(address, rateName) { - return createCheckout({ - address, - channelSlug: defaultChannel.slug, - email: "example@example.com", - variantsList - }).then(({ checkout }) => - isShippingAvailableInCheckout(checkout, rateName) - ); } - }); + ); + + function isShippingAvailableForAddress(address, rateName) { + return createCheckout({ + address, + channelSlug: defaultChannel.slug, + email: "example@example.com", + variantsList + }).then(({ checkout }) => + isShippingAvailableInCheckout(checkout, rateName) + ); + } }); diff --git a/cypress/e2e/configuration/shippingMethods/shippingWeights/shippingWeightsLimits.js b/cypress/e2e/configuration/shippingMethods/shippingWeights/shippingWeightsLimits.js index 408530afe..af4fc971c 100644 --- a/cypress/e2e/configuration/shippingMethods/shippingWeights/shippingWeightsLimits.js +++ b/cypress/e2e/configuration/shippingMethods/shippingWeights/shippingWeightsLimits.js @@ -16,74 +16,75 @@ import { } from "../../../../support/api/utils/products/productsUtils"; import { deleteShippingStartsWith } from "../../../../support/api/utils/shippingUtils"; import { isShippingAvailableInCheckout } from "../../../../support/api/utils/storeFront/checkoutUtils"; -import filterTests from "../../../../support/filterTests"; import { createShippingRate, rateOptions } from "../../../../support/pages/shippingMethodPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("As a staff user I want to manage shipping weights", () => { - const startsWith = "CyWeightRates-"; - const name = `${startsWith}${faker.datatype.number()}`; +describe("As a staff user I want to manage shipping weights", () => { + const startsWith = "CyWeightRates-"; + const name = `${startsWith}${faker.datatype.number()}`; - const price = 10; + const price = 10; - let defaultChannel; - let usAddress; - let shippingZone; - let warehouse; - let variantsList; + let defaultChannel; + let usAddress; + let shippingZone; + let warehouse; + let variantsList; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteShippingStartsWith(startsWith); - deleteProductsStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteShippingStartsWith(startsWith); + deleteProductsStartsWith(startsWith); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }) - .then(({ usAddress: usAddressResp }) => { - usAddress = usAddressResp; - createShippingZone(name, "US", defaultChannel.id); - }) - .then(shippingZoneResp => { - shippingZone = shippingZoneResp; - createWarehouse({ - name, - shippingZone: shippingZone.id, - address: usAddress - }); - }) - .then(warehouseResp => { - warehouse = warehouseResp; - createTypeAttributeAndCategoryForProduct({ name }); - }) - .then(({ attribute, productType, category }) => { - createProductInChannel({ - name, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - attributeId: attribute.id, - categoryId: category.id, - productTypeId: productType.id, - weight: 10 - }); - }) - .then(({ variantsList: variantsListResp }) => { - variantsList = variantsListResp; + getDefaultChannel() + .then(channel => { + defaultChannel = channel; + cy.fixture("addresses"); + }) + .then(({ usAddress: usAddressResp }) => { + usAddress = usAddressResp; + createShippingZone(name, "US", defaultChannel.id); + }) + .then(shippingZoneResp => { + shippingZone = shippingZoneResp; + createWarehouse({ + name, + shippingZone: shippingZone.id, + address: usAddress }); - }); + }) + .then(warehouseResp => { + warehouse = warehouseResp; + createTypeAttributeAndCategoryForProduct({ name }); + }) + .then(({ attribute, productType, category }) => { + createProductInChannel({ + name, + channelId: defaultChannel.id, + warehouseId: warehouse.id, + attributeId: attribute.id, + categoryId: category.id, + productTypeId: productType.id, + weight: 10 + }); + }) + .then(({ variantsList: variantsListResp }) => { + variantsList = variantsListResp; + }); + }); - beforeEach(() => { - cy.clearSessionData() - .loginUserViaRequest("auth", ONE_PERMISSION_USERS.shipping) - .visit(shippingZoneDetailsUrl(shippingZone.id)); - }); + beforeEach(() => { + cy.clearSessionData() + .loginUserViaRequest("auth", ONE_PERMISSION_USERS.shipping) + .visit(shippingZoneDetailsUrl(shippingZone.id)); + }); - it("should be possible to buy product in a shipping weight limits. TC: SALEOR_0902", () => { + it( + "should be possible to buy product in a shipping weight limits. TC: SALEOR_0902", + { tags: ["@shipping", "@allEnv", "@stable"] }, + () => { const rateName = `${startsWith}${faker.datatype.number()}`; createShippingRate({ @@ -106,9 +107,13 @@ filterTests({ definedTags: ["all"] }, () => { .then(({ checkout }) => { expect(isShippingAvailableInCheckout(checkout, rateName)).to.be.true; }); - }); + } + ); - it("should not be possible to buy product not in a shipping weight limits. TC: SALEOR_0903", () => { + it( + "should not be possible to buy product not in a shipping weight limits. TC: SALEOR_0903", + { tags: ["@shipping", "@allEnv", "@stable"] }, + () => { const rateName = `${startsWith}${faker.datatype.number()}`; createShippingRate({ @@ -131,6 +136,6 @@ filterTests({ definedTags: ["all"] }, () => { .then(({ checkout }) => { expect(isShippingAvailableInCheckout(checkout, rateName)).to.be.false; }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/shippingMethods/shippingWeights/weightRecalculate.js b/cypress/e2e/configuration/shippingMethods/shippingWeights/weightRecalculate.js index 4ce856043..029141c4f 100644 --- a/cypress/e2e/configuration/shippingMethods/shippingWeights/weightRecalculate.js +++ b/cypress/e2e/configuration/shippingMethods/shippingWeights/weightRecalculate.js @@ -14,41 +14,42 @@ import { updateShopWeightUnit } from "../../../../support/api/requests/ShopSetti import { getDefaultChannel } from "../../../../support/api/utils/channelsUtils"; import { deleteProductsStartsWith } from "../../../../support/api/utils/products/productsUtils"; import { deleteShippingStartsWith } from "../../../../support/api/utils/shippingUtils"; -import filterTests from "../../../../support/filterTests"; import { changeWeightUnit } from "../../../../support/pages/shippingMethodPage"; -filterTests({ definedTags: ["all"] }, () => { - xdescribe("As a staff user I want to change shop default weight unit", () => { - const startsWith = "RecalculateWeight"; - const name = `${startsWith}${faker.datatype.number()}`; +xdescribe("As a staff user I want to change shop default weight unit", () => { + const startsWith = "RecalculateWeight"; + const name = `${startsWith}${faker.datatype.number()}`; - let defaultChannel; - let usAddress; - let shippingZone; + let defaultChannel; + let usAddress; + let shippingZone; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteShippingStartsWith(startsWith); - deleteProductsStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteShippingStartsWith(startsWith); + deleteProductsStartsWith(startsWith); - updateShopWeightUnit("KG") - .then(() => { - getDefaultChannel().then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }); - }) - .then(({ usAddress: usAddressResp }) => { - usAddress = usAddressResp; - createShippingZone(name, "US", defaultChannel.id); - }) - .then(shippingZoneResp => { - shippingZone = shippingZoneResp; + updateShopWeightUnit("KG") + .then(() => { + getDefaultChannel().then(channel => { + defaultChannel = channel; + cy.fixture("addresses"); }); - }); + }) + .then(({ usAddress: usAddressResp }) => { + usAddress = usAddressResp; + createShippingZone(name, "US", defaultChannel.id); + }) + .then(shippingZoneResp => { + shippingZone = shippingZoneResp; + }); + }); - // Log in as user with shipping permissions after resolving SALEOR-3407 bug - it("should recalculate weight after changing shipping weight unit. TC: SALEOR_0901", () => { + // Log in as user with shipping permissions after resolving SALEOR-3407 bug + it( + "should recalculate weight after changing shipping weight unit. TC: SALEOR_0901", + { tags: ["@shipping", "@allEnv", "@stable"] }, + () => { const rateName = `${startsWith}${faker.datatype.number()}`; const minWeightInKg = 1; const maxWeightInKg = 10; @@ -98,6 +99,6 @@ filterTests({ definedTags: ["all"] }, () => { .then(actualMaxWeight => { expect(parseInt(actualMaxWeight, 10)).to.eq(maxWeightInG); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/siteSettings.js b/cypress/e2e/configuration/siteSettings.js index b2a10ef32..91a3be110 100644 --- a/cypress/e2e/configuration/siteSettings.js +++ b/cypress/e2e/configuration/siteSettings.js @@ -10,41 +10,42 @@ import { getShopInfo, updateShopAddress } from "../../support/api/requests/ShopSettings"; -import filterTests from "../../support/filterTests"; -filterTests({ definedTags: ["all"] }, () => { - xdescribe("Tests for site settings", () => { - let address; +xdescribe("Tests for site settings", () => { + let address; - before(() => { - cy.clearSessionData().loginUserViaRequest(); + before(() => { + cy.clearSessionData().loginUserViaRequest(); - cy.fixture("addresses").then(({ usAddress, plAddress }) => { - address = usAddress; - updateShopAddress(plAddress); - }); + cy.fixture("addresses").then(({ usAddress, plAddress }) => { + address = usAddress; + updateShopAddress(plAddress); }); + }); - beforeEach(() => { - cy.clearSessionData() - .loginUserViaRequest() - .visit(urlList.siteSettings); + beforeEach(() => { + cy.clearSessionData() + .loginUserViaRequest() + .visit(urlList.siteSettings); + }); + + it("should change store name", { tags: ["@siteSettings", "@allEnv"] }, () => { + const name = `Cypress-${faker.datatype.number()}`; + + cy.get(SITE_SETTINGS_DETAILS.nameInput) + .clearAndType(name) + .get(BUTTON_SELECTORS.confirm) + .click() + .confirmationMessageShouldDisappear(); + getShopInfo().then(shopInfo => { + expect(shopInfo.name).to.eq(name); }); + }); - it("should change store name", () => { - const name = `Cypress-${faker.datatype.number()}`; - - cy.get(SITE_SETTINGS_DETAILS.nameInput) - .clearAndType(name) - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear(); - getShopInfo().then(shopInfo => { - expect(shopInfo.name).to.eq(name); - }); - }); - - it("should change store description", () => { + it( + "should change store description", + { tags: ["@siteSettings", "@allEnv"] }, + () => { const description = faker.lorem.sentence(); cy.get(SITE_SETTINGS_DETAILS.descriptionInput) @@ -55,9 +56,13 @@ filterTests({ definedTags: ["all"] }, () => { getShopInfo().then(shopInfo => { expect(shopInfo.description).to.eq(description); }); - }); + } + ); - it("should change store address", () => { + it( + "should change store address", + { tags: ["@siteSettings", "@allEnv"] }, + () => { cy.fillUpBasicAddress(address) .get(BUTTON_SELECTORS.confirm) .click() @@ -66,6 +71,6 @@ filterTests({ definedTags: ["all"] }, () => { expect(companyAddress.companyName).to.eq(address.companyName); cy.expectCorrectBasicAddress(companyAddress, address); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/configuration/warehouses/warehouse.js b/cypress/e2e/configuration/warehouses/warehouse.js index fd087a98a..5cb85e9f1 100644 --- a/cypress/e2e/configuration/warehouses/warehouse.js +++ b/cypress/e2e/configuration/warehouses/warehouse.js @@ -19,51 +19,52 @@ import { } from "../../../support/api/requests/Warehouse"; import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; import { deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils"; -import filterTests from "../../../support/filterTests"; -filterTests({ definedTags: ["all"] }, () => { - describe("Warehouse settings", () => { - const startsWith = "CyWarehouse"; - let usAddress; - let secondUsAddress; +describe("Warehouse settings", () => { + const startsWith = "CyWarehouse"; + let usAddress; + let secondUsAddress; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteShippingStartsWith(startsWith); - cy.fixture("addresses").then(addresses => { - usAddress = addresses.usAddress; - secondUsAddress = addresses.secondUsAddress; + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteShippingStartsWith(startsWith); + cy.fixture("addresses").then(addresses => { + usAddress = addresses.usAddress; + secondUsAddress = addresses.secondUsAddress; + }); + }); + + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); + + it("should create warehouse", { tags: ["@warehouse", "@allEnv"] }, () => { + const name = `${startsWith}${faker.datatype.number()}`; + cy.visit(urlList.warehouses) + .get(WAREHOUSES_LIST.createNewButton) + .click() + .get(WAREHOUSES_DETAILS.nameInput) + .type(name) + .fillUpBasicAddress(usAddress) + .addAliasToGraphRequest("WarehouseCreate") + .get(BUTTON_SELECTORS.confirm) + .click() + .waitForRequestAndCheckIfNoErrors("@WarehouseCreate") + .its("response.body.data.createWarehouse.warehouse") + .then(warehouse => { + getWarehouse(warehouse.id); + }) + .then(warehouse => { + const addressResp = warehouse.address; + expect(warehouse.name).to.be.eq(name); + cy.expectCorrectBasicAddress(addressResp, usAddress); }); - }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); - - it("should create warehouse", () => { - const name = `${startsWith}${faker.datatype.number()}`; - cy.visit(urlList.warehouses) - .get(WAREHOUSES_LIST.createNewButton) - .click() - .get(WAREHOUSES_DETAILS.nameInput) - .type(name) - .fillUpBasicAddress(usAddress) - .addAliasToGraphRequest("WarehouseCreate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@WarehouseCreate") - .its("response.body.data.createWarehouse.warehouse") - .then(warehouse => { - getWarehouse(warehouse.id); - }) - .then(warehouse => { - const addressResp = warehouse.address; - chai.softExpect(warehouse.name).to.be.eq(name); - cy.expectCorrectBasicAddress(addressResp, usAddress); - }); - }); - - it("should add warehouse to shipping zone", () => { + it( + "should add warehouse to shipping zone", + { tags: ["@warehouse", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; let defaultChannel; let warehouse; @@ -99,26 +100,30 @@ filterTests({ definedTags: ["all"] }, () => { shippingZone.id ); }); - }); + } + ); - it("should delete warehouse", () => { - const name = `${startsWith}${faker.datatype.number()}`; - createWarehouseViaApi({ - name, - address: usAddress - }).then(warehouse => { - cy.visit(warehouseDetailsUrl(warehouse.id)) - .get(BUTTON_SELECTORS.deleteButton) - .click() - .addAliasToGraphRequest("WarehouseDelete") - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@WarehouseDelete"); - getWarehouse(warehouse.id).should("be.null"); - }); + it("should delete warehouse", { tags: ["@warehouse", "@allEnv"] }, () => { + const name = `${startsWith}${faker.datatype.number()}`; + createWarehouseViaApi({ + name, + address: usAddress + }).then(warehouse => { + cy.visit(warehouseDetailsUrl(warehouse.id)) + .get(BUTTON_SELECTORS.deleteButton) + .click() + .addAliasToGraphRequest("WarehouseDelete") + .get(BUTTON_SELECTORS.submit) + .click() + .waitForRequestAndCheckIfNoErrors("@WarehouseDelete"); + getWarehouse(warehouse.id).should("be.null"); }); + }); - it("should remove warehouse from shipping zone", () => { + it( + "should remove warehouse from shipping zone", + { tags: ["@warehouse", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; let defaultChannel; let warehouse; @@ -151,34 +156,34 @@ filterTests({ definedTags: ["all"] }, () => { .then(warehouseResp => { expect(warehouseResp.shippingZones.edges).to.be.empty; }); - }); + } + ); - it("should update warehouse", () => { - const name = `${startsWith}${faker.datatype.number()}`; - const updatedName = `${startsWith}${faker.datatype.number()}`; - let warehouse; + it("should update warehouse", { tags: ["@warehouse", "@allEnv"] }, () => { + const name = `${startsWith}${faker.datatype.number()}`; + const updatedName = `${startsWith}${faker.datatype.number()}`; + let warehouse; - createWarehouseViaApi({ - name, - address: usAddress + createWarehouseViaApi({ + name, + address: usAddress + }) + .then(warehouseResp => { + warehouse = warehouseResp; + cy.visit(warehouseDetailsUrl(warehouse.id)) + .get(WAREHOUSES_DETAILS.nameInput) + .clearAndType(updatedName) + .fillUpBasicAddress(secondUsAddress) + .addAliasToGraphRequest("WarehouseUpdate") + .get(BUTTON_SELECTORS.confirm) + .click() + .waitForRequestAndCheckIfNoErrors("@WarehouseUpdate"); + getWarehouse(warehouse.id); }) - .then(warehouseResp => { - warehouse = warehouseResp; - cy.visit(warehouseDetailsUrl(warehouse.id)) - .get(WAREHOUSES_DETAILS.nameInput) - .clearAndType(updatedName) - .fillUpBasicAddress(secondUsAddress) - .addAliasToGraphRequest("WarehouseUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@WarehouseUpdate"); - getWarehouse(warehouse.id); - }) - .then(warehouseResp => { - const addressResp = warehouseResp.address; - chai.softExpect(warehouseResp.name).to.be.eq(updatedName); - cy.expectCorrectBasicAddress(addressResp, secondUsAddress); - }); - }); + .then(warehouseResp => { + const addressResp = warehouseResp.address; + expect(warehouseResp.name).to.be.eq(updatedName); + cy.expectCorrectBasicAddress(addressResp, secondUsAddress); + }); }); }); diff --git a/cypress/e2e/customerRegistration.js b/cypress/e2e/customerRegistration.js index a92d8724e..532e26e84 100644 --- a/cypress/e2e/customerRegistration.js +++ b/cypress/e2e/customerRegistration.js @@ -29,32 +29,32 @@ describe("Tests for customer registration", () => { }); }); - filterTests({ definedTags: ["stagedOnly"] }, () => { - it("should register customer", () => { - const email = `${startsWith}${faker.datatype.number()}@example.com`; - customerRegistration({ email, channel: defaultChannel.slug }); - getMailActivationLinkForUser(email) - .then(urlLink => { - const tokenRegex = /token=(.*)/; - const token = urlLink.match(tokenRegex)[1]; - cy.clearSessionData(); - confirmAccount(email, token); - }) - .then(() => { - cy.loginUserViaRequest("token", { - email, - password: Cypress.env("USER_PASSWORD") - }).its("body.data.tokenCreate"); - }) - .then(({ errors, token }) => { - expect(errors.length).to.eq(0); - expect(token).to.be.ok; - }); - }); + it("should register customer", { tags: ["@customer", "@stagedOnly"] }, () => { + const email = `${startsWith}${faker.datatype.number()}@example.com`; + customerRegistration({ email, channel: defaultChannel.slug }); + getMailActivationLinkForUser(email) + .then(urlLink => { + const tokenRegex = /token=(.*)/; + const token = urlLink.match(tokenRegex)[1]; + cy.clearSessionData(); + confirmAccount(email, token); + }) + .then(() => { + cy.loginUserViaRequest("token", { + email, + password: Cypress.env("USER_PASSWORD") + }).its("body.data.tokenCreate"); + }) + .then(({ errors, token }) => { + expect(errors.length).to.eq(0); + expect(token).to.be.ok; + }); }); - filterTests(["all"], () => { - it("shouldn't register customer with duplicated email", () => { + it( + "shouldn't register customer with duplicated email", + { tags: ["@customer", "@allEnv", "@stable"] }, + () => { const duplicatedEmail = Cypress.env("USER_NAME"); customerRegistration({ duplicatedEmail, @@ -63,9 +63,13 @@ describe("Tests for customer registration", () => { expect(errors[0].field).to.eq("email"); expect(user).to.not.be.ok; }); - }); + } + ); - it("should activate customer from dashboard", () => { + it( + "should activate customer from dashboard", + { tags: ["@customer", "@allEnv", "@stable"] }, + () => { customerRegistration({ email, channel: defaultChannel.slug }) .then(({ user }) => { cy.clearSessionData() @@ -87,6 +91,6 @@ describe("Tests for customer registration", () => { expect(errors.length).to.eq(0); expect(token).to.be.ok; }); - }); - }); + } + ); }); diff --git a/cypress/e2e/discounts/sales.js b/cypress/e2e/discounts/sales.js index 144a3fc8c..5d117d5e6 100644 --- a/cypress/e2e/discounts/sales.js +++ b/cypress/e2e/discounts/sales.js @@ -25,67 +25,68 @@ import { createShipping, deleteShippingStartsWith } from "../../support/api/utils/shippingUtils"; -import filterTests from "../../support/filterTests"; -filterTests({ definedTags: ["all"] }, () => { - describe("Create sale with assigned products", () => { - const startsWith = "CySales"; - const saleValue = 10; +describe("Create sale with assigned products", () => { + const startsWith = "CySales"; + const saleValue = 10; - let channel; - let sale; - let warehouse; - let address; - let productData; + let channel; + let sale; + let warehouse; + let address; + let productData; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteProductsStartsWith(startsWith); - deleteShippingStartsWith(startsWith); - deleteSalesStartsWith(startsWith); - getDefaultChannel() - .then(defaultChannel => { - channel = defaultChannel; - createSaleInChannel({ - name: startsWith, - type: "FIXED", - value: saleValue, - channelId: channel.id - }); - }) - .then(saleResp => (sale = saleResp)); - cy.fixture("addresses") - .then(addresses => { - address = addresses.usAddress; - createShipping({ - channelId: channel.id, - address, - name: startsWith - }); - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteProductsStartsWith(startsWith); + deleteShippingStartsWith(startsWith); + deleteSalesStartsWith(startsWith); + getDefaultChannel() + .then(defaultChannel => { + channel = defaultChannel; + createSaleInChannel({ + name: startsWith, + type: "FIXED", + value: saleValue, + channelId: channel.id }); - createTypeAttributeAndCategoryForProduct({ - name: startsWith, - attributeValues: ["value1", "value2"] - }).then(({ attribute, category, productType }) => { - productData = { - attributeId: attribute.id, - categoryId: category.id, - productTypeId: productType.id, + }) + .then(saleResp => (sale = saleResp)); + cy.fixture("addresses") + .then(addresses => { + address = addresses.usAddress; + createShipping({ channelId: channel.id, - warehouseId: warehouse.id, - price: 30 - }; + address, + name: startsWith + }); + }) + .then(({ warehouse: warehouseResp }) => { + warehouse = warehouseResp; }); + createTypeAttributeAndCategoryForProduct({ + name: startsWith, + attributeValues: ["value1", "value2"] + }).then(({ attribute, category, productType }) => { + productData = { + attributeId: attribute.id, + categoryId: category.id, + productTypeId: productType.id, + channelId: channel.id, + warehouseId: warehouse.id, + price: 30 + }; }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should discount only variants added to sale", () => { + it( + "should discount only variants added to sale", + { tags: ["@sales", "@allEnv", "@stable"] }, + () => { const productName = `${startsWith}${faker.datatype.number()}`; const name = `${startsWith}${faker.datatype.number()}`; @@ -132,52 +133,54 @@ filterTests({ definedTags: ["all"] }, () => { productData.price - saleValue ); }); - }); + } + ); - it("should delete sale", () => { - const name = `${startsWith}${faker.datatype.number()}`; - let variants; - let saleToDelete; - productData.name = name; - productData.sku = name; - createProductInChannel(productData) - .then(({ variantsList }) => { - variants = variantsList; - createSaleInChannelWithProduct({ - name, - type: "FIXED", - value: saleValue, - channelId: channel.id, - variants - }); - }) - .then(saleResp => { - saleToDelete = saleResp; - getVariant(variants[0].id, channel.slug); - }) - .then(variantResp => { - expect(variantResp.pricing.onSale).to.be.true; - expect(variantResp.pricing.price.gross.amount).to.eq( - productData.price - saleValue - ); - cy.visit(saleDetailsUrl(saleToDelete.id)) - .addAliasToGraphRequest("SaleDelete") - .get(BUTTON_SELECTORS.deleteButton) - .click() - .get(BUTTON_SELECTORS.submit) - .click() - .wait("@SaleDelete"); - getVariant(variants[0].id, channel.slug); - }) - .then(variantResp => { - expect(variantResp.pricing.onSale).to.be.false; - expect(variantResp.pricing.price.gross.amount).to.eq( - productData.price - ); + it("should delete sale", { tags: ["@sales", "@allEnv", "@stable"] }, () => { + const name = `${startsWith}${faker.datatype.number()}`; + let variants; + let saleToDelete; + productData.name = name; + productData.sku = name; + createProductInChannel(productData) + .then(({ variantsList }) => { + variants = variantsList; + createSaleInChannelWithProduct({ + name, + type: "FIXED", + value: saleValue, + channelId: channel.id, + variants }); - }); + }) + .then(saleResp => { + saleToDelete = saleResp; + getVariant(variants[0].id, channel.slug); + }) + .then(variantResp => { + expect(variantResp.pricing.onSale).to.be.true; + expect(variantResp.pricing.price.gross.amount).to.eq( + productData.price - saleValue + ); + cy.visit(saleDetailsUrl(saleToDelete.id)) + .addAliasToGraphRequest("SaleDelete") + .get(BUTTON_SELECTORS.deleteButton) + .click() + .get(BUTTON_SELECTORS.submit) + .click() + .wait("@SaleDelete"); + getVariant(variants[0].id, channel.slug); + }) + .then(variantResp => { + expect(variantResp.pricing.onSale).to.be.false; + expect(variantResp.pricing.price.gross.amount).to.eq(productData.price); + }); + }); - xit("should remove variant from sale", () => { + xit( + "should remove variant from sale", + { tags: ["@sales", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; let product; let variants; @@ -216,6 +219,6 @@ filterTests({ definedTags: ["all"] }, () => { productData.price ); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/discounts/salesForProducts.js b/cypress/e2e/discounts/salesForProducts.js index c699e33d7..3b37d190f 100644 --- a/cypress/e2e/discounts/salesForProducts.js +++ b/cypress/e2e/discounts/salesForProducts.js @@ -14,7 +14,6 @@ import { deleteShippingStartsWith } from "../../support/api/utils/shippingUtils"; import { getProductPrice } from "../../support/api/utils/storeFront/storeFrontProductUtils"; -import filterTests from "../../support/filterTests"; import { assignProducts, createSale, @@ -22,61 +21,63 @@ import { discountOptions } from "../../support/pages/discounts/salesPage"; -filterTests({ definedTags: ["all"] }, () => { - xdescribe("Sales discounts for products", () => { - const startsWith = "CySales-"; +xdescribe("Sales discounts for products", () => { + const startsWith = "CySales-"; - let productType; - let attribute; - let category; - let defaultChannel; - let warehouse; + let productType; + let attribute; + let category; + let defaultChannel; + let warehouse; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - channelsUtils.deleteChannelsStartsWith(startsWith); - deleteSalesStartsWith(startsWith); - productsUtils.deleteProductsStartsWith(startsWith); - deleteShippingStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + channelsUtils.deleteChannelsStartsWith(startsWith); + deleteSalesStartsWith(startsWith); + productsUtils.deleteProductsStartsWith(startsWith); + deleteShippingStartsWith(startsWith); - const name = `${startsWith}${faker.datatype.number()}`; - productsUtils - .createTypeAttributeAndCategoryForProduct({ name }) - .then( - ({ - productType: productTypeResp, - attribute: attributeResp, - category: categoryResp - }) => { - productType = productTypeResp; - attribute = attributeResp; - category = categoryResp; + const name = `${startsWith}${faker.datatype.number()}`; + productsUtils + .createTypeAttributeAndCategoryForProduct({ name }) + .then( + ({ + productType: productTypeResp, + attribute: attributeResp, + category: categoryResp + }) => { + productType = productTypeResp; + attribute = attributeResp; + category = categoryResp; - channelsUtils.getDefaultChannel(); - } - ) - .then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }) - .then(addresses => { - createShipping({ - channelId: defaultChannel.id, - name, - address: addresses.plAddress, - price: 100 - }); - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; + channelsUtils.getDefaultChannel(); + } + ) + .then(channel => { + defaultChannel = channel; + cy.fixture("addresses"); + }) + .then(addresses => { + createShipping({ + channelId: defaultChannel.id, + name, + address: addresses.plAddress, + price: 100 }); - }); + }) + .then(({ warehouse: warehouseResp }) => { + warehouse = warehouseResp; + }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should create percentage discount", () => { + it( + "should create percentage discount", + { tags: ["@sales", "@allEnv"] }, + () => { const saleName = `${startsWith}${faker.datatype.number()}`; const discountValue = 50; const productPrice = 100; @@ -95,9 +96,13 @@ filterTests({ definedTags: ["all"] }, () => { const expectedPrice = (productPrice * discountValue) / 100; expect(expectedPrice).to.be.eq(price); }); - }); + } + ); - it("should create fixed price discount", () => { + it( + "should create fixed price discount", + { tags: ["@sales", "@allEnv"] }, + () => { const saleName = `${startsWith}${faker.datatype.number()}`; const discountValue = 50; const productPrice = 100; @@ -116,9 +121,13 @@ filterTests({ definedTags: ["all"] }, () => { const expectedPrice = productPrice - discountValue; expect(expectedPrice).to.be.eq(price); }); - }); + } + ); - it("should not displayed discount not assign to channel", () => { + it( + "should not displayed discount not assign to channel", + { tags: ["@sales", "@allEnv"] }, + () => { const saleName = `${startsWith}${faker.datatype.number()}`; let channel; let product; @@ -152,7 +161,7 @@ filterTests({ definedTags: ["all"] }, () => { */ cy.visit(urlList.sales); - cy.softExpectSkeletonIsVisible(); + cy.expectSkeletonIsVisible(); createSale({ saleName, channelName: channel.name, @@ -162,6 +171,6 @@ filterTests({ definedTags: ["all"] }, () => { getProductPrice(product.id, defaultChannel.slug); }) .then(price => expect(price).to.equal(productPrice)); - }); - }); + } + ); }); diff --git a/cypress/e2e/discounts/salesForVariants.js b/cypress/e2e/discounts/salesForVariants.js index 339532ba6..0d4d6bbe2 100644 --- a/cypress/e2e/discounts/salesForVariants.js +++ b/cypress/e2e/discounts/salesForVariants.js @@ -10,66 +10,67 @@ import { createShipping, deleteShippingStartsWith } from "../../support/api/utils/shippingUtils"; -import filterTests from "../../support/filterTests"; import { createSaleWithNewVariant, discountOptions } from "../../support/pages/discounts/salesPage"; -filterTests({ definedTags: ["all"] }, () => { - xdescribe("Sales discounts for variant", () => { - const startsWith = "CySales-"; +xdescribe("Sales discounts for variant", () => { + const startsWith = "CySales-"; - let productType; - let attribute; - let category; - let defaultChannel; - let warehouse; + let productType; + let attribute; + let category; + let defaultChannel; + let warehouse; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteSalesStartsWith(startsWith); - productsUtils.deleteProductsStartsWith(startsWith); - deleteShippingStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteSalesStartsWith(startsWith); + productsUtils.deleteProductsStartsWith(startsWith); + deleteShippingStartsWith(startsWith); - const name = `${startsWith}${faker.datatype.number()}`; - productsUtils - .createTypeAttributeAndCategoryForProduct({ name }) - .then( - ({ - productType: productTypeResp, - attribute: attributeResp, - category: categoryResp - }) => { - productType = productTypeResp; - attribute = attributeResp; - category = categoryResp; + const name = `${startsWith}${faker.datatype.number()}`; + productsUtils + .createTypeAttributeAndCategoryForProduct({ name }) + .then( + ({ + productType: productTypeResp, + attribute: attributeResp, + category: categoryResp + }) => { + productType = productTypeResp; + attribute = attributeResp; + category = categoryResp; - channelsUtils.getDefaultChannel(); - } - ) - .then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }) - .then(addresses => { - createShipping({ - channelId: defaultChannel.id, - name, - address: addresses.plAddress, - price: 100 - }); - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; + channelsUtils.getDefaultChannel(); + } + ) + .then(channel => { + defaultChannel = channel; + cy.fixture("addresses"); + }) + .then(addresses => { + createShipping({ + channelId: defaultChannel.id, + name, + address: addresses.plAddress, + price: 100 }); - }); + }) + .then(({ warehouse: warehouseResp }) => { + warehouse = warehouseResp; + }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should create percentage discount", () => { + it( + "should create percentage discount", + { tags: ["@sales", "@allEnv"] }, + () => { const saleName = `${startsWith}${faker.datatype.number()}`; const discountValue = 50; const productPrice = 100; @@ -89,9 +90,13 @@ filterTests({ definedTags: ["all"] }, () => { const expectedPrice = (productPrice * discountValue) / 100; expect(expectedPrice).to.be.eq(priceInResponse); }); - }); + } + ); - it("should create fixed price discount", () => { + it( + "should create fixed price discount", + { tags: ["@sales", "@allEnv"] }, + () => { const saleName = `${startsWith}${faker.datatype.number()}`; const discountValue = 50; const productPrice = 100; @@ -111,6 +116,6 @@ filterTests({ definedTags: ["all"] }, () => { const expectedPrice = productPrice - discountValue; expect(expectedPrice).to.be.eq(priceInResponse); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/discounts/vouchers/createVouchers.js b/cypress/e2e/discounts/vouchers/createVouchers.js index 9d90a8d9d..808d71191 100644 --- a/cypress/e2e/discounts/vouchers/createVouchers.js +++ b/cypress/e2e/discounts/vouchers/createVouchers.js @@ -20,53 +20,55 @@ import { loginAndCreateCheckoutForVoucherWithDiscount } from "../../../support/pages/discounts/vouchersPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("As an admin I want to create voucher", () => { - const startsWith = "CyVou-"; - const productPrice = 100; - const shippingPrice = 100; +describe("As an admin I want to create voucher", () => { + const startsWith = "CyVou-"; + const productPrice = 100; + const shippingPrice = 100; - let defaultChannel; - let createdChannel; - let shippingMethod; - let variants; - let address; - let dataForCheckout; + let defaultChannel; + let createdChannel; + let shippingMethod; + let variants; + let address; + let dataForCheckout; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - channelsUtils.deleteChannelsStartsWith(startsWith); - deleteVouchersStartsWith(startsWith); - const name = `${startsWith}${faker.datatype.number()}`; - productsUtils - .createProductWithShipping({ name, productPrice, shippingPrice }) - .then( - ({ - variantsList: variantsResp, - defaultChannel: channel, - shippingMethod: shippingMethodResp, - address: addressResp - }) => { - variants = variantsResp; - defaultChannel = channel; - shippingMethod = shippingMethodResp; - address = addressResp; - createChannel({ name }); - } - ) - .then(channel => { - createdChannel = channel; - dataForCheckout = { - channelSlug: defaultChannel.slug, - variantsList: variants, - address, - shippingMethodName: shippingMethod.name, - auth: "token" - }; - }); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + channelsUtils.deleteChannelsStartsWith(startsWith); + deleteVouchersStartsWith(startsWith); + const name = `${startsWith}${faker.datatype.number()}`; + productsUtils + .createProductWithShipping({ name, productPrice, shippingPrice }) + .then( + ({ + variantsList: variantsResp, + defaultChannel: channel, + shippingMethod: shippingMethodResp, + address: addressResp + }) => { + variants = variantsResp; + defaultChannel = channel; + shippingMethod = shippingMethodResp; + address = addressResp; + createChannel({ name }); + } + ) + .then(channel => { + createdChannel = channel; + dataForCheckout = { + channelSlug: defaultChannel.slug, + variantsList: variants, + address, + shippingMethodName: shippingMethod.name, + auth: "token" + }; + }); + }); - it("should be able to create fixed price voucher. TC: SALEOR_1901", () => { + it( + "should be able to create fixed price voucher. TC: SALEOR_1901", + { tags: ["@vouchers", "@allEnv", "@stable"] }, + () => { const voucherValue = 50; const voucherCode = `${startsWith}${faker.datatype.number()}`; const expectedAmount = productPrice + shippingPrice - voucherValue; @@ -93,9 +95,13 @@ filterTests({ definedTags: ["all"] }, () => { .then(({ order }) => { expect(order.id).to.be.ok; }); - }); + } + ); - it("should be able to create percentage voucher. TC: SALEOR_1902", () => { + it( + "should be able to create percentage voucher. TC: SALEOR_1902", + { tags: ["@vouchers", "@allEnv", "@stable"] }, + () => { const voucherValue = 50; const voucherCode = `${startsWith}${faker.datatype.number()}`; const expectedAmount = @@ -123,9 +129,13 @@ filterTests({ definedTags: ["all"] }, () => { .then(({ order }) => { expect(order.id).to.be.ok; }); - }); + } + ); - it("should be able to create free shipping voucher. TC: SALEOR_1903", () => { + it( + "should be able to create free shipping voucher. TC: SALEOR_1903", + { tags: ["@vouchers", "@allEnv", "@stable"] }, + () => { const voucherCode = `${startsWith}${faker.datatype.number()}`; const expectedAmount = productPrice; let checkout; @@ -150,16 +160,20 @@ filterTests({ definedTags: ["all"] }, () => { .then(({ order }) => { expect(order.id).to.be.ok; }); - }); + } + ); - it("should be able to create voucher not available for selected channel. TC: SALEOR_1904", () => { + it( + "should be able to create voucher not available for selected channel. TC: SALEOR_1904", + { tags: ["@vouchers", "@allEnv", "@stable"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; const voucherValue = 50; cy.clearSessionData() .loginUserViaRequest() .visit(urlList.vouchers); - cy.softExpectSkeletonIsVisible(); + cy.expectSkeletonIsVisible(); createVoucher({ voucherCode: randomName, voucherValue, @@ -173,6 +187,6 @@ filterTests({ definedTags: ["all"] }, () => { expect(errorField).to.be.eq("promoCode"); } ); - }); - }); + } + ); }); diff --git a/cypress/e2e/discounts/vouchers/createVouchersWithLimits.js b/cypress/e2e/discounts/vouchers/createVouchersWithLimits.js index d6d1515dd..89b44a885 100644 --- a/cypress/e2e/discounts/vouchers/createVouchersWithLimits.js +++ b/cypress/e2e/discounts/vouchers/createVouchersWithLimits.js @@ -11,54 +11,55 @@ import { createCheckoutWithVoucher } from "../../../support/api/utils/ordersUtils"; import * as productsUtils from "../../../support/api/utils/products/productsUtils"; -import filterTests from "../../../support/filterTests"; import { discountOptions, loginAndCreateCheckoutForVoucherWithDiscount } from "../../../support/pages/discounts/vouchersPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("As an admin I want to create voucher", () => { - const startsWith = "CyVou-"; - const productPrice = 100; - const shippingPrice = 100; +describe("As an admin I want to create voucher", () => { + const startsWith = "CyVou-"; + const productPrice = 100; + const shippingPrice = 100; - let defaultChannel; - let shippingMethod; - let variants; - let address; - let dataForCheckout; + let defaultChannel; + let shippingMethod; + let variants; + let address; + let dataForCheckout; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - channelsUtils.deleteChannelsStartsWith(startsWith); - deleteVouchersStartsWith(startsWith); - const name = `${startsWith}${faker.datatype.number()}`; - productsUtils - .createProductWithShipping({ name, productPrice, shippingPrice }) - .then( - ({ - variantsList: variantsResp, - defaultChannel: channel, - shippingMethod: shippingMethodResp, - address: addressResp - }) => { - variants = variantsResp; - defaultChannel = channel; - shippingMethod = shippingMethodResp; - address = addressResp; - dataForCheckout = { - channelSlug: defaultChannel.slug, - variantsList: variants, - address, - shippingMethodName: shippingMethod.name, - auth: "token" - }; - } - ); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + channelsUtils.deleteChannelsStartsWith(startsWith); + deleteVouchersStartsWith(startsWith); + const name = `${startsWith}${faker.datatype.number()}`; + productsUtils + .createProductWithShipping({ name, productPrice, shippingPrice }) + .then( + ({ + variantsList: variantsResp, + defaultChannel: channel, + shippingMethod: shippingMethodResp, + address: addressResp + }) => { + variants = variantsResp; + defaultChannel = channel; + shippingMethod = shippingMethodResp; + address = addressResp; + dataForCheckout = { + channelSlug: defaultChannel.slug, + variantsList: variants, + address, + shippingMethodName: shippingMethod.name, + auth: "token" + }; + } + ); + }); - it("should be able to create voucher with limited number of times discount can be used in total. TC: SALEOR_1907", () => { + it( + "should be able to create voucher with limited number of times discount can be used in total. TC: SALEOR_1907", + { tags: ["@vouchers", "@allEnv", "@stable"] }, + () => { const voucherCode = `${startsWith}${faker.datatype.number()}`; const voucherValue = 50; const usageLimit = 1; @@ -90,9 +91,13 @@ filterTests({ definedTags: ["all"] }, () => { "promoCode" ); }); - }); + } + ); - it("should be able to create voucher with limit to one use per customer. TC: SALEOR_1908", () => { + it( + "should be able to create voucher with limit to one use per customer. TC: SALEOR_1908", + { tags: ["@vouchers", "@allEnv", "@stable"] }, + () => { const voucherCode = `${startsWith}${faker.datatype.number()}`; const voucherValue = 50; dataForCheckout.auth = "token"; @@ -135,9 +140,13 @@ filterTests({ definedTags: ["all"] }, () => { const errorField = addPromoCodeResp.errors; expect(errorField, "No errors when adding promo code").to.be.empty; }); - }); + } + ); - xit("should be able to create voucher with limit to staff only. TC: SALEOR_1909", () => { + xit( + "should be able to create voucher with limit to staff only. TC: SALEOR_1909", + { tags: ["@vouchers", "@allEnv"] }, + () => { const voucherCode = `${startsWith}${faker.datatype.number()}`; const voucherValue = 50; dataForCheckout.auth = "auth"; @@ -170,9 +179,13 @@ filterTests({ definedTags: ["all"] }, () => { "promoCode" ); }); - }); + } + ); - xit("should be able to create voucher with minimum value of order. TC: SALEOR_1910", () => { + xit( + "should be able to create voucher with minimum value of order. TC: SALEOR_1910", + { tags: ["@vouchers", "@allEnv"] }, + () => { const voucherCode = `${startsWith}${faker.datatype.number()}`; const voucherValue = 50; const minOrderValue = productPrice * 1.5; @@ -200,36 +213,36 @@ filterTests({ definedTags: ["all"] }, () => { const errorField = addPromoCodeResp.errors; expect(errorField, "No errors when adding promo code").to.be.empty; }); - }); + } + ); - xit("should create voucher with min product quantity. TC: SALEOR_1911", () => { - const voucherCode = `${startsWith}${faker.datatype.number()}`; - const voucherValue = 50; - const minAmountOfItems = 2; - dataForCheckout.productQuantity = 1; + xit("should create voucher with min product quantity. TC: SALEOR_1911", () => { + const voucherCode = `${startsWith}${faker.datatype.number()}`; + const voucherValue = 50; + const minAmountOfItems = 2; + dataForCheckout.productQuantity = 1; - loginAndCreateCheckoutForVoucherWithDiscount({ - discount: discountOptions.PERCENTAGE, - voucherValue, - voucherCode, - channelName: defaultChannel.name, - dataForCheckout, - minAmountOfItems + loginAndCreateCheckoutForVoucherWithDiscount({ + discount: discountOptions.PERCENTAGE, + voucherValue, + voucherCode, + channelName: defaultChannel.name, + dataForCheckout, + minAmountOfItems + }) + .then(({ addPromoCodeResp }) => { + const errorField = addPromoCodeResp.errors[0].field; + dataForCheckout.voucherCode = voucherCode; + + expect(errorField, "error in promo code should occur").to.be.eq( + "promoCode" + ); + dataForCheckout.productQuantity = 2; + createCheckoutWithVoucher(dataForCheckout); }) - .then(({ addPromoCodeResp }) => { - const errorField = addPromoCodeResp.errors[0].field; - dataForCheckout.voucherCode = voucherCode; - - expect(errorField, "error in promo code should occur").to.be.eq( - "promoCode" - ); - dataForCheckout.productQuantity = 2; - createCheckoutWithVoucher(dataForCheckout); - }) - .then(({ addPromoCodeResp }) => { - const errorField = addPromoCodeResp.errors; - expect(errorField, "No errors when adding promo code").to.be.empty; - }); - }); + .then(({ addPromoCodeResp }) => { + const errorField = addPromoCodeResp.errors; + expect(errorField, "No errors when adding promo code").to.be.empty; + }); }); }); diff --git a/cypress/e2e/discounts/vouchers/updateVouchers.js b/cypress/e2e/discounts/vouchers/updateVouchers.js index 96b447816..02e016f5f 100644 --- a/cypress/e2e/discounts/vouchers/updateVouchers.js +++ b/cypress/e2e/discounts/vouchers/updateVouchers.js @@ -12,49 +12,50 @@ import { } from "../../../support/api/utils/discounts/vouchersUtils"; import { createCheckoutWithVoucher } from "../../../support/api/utils/ordersUtils"; import * as productsUtils from "../../../support/api/utils/products/productsUtils"; -import filterTests from "../../../support/filterTests"; import { formatDate, formatTime } from "../../../support/formatData/formatDate"; import { setVoucherDate } from "../../../support/pages/discounts/vouchersPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("As an admin I want to update vouchers", () => { - const startsWith = "CyVou-"; - const productPrice = 100; - const shippingPrice = 100; +describe("As an admin I want to update vouchers", () => { + const startsWith = "CyVou-"; + const productPrice = 100; + const shippingPrice = 100; - let defaultChannel; - let product; - let dataForCheckout; + let defaultChannel; + let product; + let dataForCheckout; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteVouchersStartsWith(startsWith); - const name = `${startsWith}${faker.datatype.number()}`; - productsUtils - .createProductWithShipping({ name, productPrice, shippingPrice }) - .then( - ({ + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteVouchersStartsWith(startsWith); + const name = `${startsWith}${faker.datatype.number()}`; + productsUtils + .createProductWithShipping({ name, productPrice, shippingPrice }) + .then( + ({ + variantsList: variantsResp, + defaultChannel: channel, + shippingMethod: shippingMethodResp, + address: addressResp, + product: productResp + }) => { + defaultChannel = channel; + product = productResp; + + dataForCheckout = { + channelSlug: defaultChannel.slug, variantsList: variantsResp, - defaultChannel: channel, - shippingMethod: shippingMethodResp, address: addressResp, - product: productResp - }) => { - defaultChannel = channel; - product = productResp; + shippingMethodName: shippingMethodResp.name, + auth: "token" + }; + } + ); + }); - dataForCheckout = { - channelSlug: defaultChannel.slug, - variantsList: variantsResp, - address: addressResp, - shippingMethodName: shippingMethodResp.name, - auth: "token" - }; - } - ); - }); - - it("should delete voucher. TC: SALEOR_1905", () => { + it( + "should delete voucher. TC: SALEOR_1905", + { tags: ["@vouchers", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; const voucherValue = 50; @@ -84,9 +85,13 @@ filterTests({ definedTags: ["all"] }, () => { const errorField = addPromoCodeResp.errors[0].field; expect(errorField).to.be.eq("promoCode"); }); - }); + } + ); - it("should update voucher. TC: SALEOR_1906", () => { + it( + "should update voucher. TC: SALEOR_1906", + { tags: ["@vouchers", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; const voucherValue = 50; const voucherUpdatedValue = 20; @@ -123,9 +128,13 @@ filterTests({ definedTags: ["all"] }, () => { const amount = addPromoCodeResp.checkout.totalPrice.gross.amount; expect(amount).to.be.eq(expectedOrderAmount); }); - }); + } + ); - it("should set date on voucher. TC: SALEOR_1912", () => { + it( + "should set date on voucher. TC: SALEOR_1912", + { tags: ["@vouchers", "@allEnv", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; const voucherValue = 50; const today = new Date(); @@ -159,9 +168,13 @@ filterTests({ definedTags: ["all"] }, () => { .then(({ addPromoCodeResp }) => { expect(addPromoCodeResp.errors).to.be.empty; }); - }); + } + ); - it("should set end date on voucher. TC: SALEOR_1913", () => { + it( + "should set end date on voucher. TC: SALEOR_1913", + { tags: ["@vouchers", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; const voucherValue = 50; const today = new Date(); @@ -204,9 +217,13 @@ filterTests({ definedTags: ["all"] }, () => { .then(({ addPromoCodeResp }) => { expect(addPromoCodeResp.errors).to.be.empty; }); - }); + } + ); - it("should set country on voucher. TC: SALEOR_1914", () => { + it( + "should set country on voucher. TC: SALEOR_1914", + { tags: ["@vouchers", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; const voucherValue = 50; @@ -251,6 +268,6 @@ filterTests({ definedTags: ["all"] }, () => { const errorField = addPromoCodeResp.errors[0].field; expect(errorField).to.be.eq("promoCode"); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/homePage/homePage.js b/cypress/e2e/homePage/homePage.js index 9663e682e..5e680bda4 100644 --- a/cypress/e2e/homePage/homePage.js +++ b/cypress/e2e/homePage/homePage.js @@ -3,24 +3,33 @@ import { urlList } from "../../fixtures/urlList"; import { TEST_ADMIN_USER, USER_WITHOUT_NAME } from "../../fixtures/users"; -import filterTests from "../../support/filterTests"; import { expectWelcomeMessageIncludes } from "../../support/pages/homePage"; -filterTests({ definedTags: ["all"] }, () => { - describe("Displaying welcome message on home page", () => { - it("should display user name on home page", () => { +describe("Displaying welcome message on home page", () => { + it( + "should display user name on home page", + { tags: ["@homePage", "@allEnv", "@stable"] }, + () => { cy.loginUserViaRequest().visit(urlList.homePage); expectWelcomeMessageIncludes( `${TEST_ADMIN_USER.name} ${TEST_ADMIN_USER.lastName}` ); - }); + } + ); - it("should display user email on home page", () => { + it( + "should display user email on home page", + { tags: ["@homePage", "@allEnv", "@stable"] }, + () => { cy.loginUserViaRequest("auth", USER_WITHOUT_NAME).visit(urlList.homePage); expectWelcomeMessageIncludes(`${USER_WITHOUT_NAME.email}`); - }); + } + ); - it("should refresh page without errors", () => { + it( + "should refresh page without errors", + { tags: ["@homePage", "@allEnv", "@stable"] }, + () => { cy.loginUserViaRequest() .visit(urlList.homePage) .waitForProgressBarToNotExist() @@ -28,6 +37,6 @@ filterTests({ definedTags: ["all"] }, () => { expectWelcomeMessageIncludes( `${TEST_ADMIN_USER.name} ${TEST_ADMIN_USER.lastName}` ); - }); - }); + } + ); }); diff --git a/cypress/e2e/homePage/homePageAnalitics.js b/cypress/e2e/homePage/homePageAnalitics.js index 8cc8411f6..8b2917445 100644 --- a/cypress/e2e/homePage/homePageAnalitics.js +++ b/cypress/e2e/homePage/homePageAnalitics.js @@ -22,133 +22,133 @@ import { getTodaysOrdersRegex } from "../../support/pages/homePage"; -filterTests({ definedTags: ["all", "critical", "refactored"] }, () => { - describe("As an admin I want to see correct information on dashboard home page", () => { - const startsWith = "CyHomeAnalytics"; - const productPrice = 22; - const shippingPrice = 12; - const randomName = startsWith + faker.datatype.number(); - const randomEmail = `${startsWith}${randomName}@example.com`; +describe("As an admin I want to see correct information on dashboard home page", () => { + const startsWith = "CyHomeAnalytics"; + const productPrice = 22; + const shippingPrice = 12; + const randomName = startsWith + faker.datatype.number(); + const randomEmail = `${startsWith}${randomName}@example.com`; - let customer; - let defaultChannel; - let createdVariants; - let productType; - let attribute; - let category; - let warehouse; - let shippingMethod; - let address; - let ordersReadyToFulfillRegexp; - let ordersReadyForCaptureRegexp; - let productsOutOfStockRegexp; - let salesAmountRegexp; - let ordersRegexp; + let customer; + let defaultChannel; + let createdVariants; + let productType; + let attribute; + let category; + let warehouse; + let shippingMethod; + let address; + let ordersReadyToFulfillRegexp; + let ordersReadyForCaptureRegexp; + let productsOutOfStockRegexp; + let salesAmountRegexp; + let ordersRegexp; - before(() => { - cy.clearSessionData().loginUserViaRequest(); + before(() => { + cy.clearSessionData().loginUserViaRequest(); - productsUtils - .createProductWithShipping({ - name: randomName, - productPrice, - shippingPrice, - newChannel: true - }) - .then(resp => { - createdVariants = resp.variantsList; - address = resp.address; - warehouse = resp.warehouse; - defaultChannel = resp.defaultChannel; - shippingMethod = resp.shippingMethod; - attribute = resp.attribute; - category = resp.category; - productType = resp.productType; + productsUtils + .createProductWithShipping({ + name: randomName, + productPrice, + shippingPrice, + newChannel: true + }) + .then(resp => { + createdVariants = resp.variantsList; + address = resp.address; + warehouse = resp.warehouse; + defaultChannel = resp.defaultChannel; + shippingMethod = resp.shippingMethod; + attribute = resp.attribute; + category = resp.category; + productType = resp.productType; - createCustomer(randomEmail, randomName, address).then( - customerResp => (customer = customerResp) + createCustomer(randomEmail, randomName, address).then( + customerResp => (customer = customerResp) + ); + + homePageUtils + .getOrdersReadyToFulfill(defaultChannel.slug) + .then(ordersReadyToFulfillBefore => { + ordersReadyToFulfillRegexp = getOrdersReadyToFulfillRegex( + ordersReadyToFulfillBefore, + 1 + ); + }); + + homePageUtils + .getOrdersReadyForCapture(defaultChannel.slug) + .then(ordersReadyForCaptureBefore => { + ordersReadyForCaptureRegexp = getOrdersReadyForCaptureRegex( + ordersReadyForCaptureBefore, + 1 + ); + }); + + homePageUtils + .getProductsOutOfStock(defaultChannel.slug) + .then(productsOutOfStockBefore => { + productsOutOfStockRegexp = getProductsOutOfStockRegex( + productsOutOfStockBefore, + 1 + ); + }); + + homePageUtils.getSalesAmount(defaultChannel.slug).then(salesAmount => { + salesAmountRegexp = getSalesAmountRegex( + salesAmount, + productPrice * 2 + shippingPrice ); - - homePageUtils - .getOrdersReadyToFulfill(defaultChannel.slug) - .then(ordersReadyToFulfillBefore => { - ordersReadyToFulfillRegexp = getOrdersReadyToFulfillRegex( - ordersReadyToFulfillBefore, - 1 - ); - }); - - homePageUtils - .getOrdersReadyForCapture(defaultChannel.slug) - .then(ordersReadyForCaptureBefore => { - ordersReadyForCaptureRegexp = getOrdersReadyForCaptureRegex( - ordersReadyForCaptureBefore, - 1 - ); - }); - - homePageUtils - .getProductsOutOfStock(defaultChannel.slug) - .then(productsOutOfStockBefore => { - productsOutOfStockRegexp = getProductsOutOfStockRegex( - productsOutOfStockBefore, - 1 - ); - }); - - homePageUtils - .getSalesAmount(defaultChannel.slug) - .then(salesAmount => { - salesAmountRegexp = getSalesAmountRegex( - salesAmount, - productPrice * 2 + shippingPrice - ); - }); - - homePageUtils - .getTodaysOrders(defaultChannel.slug) - .then(ordersBefore => { - ordersRegexp = getTodaysOrdersRegex(ordersBefore, 2); - }); - }) - .then(() => { - createReadyToFulfillOrder({ - customerId: customer.id, - shippingMethodId: shippingMethod.id, - channelId: defaultChannel.id, - variantsList: createdVariants, - address - }); - - createWaitingForCaptureOrder({ - channelSlug: defaultChannel.slug, - email: randomEmail, - variantsList: createdVariants, - shippingMethodName: shippingMethod.name, - address - }); - - const productOutOfStockRandomName = - startsWith + faker.datatype.number(); - - productsUtils.createProductInChannel({ - name: productOutOfStockRandomName, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - quantityInWarehouse: 0, - productTypeId: productType.id, - attributeId: attribute.id, - categoryId: category.id, - price: productPrice - }); }); - }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + homePageUtils + .getTodaysOrders(defaultChannel.slug) + .then(ordersBefore => { + ordersRegexp = getTodaysOrdersRegex(ordersBefore, 2); + }); + }) + .then(() => { + createReadyToFulfillOrder({ + customerId: customer.id, + shippingMethodId: shippingMethod.id, + channelId: defaultChannel.id, + variantsList: createdVariants, + address + }); - it("should display correct information on dashboard home page. SALEOR_2004", () => { + createWaitingForCaptureOrder({ + channelSlug: defaultChannel.slug, + email: randomEmail, + variantsList: createdVariants, + shippingMethodName: shippingMethod.name, + address + }); + + const productOutOfStockRandomName = + startsWith + faker.datatype.number(); + + productsUtils.createProductInChannel({ + name: productOutOfStockRandomName, + channelId: defaultChannel.id, + warehouseId: warehouse.id, + quantityInWarehouse: 0, + productTypeId: productType.id, + attributeId: attribute.id, + categoryId: category.id, + price: productPrice + }); + }); + }); + + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); + + it( + "should display correct information on dashboard home page. SALEOR_2004", + { tags: ["@homePage", "@allEnv"] }, + () => { cy.visit(urlList.homePage); changeChannel(defaultChannel.name); cy.contains(HOMEPAGE_SELECTORS.orders, ordersRegexp).should("be.visible"); @@ -167,6 +167,6 @@ filterTests({ definedTags: ["all", "critical", "refactored"] }, () => { HOMEPAGE_SELECTORS.productsOutOfStock, productsOutOfStockRegexp ).should("be.visible"); - }); - }); + } + ); }); diff --git a/cypress/e2e/login.js b/cypress/e2e/login.js index 524ff02a8..75b8fedb2 100644 --- a/cypress/e2e/login.js +++ b/cypress/e2e/login.js @@ -2,23 +2,28 @@ /// import { LOGIN_SELECTORS } from "../elements/account/login-selectors"; -import { HOMEPAGE_SELECTORS } from "../elements/homePage/homePage-selectors"; import { urlList } from "../fixtures/urlList"; import filterTests from "../support/filterTests"; -filterTests({ definedTags: ["all"] }, () => { - describe("User authorization", () => { - beforeEach(() => { - cy.clearSessionData(); - }); +describe("User authorization", () => { + beforeEach(() => { + cy.clearSessionData(); + }); - it("should successfully log in an user", () => { + it( + "should successfully log in an user", + { tags: ["@login", "@allEnv", "@stable"] }, + () => { cy.visit(urlList.homePage); cy.loginUser(); cy.get(LOGIN_SELECTORS.welcomePage).should("be.visible"); - }); + } + ); - it("should fail for wrong password", () => { + it( + "should fail for wrong password", + { tags: ["@login", "@allEnv", "@stable"] }, + () => { cy.visit(urlList.homePage) .get(LOGIN_SELECTORS.emailAddressInput) .type("admin@example.com") @@ -28,9 +33,13 @@ filterTests({ definedTags: ["all"] }, () => { .click() .get(LOGIN_SELECTORS.warningCredentialMessage) .should("be.visible"); - }); + } + ); - it("should successfully log out an user", () => { + it( + "should successfully log out an user", + { tags: ["@login", "@allEnv", "@stable"] }, + () => { cy.clearSessionData() .loginUserViaRequest() .visit(urlList.homePage) @@ -40,6 +49,6 @@ filterTests({ definedTags: ["all"] }, () => { .click() .get(LOGIN_SELECTORS.emailAddressInput) .should("be.visible"); - }); - }); + } + ); }); diff --git a/cypress/e2e/metadata.js b/cypress/e2e/metadata.js index 1c358c087..c8eaf484f 100644 --- a/cypress/e2e/metadata.js +++ b/cypress/e2e/metadata.js @@ -14,39 +14,40 @@ import { createTypeAttributeAndCategoryForProduct, deleteProductsStartsWith } from "../support/api/utils/products/productsUtils"; -import filterTests from "../support/filterTests"; -filterTests({ definedTags: ["all"] }, () => { - describe("Test for metadata", () => { - const startsWith = "Metadata"; - const name = `${startsWith}${faker.datatype.number()}`; - const metadata = { key: "metadataKey", value: "metadataValue" }; - let channel; - let product; +describe("Test for metadata", () => { + const startsWith = "Metadata"; + const name = `${startsWith}${faker.datatype.number()}`; + const metadata = { key: "metadataKey", value: "metadataValue" }; + let channel; + let product; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteProductsStartsWith(startsWith); - getDefaultChannel() - .then(channelResp => { - channel = channelResp; - createTypeAttributeAndCategoryForProduct({ name }); - }) - .then(({ attribute, category, productType }) => { - createProductInChannel({ - attributeId: attribute.id, - categoryId: category.id, - channelId: channel.id, - name, - productTypeId: productType.id - }); - }) - .then(({ product: productResp }) => { - product = productResp; + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteProductsStartsWith(startsWith); + getDefaultChannel() + .then(channelResp => { + channel = channelResp; + createTypeAttributeAndCategoryForProduct({ name }); + }) + .then(({ attribute, category, productType }) => { + createProductInChannel({ + attributeId: attribute.id, + categoryId: category.id, + channelId: channel.id, + name, + productTypeId: productType.id }); - }); + }) + .then(({ product: productResp }) => { + product = productResp; + }); + }); - it("should create metadata for product", () => { + it( + "should create metadata for product", + { tags: ["@metadata", "@allEnv", "@stable"] }, + () => { cy.clearSessionData().loginUserViaRequest(); updateMetadata(product.id, metadata.key, metadata.value); updatePrivateMetadata(product.id, metadata.key, metadata.value) @@ -83,8 +84,12 @@ filterTests({ definedTags: ["all"] }, () => { expect(productResp.metadata[0].key).to.eq(metadata.key); expect(productResp.metadata[0].value).to.eq(metadata.value); }); - }); - it("should create metadata for order", () => { + } + ); + it( + "should create metadata for order", + { tags: ["@metadata", "@allEnv", "@stable"] }, + () => { let order; cy.clearSessionData().loginUserViaRequest(); createDraftOrder({ channelId: channel.id }) @@ -102,6 +107,6 @@ filterTests({ definedTags: ["all"] }, () => { expect(orderResp.privateMetadata[0].key).to.eq(metadata.key); expect(orderResp.privateMetadata[0].value).to.eq(metadata.value); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/navigation.js b/cypress/e2e/navigation.js index 30844a39a..9c5859edd 100644 --- a/cypress/e2e/navigation.js +++ b/cypress/e2e/navigation.js @@ -7,7 +7,6 @@ import { LEFT_MENU_SELECTORS } from "../elements/account/left-menu/left-menu-selectors"; import { PERMISSIONS_OPTIONS } from "../fixtures/permissionsUsers"; -import filterTests from "../support/filterTests"; import * as permissionsSteps from "../support/pages/permissionsPage"; describe("As a staff user I want to navigate through shop using different permissions", () => { @@ -45,50 +44,61 @@ describe("As a staff user I want to navigate through shop using different permis }); Object.keys(permissionsOptions).forEach(key => { - const tags = - key === "all" ? ["critical", "all", "refactored"] : ["all", "refactored"]; - filterTests({ definedTags: tags }, () => { - it(`should be able to navigate through shop as a staff member using ${key} permission. ${permissionsOptions[key].testCase}`, () => { - const permissionOption = permissionsOptions[key]; - const permissions = permissionOption.permissions; - cy.clearSessionData(); - permissionsSteps.navigateToAllAvailablePageAndCheckIfDisplayed( - permissionOption - ); - if (key === "all") { - return; - } - permissionsSteps - .getDisplayedSelectors() - .then(selectors => { - permissionsSteps.expectAllSelectorsPermitted( - permissions, - selectors - ); - }) - .then(() => { - if (!permissions) { - return; - } - permissions.forEach(permission => { - if (permission.parent) { - cy.get(permission.parent.parentMenuSelector) - .click() - .then(() => { - permissionsSteps.getDisplayedSelectors( - permission.parent.parentSelectors - ); - }) - .then(parentSelectors => { - permissionsSteps.expectAllSelectorsPermitted( - permissions, - parentSelectors - ); - }); + if (key !== "all") { + it( + `should be able to navigate through shop as a staff member using ${key} permission. ${permissionsOptions[key].testCase}`, + { tags: ["@allEnv", "@navigation"] }, + () => { + const permissionOption = permissionsOptions[key]; + const permissions = permissionOption.permissions; + cy.clearSessionData(); + permissionsSteps.navigateToAllAvailablePageAndCheckIfDisplayed( + permissionOption + ); + permissionsSteps + .getDisplayedSelectors() + .then(selectors => { + permissionsSteps.expectAllSelectorsPermitted( + permissions, + selectors + ); + }) + .then(() => { + if (!permissions) { + return; } + permissions.forEach(permission => { + if (permission.parent) { + cy.get(permission.parent.parentMenuSelector) + .click() + .then(() => { + permissionsSteps.getDisplayedSelectors( + permission.parent.parentSelectors + ); + }) + .then(parentSelectors => { + permissionsSteps.expectAllSelectorsPermitted( + permissions, + parentSelectors + ); + }); + } + }); }); - }); - }); - }); + } + ); + } }); + + it( + `should be able to navigate through shop as a staff member using all permissions. ${permissionsOptions.all.testCase}`, + { tags: ["@critical", "@allEnv", "@navigation", "@stable"] }, + () => { + const permissionOption = permissionsOptions.all; + cy.clearSessionData(); + permissionsSteps.navigateToAllAvailablePageAndCheckIfDisplayed( + permissionOption + ); + } + ); }); diff --git a/cypress/e2e/orders/channelsInDraftOrders.js b/cypress/e2e/orders/channelsInDraftOrders.js index e464ad1a4..68b8ee688 100644 --- a/cypress/e2e/orders/channelsInDraftOrders.js +++ b/cypress/e2e/orders/channelsInDraftOrders.js @@ -10,39 +10,40 @@ import { ORDERS_SELECTORS } from "../../elements/orders/orders-selectors"; import { urlList } from "../../fixtures/urlList"; import { createChannel } from "../../support/api/requests/Channels"; import * as channelsUtils from "../../support/api/utils/channelsUtils"; -import filterTests from "../../support/filterTests"; import { selectChannelInHeader, selectChannelInPicker } from "../../support/pages/channelsPage"; -filterTests({ definedTags: ["all"] }, () => { - xdescribe("Channels in draft orders", () => { - const startsWith = "CyChannelInDraftOrders-"; - const randomName = startsWith + faker.datatype.number(); +xdescribe("Channels in draft orders", () => { + const startsWith = "CyChannelInDraftOrders-"; + const randomName = startsWith + faker.datatype.number(); - let defaultChannel; - let otherChannel; + let defaultChannel; + let otherChannel; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - channelsUtils.deleteChannelsStartsWith(startsWith); - channelsUtils - .getDefaultChannel() - .then(channel => { - defaultChannel = channel; - createChannel({ name: randomName }); - }) - .then(channelResp => { - otherChannel = channelResp; - }); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + channelsUtils.deleteChannelsStartsWith(startsWith); + channelsUtils + .getDefaultChannel() + .then(channel => { + defaultChannel = channel; + createChannel({ name: randomName }); + }) + .then(channelResp => { + otherChannel = channelResp; + }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("Draft order channel should be taken from global channel picker", () => { + it( + "Draft order channel should be taken from global channel picker", + { tags: ["@orders", "@allEnv"] }, + () => { let channelName; cy.visit(urlList.homePage); cy.getTextFromElement(HEADER_SELECTORS.channelSelect).then( @@ -64,9 +65,13 @@ filterTests({ definedTags: ["all"] }, () => { expect(channelName).to.contains(channelNameInDraftOrder); } ); - }); + } + ); - it("Draft order channel should be taken from global channel picker when changed", () => { + it( + "Draft order channel should be taken from global channel picker when changed", + { tags: ["@orders", "@allEnv"] }, + () => { cy.visit(urlList.homePage); selectChannelInHeader(otherChannel.name); cy.visit(urlList.orders); @@ -82,9 +87,13 @@ filterTests({ definedTags: ["all"] }, () => { expect(channelInDraftOrder).to.be.eq(otherChannel.name); } ); - }); + } + ); - it("should create draft order with chosen channel", () => { + it( + "should create draft order with chosen channel", + { tags: ["@orders", "@allEnv"] }, + () => { cy.visit(urlList.homePage); selectChannelInHeader(defaultChannel.name); cy.visit(urlList.orders); @@ -100,6 +109,6 @@ filterTests({ definedTags: ["all"] }, () => { expect(channelInDraftOrder).to.be.eq(otherChannel.name); } ); - }); - }); + } + ); }); diff --git a/cypress/e2e/orders/draftOrders.js b/cypress/e2e/orders/draftOrders.js index b076c4173..25ffe7990 100644 --- a/cypress/e2e/orders/draftOrders.js +++ b/cypress/e2e/orders/draftOrders.js @@ -17,78 +17,79 @@ import { createShipping, deleteShippingStartsWith } from "../../support/api/utils/shippingUtils"; -import filterTests from "../../support/filterTests"; import { selectChannelInPicker } from "../../support/pages/channelsPage"; import { finalizeDraftOrder } from "../../support/pages/draftOrderPage"; -filterTests({ definedTags: ["all"] }, () => { - xdescribe("Draft orders", () => { - const startsWith = "CyDraftOrders-"; - const randomName = startsWith + faker.datatype.number(); +xdescribe("Draft orders", () => { + const startsWith = "CyDraftOrders-"; + const randomName = startsWith + faker.datatype.number(); - let defaultChannel; - let warehouse; - let address; + let defaultChannel; + let warehouse; + let address; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteCustomersStartsWith(startsWith); - deleteShippingStartsWith(startsWith); - productsUtils.deleteProductsStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteCustomersStartsWith(startsWith); + deleteShippingStartsWith(startsWith); + productsUtils.deleteProductsStartsWith(startsWith); - updateOrdersSettings(); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - }) - .then(() => { - cy.fixture("addresses"); - }) - .then(addresses => { - address = addresses.plAddress; - createCustomer( - `${randomName}@example.com`, - randomName, - addresses.plAddress, - true - ); - createShipping({ - channelId: defaultChannel.id, - name: randomName, - address: addresses.plAddress - }); - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; - productsUtils.createTypeAttributeAndCategoryForProduct({ - name: randomName - }); - }) - .then( - ({ - productType: productTypeResp, - attribute: attributeResp, - category: categoryResp - }) => { - productsUtils.createProductInChannel({ - name: randomName, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - productTypeId: productTypeResp.id, - attributeId: attributeResp.id, - categoryId: categoryResp.id - }); - } + updateOrdersSettings(); + getDefaultChannel() + .then(channel => { + defaultChannel = channel; + }) + .then(() => { + cy.fixture("addresses"); + }) + .then(addresses => { + address = addresses.plAddress; + createCustomer( + `${randomName}@example.com`, + randomName, + addresses.plAddress, + true ); - }); + createShipping({ + channelId: defaultChannel.id, + name: randomName, + address: addresses.plAddress + }); + }) + .then(({ warehouse: warehouseResp }) => { + warehouse = warehouseResp; + productsUtils.createTypeAttributeAndCategoryForProduct({ + name: randomName + }); + }) + .then( + ({ + productType: productTypeResp, + attribute: attributeResp, + category: categoryResp + }) => { + productsUtils.createProductInChannel({ + name: randomName, + channelId: defaultChannel.id, + warehouseId: warehouse.id, + productTypeId: productTypeResp.id, + attributeId: attributeResp.id, + categoryId: categoryResp.id + }); + } + ); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should move draft order to orders", () => { + it( + "should move draft order to orders", + { tags: ["@orders", "@allEnv"] }, + () => { cy.visit(urlList.orders); - cy.softExpectSkeletonIsVisible(); + cy.expectSkeletonIsVisible(); cy.get(ORDERS_SELECTORS.createOrder).click(); selectChannelInPicker(defaultChannel.name); finalizeDraftOrder(randomName, address).then(draftOrderNumber => { @@ -106,6 +107,6 @@ filterTests({ definedTags: ["all"] }, () => { expect($draftOrder).to.not.exist; }); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/orders/manageStockReservation.js b/cypress/e2e/orders/manageStockReservation.js index 082b2e31b..5b7c4c389 100644 --- a/cypress/e2e/orders/manageStockReservation.js +++ b/cypress/e2e/orders/manageStockReservation.js @@ -15,89 +15,90 @@ import { createShipping, deleteShippingStartsWith } from "../../support/api/utils/shippingUtils"; -import filterTests from "../../support/filterTests"; import { enterSiteSettingAndSetStockReservation, userType } from "../../support/pages/siteSettings"; -filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { - xdescribe("As an admin I want to manage stock reservation", () => { - const startsWith = "manageStocks"; - const name = `${startsWith}${faker.datatype.number()}`; - const productQuantity = 10; - const customerType = { - authenticated: "auth", - anonymous: "token" - }; +xdescribe("As an admin I want to manage stock reservation", () => { + const startsWith = "manageStocks"; + const name = `${startsWith}${faker.datatype.number()}`; + const productQuantity = 10; + const customerType = { + authenticated: "auth", + anonymous: "token" + }; - let defaultChannel; - let address; - let warehouse; - let attribute; - let category; - let productType; - let dataForCheckout; + let defaultChannel; + let address; + let warehouse; + let attribute; + let category; + let productType; + let dataForCheckout; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteProductsStartsWith(startsWith); - deleteShippingStartsWith(startsWith); - cy.fixture("addresses") - .then(addresses => { - address = addresses.usAddress; - getDefaultChannel(); - }) - .then(channel => { - defaultChannel = channel; - createShipping({ - channelId: defaultChannel.id, - name, - address - }); - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; - createTypeAttributeAndCategoryForProduct({ name }); - }) - .then( - ({ - attribute: attributeResp, - category: categoryResp, - productType: productTypeResp - }) => { - attribute = attributeResp; - category = categoryResp; - productType = productTypeResp; - } - ); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteProductsStartsWith(startsWith); + deleteShippingStartsWith(startsWith); + cy.fixture("addresses") + .then(addresses => { + address = addresses.usAddress; + getDefaultChannel(); + }) + .then(channel => { + defaultChannel = channel; + createShipping({ + channelId: defaultChannel.id, + name, + address + }); + }) + .then(({ warehouse: warehouseResp }) => { + warehouse = warehouseResp; + createTypeAttributeAndCategoryForProduct({ name }); + }) + .then( + ({ + attribute: attributeResp, + category: categoryResp, + productType: productTypeResp + }) => { + attribute = attributeResp; + category = categoryResp; + productType = productTypeResp; + } + ); + }); + + beforeEach(() => { + const productName = `${startsWith}${faker.datatype.number()}`; + + cy.clearSessionData().loginUserViaRequest(); + + createProductInChannel({ + attributeId: attribute.id, + categoryId: category.id, + channelId: defaultChannel.id, + name: productName, + productTypeId: productType.id, + warehouseId: warehouse.id, + quantityInWarehouse: productQuantity + }).then(({ variantsList }) => { + dataForCheckout = { + email: "example@example.pl", + address, + channelSlug: defaultChannel.slug, + variantsList, + productQuantity + }; }); + }); - beforeEach(() => { - const productName = `${startsWith}${faker.datatype.number()}`; - - cy.clearSessionData().loginUserViaRequest(); - - createProductInChannel({ - attributeId: attribute.id, - categoryId: category.id, - channelId: defaultChannel.id, - name: productName, - productTypeId: productType.id, - warehouseId: warehouse.id, - quantityInWarehouse: productQuantity - }).then(({ variantsList }) => { - dataForCheckout = { - email: "example@example.pl", - address, - channelSlug: defaultChannel.slug, - variantsList, - productQuantity - }; - }); - }); - - it("should be able to set stock reservation for authenticated customer in checkout. TC: SALEOR_0415", () => { + it( + "should be able to set stock reservation for authenticated customer in checkout. TC: SALEOR_0415", + { tags: ["@orders", "@allEnv"] }, + () => { dataForCheckout.auth = customerType.authenticated; updateStockReservation({}) @@ -117,9 +118,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { "error should be on field quantity" ).to.be.eq("quantity"); }); - }); + } + ); - it("should be able to set stock reservation for anonymous customer in checkout. TC: SALEOR_0416", () => { + it( + "should be able to set stock reservation for anonymous customer in checkout. TC: SALEOR_0416", + { tags: ["@orders", "@allEnv"] }, + () => { dataForCheckout.auth = customerType.anonymous; updateStockReservation({}) @@ -139,9 +144,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { "error should be on field quantity" ).to.be.eq("quantity"); }); - }); + } + ); - it("should be able to leave empty stock reservation for authenticated customer in checkout. TC: SALEOR_0417", () => { + it( + "should be able to leave empty stock reservation for authenticated customer in checkout. TC: SALEOR_0417", + { tags: ["@orders", "@allEnv"] }, + () => { dataForCheckout.auth = customerType.authenticated; updateStockReservation({ authenticatedUserStock: 10 }) @@ -157,9 +166,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expect(resp.errors, "there should be no errors in response").to.be .empty; }); - }); + } + ); - it("should be able to leave empty stock reservation for anonymous customer in checkout. TC: SALEOR_0418", () => { + it( + "should be able to leave empty stock reservation for anonymous customer in checkout. TC: SALEOR_0418", + { tags: ["@orders", "@allEnv"] }, + () => { dataForCheckout.auth = customerType.anonymous; updateStockReservation({ anonymousUserStock: 10 }) @@ -175,6 +188,6 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expect(resp.errors, "there should be no errors in response").to.be .empty; }); - }); - }); + } + ); }); diff --git a/cypress/e2e/orders/orders.js b/cypress/e2e/orders/orders.js index 17bc5c8f7..0d2721148 100644 --- a/cypress/e2e/orders/orders.js +++ b/cypress/e2e/orders/orders.js @@ -28,94 +28,87 @@ import { createShipping, deleteShippingStartsWith } from "../../support/api/utils/shippingUtils"; -import filterTests from "../../support/filterTests"; import { selectChannelInPicker } from "../../support/pages/channelsPage"; import { finalizeDraftOrder } from "../../support/pages/draftOrderPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("Orders", () => { - const startsWith = "CyOrders-"; - const randomName = startsWith + faker.datatype.number(); +describe("Orders", () => { + const startsWith = "CyOrders-"; + const randomName = startsWith + faker.datatype.number(); - let customer; - let defaultChannel; - let warehouse; - let shippingMethod; - let variantsList; - let address; + let customer; + let defaultChannel; + let warehouse; + let shippingMethod; + let variantsList; + let address; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteCustomersStartsWith(startsWith); - deleteShippingStartsWith(startsWith); - productsUtils.deleteProductsStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteCustomersStartsWith(startsWith); + deleteShippingStartsWith(startsWith); + productsUtils.deleteProductsStartsWith(startsWith); - updateOrdersSettings(); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - }) - .then(() => { - cy.fixture("addresses"); - }) - .then(addresses => { - address = addresses.plAddress; - createCustomer( - `${randomName}@example.com`, - randomName, - address, - true - ); - }) - .then(customerResp => { - customer = customerResp.user; - createShipping({ - channelId: defaultChannel.id, - name: randomName, - address - }); - }) - .then( - ({ - warehouse: warehouseResp, - shippingMethod: shippingMethodResp - }) => { - shippingMethod = shippingMethodResp; - warehouse = warehouseResp; - productsUtils.createTypeAttributeAndCategoryForProduct({ - name: randomName - }); - } - ) - .then( - ({ - productType: productTypeResp, - attribute: attributeResp, - category: categoryResp - }) => { - productsUtils.createProductInChannel({ - name: randomName, - channelId: defaultChannel.id, - warehouseId: warehouse.id, - productTypeId: productTypeResp.id, - attributeId: attributeResp.id, - categoryId: categoryResp.id - }); - } - ) - .then(({ variantsList: variantsResp }) => { - variantsList = variantsResp; + updateOrdersSettings(); + getDefaultChannel() + .then(channel => { + defaultChannel = channel; + }) + .then(() => { + cy.fixture("addresses"); + }) + .then(addresses => { + address = addresses.plAddress; + createCustomer(`${randomName}@example.com`, randomName, address, true); + }) + .then(customerResp => { + customer = customerResp.user; + createShipping({ + channelId: defaultChannel.id, + name: randomName, + address }); - }); + }) + .then( + ({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => { + shippingMethod = shippingMethodResp; + warehouse = warehouseResp; + productsUtils.createTypeAttributeAndCategoryForProduct({ + name: randomName + }); + } + ) + .then( + ({ + productType: productTypeResp, + attribute: attributeResp, + category: categoryResp + }) => { + productsUtils.createProductInChannel({ + name: randomName, + channelId: defaultChannel.id, + warehouseId: warehouse.id, + productTypeId: productTypeResp.id, + attributeId: attributeResp.id, + categoryId: categoryResp.id + }); + } + ) + .then(({ variantsList: variantsResp }) => { + variantsList = variantsResp; + }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest( - "auth", - ONE_PERMISSION_USERS.order - ); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest( + "auth", + ONE_PERMISSION_USERS.order + ); + }); - xit("should create order with selected channel", () => { + xit( + "should create order with selected channel", + { tags: ["@orders", "@allEnv"] }, + () => { cy.visit(urlList.orders) .get(ORDERS_SELECTORS.createOrder) .click(); @@ -127,9 +120,13 @@ filterTests({ definedTags: ["all"] }, () => { "be.visible" ); }); - }); + } + ); - it("should not be possible to change channel in order", () => { + it( + "should not be possible to change channel in order", + { tags: ["@orders", "@allEnv", "@stable"] }, + () => { createOrder({ customerId: customer.id, channelId: defaultChannel.id, @@ -143,43 +140,47 @@ filterTests({ definedTags: ["all"] }, () => { .find("[button]") .should("not.exist"); }); - }); + } + ); - it("should cancel fulfillment", () => { - let order; - createFulfilledOrder({ - customerId: customer.id, - channelId: defaultChannel.id, - shippingMethodId: shippingMethod.id, - variantsList, - address, - warehouse: warehouse.id + it("should cancel fulfillment", { tags: ["@orders", "@allEnv"] }, () => { + let order; + createFulfilledOrder({ + customerId: customer.id, + channelId: defaultChannel.id, + shippingMethodId: shippingMethod.id, + variantsList, + address, + warehouse: warehouse.id + }) + .then(({ order: orderResp }) => { + order = orderResp; + cy.visit(urlList.orders); + cy.expectSkeletonIsVisible(); + cy.contains(ORDERS_SELECTORS.orderRow, order.number).click(); + cy.get(SHARED_ELEMENTS.skeleton) + .should("not.exist") + .get(ORDERS_SELECTORS.cancelFulfillment) + .click() + .fillAutocompleteSelect( + ORDERS_SELECTORS.cancelFulfillmentSelectField, + warehouse.name + ) + .addAliasToGraphRequest("OrderFulfillmentCancel") + .get(BUTTON_SELECTORS.submit) + .click() + .waitForRequestAndCheckIfNoErrors("@OrderFulfillmentCancel"); + getOrder(order.id); }) - .then(({ order: orderResp }) => { - order = orderResp; - cy.visit(urlList.orders); - cy.softExpectSkeletonIsVisible(); - cy.contains(ORDERS_SELECTORS.orderRow, order.number).click(); - cy.get(SHARED_ELEMENTS.skeleton) - .should("not.exist") - .get(ORDERS_SELECTORS.cancelFulfillment) - .click() - .fillAutocompleteSelect( - ORDERS_SELECTORS.cancelFulfillmentSelectField, - warehouse.name - ) - .addAliasToGraphRequest("OrderFulfillmentCancel") - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@OrderFulfillmentCancel"); - getOrder(order.id); - }) - .then(orderResp => { - expect(orderResp.status).to.be.eq("UNFULFILLED"); - }); - }); + .then(orderResp => { + expect(orderResp.status).to.be.eq("UNFULFILLED"); + }); + }); - it("should make a refund", () => { + it( + "should make a refund", + { tags: ["@orders", "@allEnv", "@stable"] }, + () => { let order; createReadyToFulfillOrder({ customerId: customer.id, @@ -191,7 +192,7 @@ filterTests({ definedTags: ["all"] }, () => { .then(({ order: orderResp }) => { order = orderResp; cy.visit(urlList.orders); - cy.softExpectSkeletonIsVisible(); + cy.expectSkeletonIsVisible(); cy.contains(ORDERS_SELECTORS.orderRow, order.number).click(); cy.get(ORDERS_SELECTORS.refundButton) .click() @@ -208,6 +209,6 @@ filterTests({ definedTags: ["all"] }, () => { .then(orderResp => { expect(orderResp.paymentStatus).to.be.eq("FULLY_REFUNDED"); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/pages/pageTypes.js b/cypress/e2e/pages/pageTypes.js index 4b6275dc9..8e68898d9 100644 --- a/cypress/e2e/pages/pageTypes.js +++ b/cypress/e2e/pages/pageTypes.js @@ -13,17 +13,18 @@ import { createPageType, getPageType } from "../../support/api/requests/PageType"; -import filterTests from "../../support/filterTests"; -filterTests({ definedTags: ["all"] }, () => { - describe("Tests for page types", () => { - const startsWith = "PageTypes"; +describe("Tests for page types", () => { + const startsWith = "PageTypes"; - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should create page type", () => { + it( + "should create page type", + { tags: ["@pages", "@allEnv", "@stable"] }, + () => { const randomName = startsWith + faker.datatype.number(); cy.visit(urlList.pageTypes) @@ -43,26 +44,26 @@ filterTests({ definedTags: ["all"] }, () => { .then(pageType => { expect(pageType.name).to.eq(randomName); }); - }); + } + ); - xit("should assign attribute", () => { - const randomName = startsWith + faker.datatype.number(); + xit("should assign attribute", { tags: ["@pages", "@allEnv"] }, () => { + const randomName = startsWith + faker.datatype.number(); - createAttribute({ name: randomName, type: "PAGE_TYPE" }); - createPageType(randomName) - .then(({ pageType }) => { - cy.visit(pageTypeDetailsUrl(pageType.id)) - .get(SHARED_ELEMENTS.progressBar) - .should("be.not.visible") - .get(PAGE_TYPE_DETAILS.assignAttributesButton) - .click() - .assignElements(randomName, false) - .confirmationMessageShouldDisappear(); - getPageType(pageType.id); - }) - .then(pageType => { - expect(pageType.attributes[0].name).to.eq(randomName); - }); - }); + createAttribute({ name: randomName, type: "PAGE_TYPE" }); + createPageType(randomName) + .then(({ pageType }) => { + cy.visit(pageTypeDetailsUrl(pageType.id)) + .get(SHARED_ELEMENTS.progressBar) + .should("be.not.visible") + .get(PAGE_TYPE_DETAILS.assignAttributesButton) + .click() + .assignElements(randomName, false) + .confirmationMessageShouldDisappear(); + getPageType(pageType.id); + }) + .then(pageType => { + expect(pageType.attributes[0].name).to.eq(randomName); + }); }); }); diff --git a/cypress/e2e/pages/pages.js b/cypress/e2e/pages/pages.js index 8504dac3f..8ca28422a 100644 --- a/cypress/e2e/pages/pages.js +++ b/cypress/e2e/pages/pages.js @@ -5,7 +5,7 @@ import faker from "faker"; import { PAGE_DETAILS } from "../../elements/pages/page-details"; import { BUTTON_SELECTORS } from "../../elements/shared/button-selectors"; -import { pageDetailsUrl, pageTypeDetailsUrl } from "../../fixtures/urlList"; +import { pageDetailsUrl } from "../../fixtures/urlList"; import { createAttribute } from "../../support/api/requests/Attribute"; import { createPage as createPageRequest, @@ -14,42 +14,43 @@ import { import { createPageType } from "../../support/api/requests/PageType"; import { deleteAttributesStartsWith } from "../../support/api/utils/attributes/attributeUtils"; import { deletePageTypesStartsWith } from "../../support/api/utils/pageTypeUtils"; -import filterTests from "../../support/filterTests"; import { attributesTypes, createPage } from "../../support/pages/pagesPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("Tests for pages", () => { - const startsWith = `Pages`; - const name = `${startsWith}${faker.datatype.number()}`; - let attribute; - let pageType; +describe("Tests for pages", () => { + const startsWith = `Pages`; + const name = `${startsWith}${faker.datatype.number()}`; + let attribute; + let pageType; - const attributeValuesOnPage = { - NUMERIC: 1, - RICH_TEXT: faker.lorem.sentence(), - DROPDOWN: "value", - MULTISELECT: "value", - BOOLEAN: true - }; + const attributeValuesOnPage = { + NUMERIC: 1, + RICH_TEXT: faker.lorem.sentence(), + DROPDOWN: "value", + MULTISELECT: "value", + BOOLEAN: true + }; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteAttributesStartsWith(startsWith); - deletePageTypesStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteAttributesStartsWith(startsWith); + deletePageTypesStartsWith(startsWith); - createAttribute({ name, type: "PAGE_TYPE" }) - .then(attributeResp => { - attribute = attributeResp; - createPageType({ name, attributeId: attribute.id }); - }) - .then(({ pageType: pageTypeResp }) => (pageType = pageTypeResp)); - }); + createAttribute({ name, type: "PAGE_TYPE" }) + .then(attributeResp => { + attribute = attributeResp; + createPageType({ name, attributeId: attribute.id }); + }) + .then(({ pageType: pageTypeResp }) => (pageType = pageTypeResp)); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should create not published page", () => { + it( + "should create not published page", + { tags: ["@pages", "@allEnv", "@stable"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; createPage({ pageName: randomName, pageTypeName: name }) @@ -62,9 +63,13 @@ filterTests({ definedTags: ["all"] }, () => { expect(page.attributes[0].attribute.id).to.eq(attribute.id); getPage(page.id, "token").should("be.null"); }); - }); + } + ); - it("should create published page", () => { + it( + "should create published page", + { tags: ["@pages", "@allEnv", "@stable"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; createPage({ @@ -80,10 +85,14 @@ filterTests({ definedTags: ["all"] }, () => { expect(page.isPublished).to.be.true; expect(page.attributes[0].attribute.id).to.eq(attribute.id); }); - }); + } + ); - Object.keys(attributesTypes).forEach(attributeType => { - it(`should create page with ${attributeType} attribute`, () => { + Object.keys(attributesTypes).forEach(attributeType => { + it( + `should create page with ${attributeType} attribute`, + { tags: ["@pages", "@allEnv"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; const attributeValues = [attributeValuesOnPage[attributeType]]; createAttribute({ @@ -116,51 +125,51 @@ filterTests({ definedTags: ["all"] }, () => { ); } }); - }); - }); + } + ); + }); - it("should delete page", () => { - const randomName = `${startsWith}${faker.datatype.number()}`; + it("should delete page", { tags: ["@pages", "@allEnv", "@stable"] }, () => { + const randomName = `${startsWith}${faker.datatype.number()}`; - createPageRequest({ - pageTypeId: pageType.id, - title: randomName - }).then(({ page }) => { - cy.visit(pageDetailsUrl(page.id)) - .get(BUTTON_SELECTORS.deleteButton) - .click() - .addAliasToGraphRequest("PageRemove") - .get(BUTTON_SELECTORS.submit) - .click() - .waitForRequestAndCheckIfNoErrors("@PageRemove"); - getPage(page.id).should("be.null"); - }); - }); - - it("should update page", () => { - const randomName = `${startsWith}${faker.datatype.number()}`; - const updatedName = `${startsWith}${faker.datatype.number()}`; - - createPageRequest({ - pageTypeId: pageType.id, - title: randomName - }) - .then(({ page }) => { - cy.visit(pageDetailsUrl(page.id)) - .get(PAGE_DETAILS.nameInput) - .clearAndType(updatedName) - .get(PAGE_DETAILS.isPublishedCheckbox) - .click() - .addAliasToGraphRequest("PageUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .waitForRequestAndCheckIfNoErrors("@PageUpdate"); - getPage(page.id); - }) - .then(page => { - expect(page.title).to.eq(updatedName); - expect(page.isPublished).to.eq(true); - }); + createPageRequest({ + pageTypeId: pageType.id, + title: randomName + }).then(({ page }) => { + cy.visit(pageDetailsUrl(page.id)) + .get(BUTTON_SELECTORS.deleteButton) + .click() + .addAliasToGraphRequest("PageRemove") + .get(BUTTON_SELECTORS.submit) + .click() + .waitForRequestAndCheckIfNoErrors("@PageRemove"); + getPage(page.id).should("be.null"); }); }); + + it("should update page", { tags: ["@pages", "@allEnv", "@stable"] }, () => { + const randomName = `${startsWith}${faker.datatype.number()}`; + const updatedName = `${startsWith}${faker.datatype.number()}`; + + createPageRequest({ + pageTypeId: pageType.id, + title: randomName + }) + .then(({ page }) => { + cy.visit(pageDetailsUrl(page.id)) + .get(PAGE_DETAILS.nameInput) + .clearAndType(updatedName) + .get(PAGE_DETAILS.isPublishedCheckbox) + .click() + .addAliasToGraphRequest("PageUpdate") + .get(BUTTON_SELECTORS.confirm) + .click() + .waitForRequestAndCheckIfNoErrors("@PageUpdate"); + getPage(page.id); + }) + .then(page => { + expect(page.title).to.eq(updatedName); + expect(page.isPublished).to.eq(true); + }); + }); }); diff --git a/cypress/e2e/preorders/createAndEditVariantsInPreorder.js b/cypress/e2e/preorders/createAndEditVariantsInPreorder.js index 772c6e496..e0cac1078 100644 --- a/cypress/e2e/preorders/createAndEditVariantsInPreorder.js +++ b/cypress/e2e/preorders/createAndEditVariantsInPreorder.js @@ -14,7 +14,6 @@ import { } from "../../support/api/requests/Product"; import { createWaitingForCaptureOrder } from "../../support/api/utils/ordersUtils"; import { createProductWithShipping } from "../../support/api/utils/products/productsUtils"; -import filterTests from "../../support/filterTests"; import { formatDate, formatTime } from "../../support/formatData/formatDate"; import { enablePreorderWithThreshold, @@ -24,40 +23,42 @@ import { setUpPreorderEndDate } from "../../support/pages/catalog/products/VariantsPage"; -filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { - describe("Creating variants in preorder", () => { - const name = `CreatePreOrder${faker.datatype.number()}`; - const attributeValues = ["value1", "value2", "value3"]; - const threshold = 100; - const futureDate = new Date().setDate(new Date().getDate() + 14); - const endDate = formatDate(futureDate); - const endTime = formatTime(futureDate); +describe("Creating variants in preorder", () => { + const name = `CreatePreOrder${faker.datatype.number()}`; + const attributeValues = ["value1", "value2", "value3"]; + const threshold = 100; + const futureDate = new Date().setDate(new Date().getDate() + 14); + const endDate = formatDate(futureDate); + const endTime = formatTime(futureDate); - let defaultChannel; - let product; - let variantsList; - let checkoutData; + let defaultChannel; + let product; + let variantsList; + let checkoutData; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - createProductWithShipping({ name, attributeValues }).then(resp => { - checkoutData = { - address: resp.address, - channelSlug: resp.defaultChannel.slug, - email: "example@example.com", - shippingMethodName: resp.shippingMethod.name - }; - defaultChannel = resp.defaultChannel; - product = resp.product; - variantsList = resp.variantsList; - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + createProductWithShipping({ name, attributeValues }).then(resp => { + checkoutData = { + address: resp.address, + channelSlug: resp.defaultChannel.slug, + email: "example@example.com", + shippingMethodName: resp.shippingMethod.name + }; + defaultChannel = resp.defaultChannel; + product = resp.product; + variantsList = resp.variantsList; }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - xit("should create variant in preorder", () => { + xit( + "should create variant in preorder", + { tags: ["@preorders", "@allEnv"] }, + () => { let variant; cy.visit(productDetailsUrl(product.id)) @@ -99,9 +100,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expect(endDate).to.eq(formatDate(respEndDate)); expect(endTime).to.eq(formatTime(respEndDate)); }); - }); + } + ); - it("should enable preorder on active variant", () => { + it( + "should enable preorder on active variant", + { tags: ["@preorders", "@allEnv"] }, + () => { const variant = variantsList[0]; checkoutData.variantsList = [variant]; @@ -118,9 +123,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expect(preorder.globalThreshold).to.eq(threshold); expect(preorder.globalSoldUnits).to.eq(1); }); - }); + } + ); - it("should set end date on preorder variant", () => { + it( + "should set end date on preorder variant", + { tags: ["@preorders", "@allEnv"] }, + () => { const variant = variantsList[0]; checkoutData.variantsList = [variant]; @@ -133,6 +142,6 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expect(endDate).to.eq(formatDate(respEndDate)); expect(endTime).to.eq(formatTime(respEndDate)); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/preorders/stocksAndThreshold.js b/cypress/e2e/preorders/stocksAndThreshold.js index 5b715ddbb..f61cba85b 100644 --- a/cypress/e2e/preorders/stocksAndThreshold.js +++ b/cypress/e2e/preorders/stocksAndThreshold.js @@ -13,51 +13,52 @@ import { createProductWithShipping, deleteProductsStartsWith } from "../../support/api/utils/products/productsUtils"; -import filterTests from "../../support/filterTests"; import { saveVariant } from "../../support/pages/catalog/products/VariantsPage"; -filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { - describe("Stocks and threshold in preorder variants", () => { - const startsWith = "StocksThreshold"; - const attributeValues = ["value1", "value2"]; - const preorder = { - globalThreshold: 15 - }; +describe("Stocks and threshold in preorder variants", () => { + const startsWith = "StocksThreshold"; + const attributeValues = ["value1", "value2"]; + const preorder = { + globalThreshold: 15 + }; - let defaultChannel; - let product; - let variantsList; - let warehouse; - let checkoutData; + let defaultChannel; + let product; + let variantsList; + let warehouse; + let checkoutData; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteProductsStartsWith(startsWith); - deleteCollectionsStartsWith(startsWith); - createProductWithShipping({ - name: startsWith, - attributeValues, - preorder - }).then(resp => { - checkoutData = { - address: resp.address, - channelSlug: resp.defaultChannel.slug, - email: "example@example.com", - shippingMethodName: resp.shippingMethod.name, - variantsList: resp.variantsList - }; - warehouse = resp.warehouse; - defaultChannel = resp.defaultChannel; - product = resp.product; - variantsList = resp.variantsList; - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteProductsStartsWith(startsWith); + deleteCollectionsStartsWith(startsWith); + createProductWithShipping({ + name: startsWith, + attributeValues, + preorder + }).then(resp => { + checkoutData = { + address: resp.address, + channelSlug: resp.defaultChannel.slug, + email: "example@example.com", + shippingMethodName: resp.shippingMethod.name, + variantsList: resp.variantsList + }; + warehouse = resp.warehouse; + defaultChannel = resp.defaultChannel; + product = resp.product; + variantsList = resp.variantsList; }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - xit("should not be able to order more products then channel threshold", () => { + xit( + "should not be able to order more products then channel threshold", + { tags: ["@preorders", "@allEnv"] }, + () => { cy.visit(variantDetailsUrl(product.id, variantsList[0].id)) .get(VARIANTS_SELECTORS.channelThresholdInput) .type(5) @@ -68,9 +69,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { createCheckout(checkoutData).then(({ errors }) => { expect(errors[0].field).to.eq("quantity"); }); - }); + } + ); - it("should not be able to order more products then threshold even if channel is not exceeded", () => { + it( + "should not be able to order more products then threshold even if channel is not exceeded", + { tags: ["@preorders", "@allEnv"] }, + () => { cy.visit(variantDetailsUrl(product.id, variantsList[0].id)) .get(VARIANTS_SELECTORS.channelThresholdInput) .type(40); @@ -79,9 +84,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { createCheckout(checkoutData).then(({ errors }) => { expect(errors[0].field).to.eq("quantity"); }); - }); + } + ); - it("should allocate variants bought in preorder to correct warehouses", () => { + it( + "should allocate variants bought in preorder to correct warehouses", + { tags: ["@preorders", "@allEnv"] }, + () => { let order; createWaitingForCaptureOrder(checkoutData) .then(({ order: orderResp }) => { @@ -118,6 +127,6 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { .then(({ errors }) => { expect(errors, "no errors when fulfilling order").to.be.empty; }); - }); - }); + } + ); }); diff --git a/cypress/e2e/products/createProduct.js b/cypress/e2e/products/createProduct.js index fc0e4b1b1..aed278b8a 100644 --- a/cypress/e2e/products/createProduct.js +++ b/cypress/e2e/products/createProduct.js @@ -14,7 +14,6 @@ import { expectCorrectProductInformation, expectCorrectProductVariantInformation } from "../../support/api/utils/products/checkProductInfo"; -import filterTests from "../../support/filterTests"; import { metadataForms } from "../../support/pages/catalog/metadataComponent"; import { fillUpPriceList, @@ -23,44 +22,46 @@ import { import { fillUpCommonFieldsForAllProductTypes } from "../../support/pages/catalog/products/productDetailsPage"; import { selectChannelInDetailsPages } from "../../support/pages/channelsPage"; -filterTests({ definedTags: ["all", "critical"] }, () => { - describe("As an admin I should be able to create product", () => { - const startsWith = "CyCreateProduct-"; - const name = `${startsWith}${faker.datatype.number()}`; - const generalInfo = { - name: `${startsWith}${faker.datatype.number()}`, - description: faker.lorem.sentence(), - rating: 2 - }; - const seo = { - title: "testTitle", - description: generalInfo.description - }; - const metadata = { - public: { - metadataForm: metadataForms.public, - name: "metadataName", - value: "metadataValue" - }, - private: { - metadataForm: metadataForms.private, - name: "privateMetadataName", - value: "privateMetadataValue" - } - }; - let attribute; +describe("As an admin I should be able to create product", () => { + const startsWith = "CyCreateProduct-"; + const name = `${startsWith}${faker.datatype.number()}`; + const generalInfo = { + name: `${startsWith}${faker.datatype.number()}`, + description: faker.lorem.sentence(), + rating: 2 + }; + const seo = { + title: "testTitle", + description: generalInfo.description + }; + const metadata = { + public: { + metadataForm: metadataForms.public, + name: "metadataName", + value: "metadataValue" + }, + private: { + metadataForm: metadataForms.private, + name: "privateMetadataName", + value: "privateMetadataValue" + } + }; + let attribute; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - createAttribute({ name }).then(attributeResp => { - attribute = attributeResp; - }); - }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + createAttribute({ name }).then(attributeResp => { + attribute = attributeResp; }); + }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should be able to create product with variants as an admin. SALEOR_2701", () => { + it( + "should be able to create product with variants as an admin. SALEOR_2701", + { tags: ["@products", "@allEnv", "@critical", "@stable"] }, + () => { const randomName = `${startsWith}${faker.datatype.number()}`; seo.slug = randomName; const productData = { @@ -90,9 +91,13 @@ filterTests({ definedTags: ["all", "critical"] }, () => { } expectCorrectProductInformation(productResp, productData); }); - }); + } + ); - it("should be able to create product without variants as an admin. SALEOR_2702", () => { + it( + "should be able to create product without variants as an admin. SALEOR_2702", + { tags: ["@products", "@allEnv", "@critical", "@stable"] }, + () => { const prices = { sellingPrice: 6, costPrice: 3 }; const randomName = `${startsWith}${faker.datatype.number()}`; seo.slug = randomName; @@ -133,24 +138,24 @@ filterTests({ definedTags: ["all", "critical"] }, () => { prices ); }); - }); - - function createTpeAndFillUpProductFields( - randomName, - hasVariants, - productData - ) { - createTypeProduct({ - name: randomName, - attributeId: attribute.id, - hasVariants - }); - cy.clearSessionData() - .loginUserViaRequest("auth", ONE_PERMISSION_USERS.product) - .visit(urlList.products) - .get(PRODUCTS_LIST.createProductBtn) - .click(); - return fillUpCommonFieldsForAllProductTypes(productData); } - }); + ); + + function createTpeAndFillUpProductFields( + randomName, + hasVariants, + productData + ) { + createTypeProduct({ + name: randomName, + attributeId: attribute.id, + hasVariants + }); + cy.clearSessionData() + .loginUserViaRequest("auth", ONE_PERMISSION_USERS.product) + .visit(urlList.products) + .get(PRODUCTS_LIST.createProductBtn) + .click(); + return fillUpCommonFieldsForAllProductTypes(productData); + } }); diff --git a/cypress/e2e/products/images.js b/cypress/e2e/products/images.js index e9822eb16..fbdcd3639 100644 --- a/cypress/e2e/products/images.js +++ b/cypress/e2e/products/images.js @@ -8,15 +8,16 @@ import { demoProductsNames } from "../../fixtures/products"; import { productDetailsUrl, urlList } from "../../fixtures/urlList"; import { getFirstProducts } from "../../support/api/requests/Product"; import { createNewProductWithNewDataAndDefaultChannel } from "../../support/api/utils/products/productsUtils"; -import filterTests from "../../support/filterTests"; -filterTests({ definedTags: ["all"] }, () => { - xdescribe("Tests for images", () => { - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); +xdescribe("Tests for images", () => { + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("Images on product list should be displayed", () => { + it( + "Images on product list should be displayed", + { tags: ["@products", "@allEnv"] }, + () => { cy.addAliasToGraphRequest("ProductList") .visit(urlList.products) .wait("@ProductList") @@ -26,7 +27,7 @@ filterTests({ definedTags: ["all"] }, () => { element.data.hasOwnProperty("products") ).data; const products = data.products.edges; - cy.softExpectSkeletonIsVisible() + cy.expectSkeletonIsVisible() .get(SHARED_ELEMENTS.skeleton) .should("not.exist"); cy.get(PRODUCTS_LIST.productImage) @@ -48,49 +49,49 @@ filterTests({ definedTags: ["all"] }, () => { .should("have.length", expectedProductsSvgAvatars); }); }); - }); + } + ); - it("Should display product image", () => { - getFirstProducts(1, demoProductsNames.carrotJuice) - .then(resp => { - const product = resp[0].node; - cy.visit(productDetailsUrl(product.id)) - .get(PRODUCT_DETAILS.productImage) - .find("img") - .invoke("attr", "src"); - }) - .then(imageUrl => { - cy.request(imageUrl); - }) - .then(imageResp => { - expect(imageResp.status).to.equal(200); - }); - }); + it("Should display product image", { tags: ["@products", "@allEnv"] }, () => { + getFirstProducts(1, demoProductsNames.carrotJuice) + .then(resp => { + const product = resp[0].node; + cy.visit(productDetailsUrl(product.id)) + .get(PRODUCT_DETAILS.productImage) + .find("img") + .invoke("attr", "src"); + }) + .then(imageUrl => { + cy.request(imageUrl); + }) + .then(imageResp => { + expect(imageResp.status).to.equal(200); + }); + }); - it("Should upload saved image", () => { - const name = "CyImages"; + it("Should upload saved image", { tags: ["@products", "@allEnv"] }, () => { + const name = "CyImages"; - cy.clearSessionData().loginUserViaRequest(); - createNewProductWithNewDataAndDefaultChannel({ name }) - .then(({ product }) => { - cy.visit(productDetailsUrl(product.id)) - .waitForProgressBarToNotBeVisible() - .get(PRODUCT_DETAILS.uploadImageButton) - .click() - .get(PRODUCT_DETAILS.uploadSavedImagesButton) - .click() - .get(SHARED_ELEMENTS.fileInput) - .attachFile("images/saleorDemoProductSneakers.png") - .get(PRODUCT_DETAILS.productImage) - .find("img") - .invoke("attr", "src"); - }) - .then(imageUrl => { - cy.request(imageUrl); - }) - .then(imageResp => { - expect(imageResp.status).to.equal(200); - }); - }); + cy.clearSessionData().loginUserViaRequest(); + createNewProductWithNewDataAndDefaultChannel({ name }) + .then(({ product }) => { + cy.visit(productDetailsUrl(product.id)) + .waitForProgressBarToNotBeVisible() + .get(PRODUCT_DETAILS.uploadImageButton) + .click() + .get(PRODUCT_DETAILS.uploadSavedImagesButton) + .click() + .get(SHARED_ELEMENTS.fileInput) + .attachFile("images/saleorDemoProductSneakers.png") + .get(PRODUCT_DETAILS.productImage) + .find("img") + .invoke("attr", "src"); + }) + .then(imageUrl => { + cy.request(imageUrl); + }) + .then(imageResp => { + expect(imageResp.status).to.equal(200); + }); }); }); diff --git a/cypress/e2e/products/menageProducts/availableForPurchaseProducts.js b/cypress/e2e/products/menageProducts/availableForPurchaseProducts.js index 1b71dccb7..e80213b22 100644 --- a/cypress/e2e/products/menageProducts/availableForPurchaseProducts.js +++ b/cypress/e2e/products/menageProducts/availableForPurchaseProducts.js @@ -10,63 +10,64 @@ import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; import * as productsUtils from "../../../support/api/utils/products/productsUtils"; import * as shippingUtils from "../../../support/api/utils/shippingUtils"; import { isProductAvailableForPurchase } from "../../../support/api/utils/storeFront/storeFrontProductUtils"; -import filterTests from "../../../support/filterTests"; import { updateProductIsAvailableForPurchase } from "../../../support/pages/catalog/products/productDetailsPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("Products available in listings", () => { - const startsWith = "CyAvailForPurchase-"; - const name = `${startsWith}${faker.datatype.number()}`; - let productType; - let attribute; - let category; - let defaultChannel; - let warehouse; +describe("Products available in listings", () => { + const startsWith = "CyAvailForPurchase-"; + const name = `${startsWith}${faker.datatype.number()}`; + let productType; + let attribute; + let category; + let defaultChannel; + let warehouse; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - shippingUtils.deleteShippingStartsWith(startsWith); - productsUtils.deleteProductsStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + shippingUtils.deleteShippingStartsWith(startsWith); + productsUtils.deleteProductsStartsWith(startsWith); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }) - .then(addressesFixture => { - shippingUtils.createShipping({ - channelId: defaultChannel.id, - name, - address: addressesFixture.plAddress - }); - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; + getDefaultChannel() + .then(channel => { + defaultChannel = channel; + cy.fixture("addresses"); + }) + .then(addressesFixture => { + shippingUtils.createShipping({ + channelId: defaultChannel.id, + name, + address: addressesFixture.plAddress }); + }) + .then(({ warehouse: warehouseResp }) => { + warehouse = warehouseResp; + }); - productsUtils - .createTypeAttributeAndCategoryForProduct({ name }) - .then( - ({ - attribute: attributeResp, - productType: productTypeResp, - category: categoryResp - }) => { - productType = productTypeResp; - attribute = attributeResp; - category = categoryResp; - } - ); - }); - - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest( - "auth", - ONE_PERMISSION_USERS.product + productsUtils + .createTypeAttributeAndCategoryForProduct({ name }) + .then( + ({ + attribute: attributeResp, + productType: productTypeResp, + category: categoryResp + }) => { + productType = productTypeResp; + attribute = attributeResp; + category = categoryResp; + } ); - }); + }); - it("should update product to available for purchase", () => { + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest( + "auth", + ONE_PERMISSION_USERS.product + ); + }); + + it( + "should update product to available for purchase", + { tags: ["@products", "@allEnv"] }, + () => { const productName = `${startsWith}${faker.datatype.number()}`; let product; @@ -91,9 +92,13 @@ filterTests({ definedTags: ["all"] }, () => { .then(resp => { expect(isProductAvailableForPurchase(resp)).to.be.eq(true); }); - }); + } + ); - it("should update product to not available for purchase", () => { + it( + "should update product to not available for purchase", + { tags: ["@products", "@allEnv"] }, + () => { const productName = `${startsWith}${faker.datatype.number()}`; let product; @@ -117,6 +122,6 @@ filterTests({ definedTags: ["all"] }, () => { .then(resp => { expect(isProductAvailableForPurchase(resp)).to.be.eq(false); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/products/menageProducts/publishedProducts.js b/cypress/e2e/products/menageProducts/publishedProducts.js index 52b8b32a4..7df3e67ae 100644 --- a/cypress/e2e/products/menageProducts/publishedProducts.js +++ b/cypress/e2e/products/menageProducts/publishedProducts.js @@ -9,48 +9,49 @@ import { getProductDetails } from "../../../support/api/requests/storeFront/Prod import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; import * as productsUtils from "../../../support/api/utils/products/productsUtils"; import { isProductVisible } from "../../../support/api/utils/storeFront/storeFrontProductUtils"; -import filterTests from "../../../support/filterTests"; import { updateProductPublish } from "../../../support/pages/catalog/products/productDetailsPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("Published products", () => { - const startsWith = "CyPublishedProducts-"; - const name = `${startsWith}${faker.datatype.number()}`; - let productType; - let attribute; - let category; - let defaultChannel; +describe("Published products", () => { + const startsWith = "CyPublishedProducts-"; + const name = `${startsWith}${faker.datatype.number()}`; + let productType; + let attribute; + let category; + let defaultChannel; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - productsUtils.deleteProductsStartsWith(startsWith); - productsUtils - .createTypeAttributeAndCategoryForProduct({ name }) - .then( - ({ - attribute: attributeResp, - productType: productTypeResp, - category: categoryResp - }) => { - productType = productTypeResp; - attribute = attributeResp; - category = categoryResp; - getDefaultChannel(); - } - ) - .then(channel => { - defaultChannel = channel; - }); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + productsUtils.deleteProductsStartsWith(startsWith); + productsUtils + .createTypeAttributeAndCategoryForProduct({ name }) + .then( + ({ + attribute: attributeResp, + productType: productTypeResp, + category: categoryResp + }) => { + productType = productTypeResp; + attribute = attributeResp; + category = categoryResp; + getDefaultChannel(); + } + ) + .then(channel => { + defaultChannel = channel; + }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest( - "auth", - ONE_PERMISSION_USERS.product - ); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest( + "auth", + ONE_PERMISSION_USERS.product + ); + }); - it("should update product to published", () => { + it( + "should update product to published", + { tags: ["@products", "@allEnv"] }, + () => { const productName = `${startsWith}${faker.datatype.number()}`; productsUtils @@ -73,9 +74,13 @@ filterTests({ definedTags: ["all"] }, () => { const isVisible = isProductVisible(resp, productName); expect(isVisible).to.be.eq(true); }); - }); + } + ); - it("should update product to not published", () => { + it( + "should update product to not published", + { tags: ["@products", "@allEnv"] }, + () => { const productName = `${startsWith}${faker.datatype.number()}`; let product; @@ -105,6 +110,6 @@ filterTests({ definedTags: ["all"] }, () => { const isVisible = isProductVisible(resp, productName); expect(isVisible).to.be.eq(true); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/products/menageProducts/visibleInListingsProducts.js b/cypress/e2e/products/menageProducts/visibleInListingsProducts.js index 4461f6159..14394c17e 100644 --- a/cypress/e2e/products/menageProducts/visibleInListingsProducts.js +++ b/cypress/e2e/products/menageProducts/visibleInListingsProducts.js @@ -8,48 +8,49 @@ import { searchInShop } from "../../../support/api/requests/storeFront/Search"; import { getDefaultChannel } from "../../../support/api/utils/channelsUtils"; import * as productsUtils from "../../../support/api/utils/products/productsUtils"; import { isProductVisibleInSearchResult } from "../../../support/api/utils/storeFront/storeFrontProductUtils"; -import filterTests from "../../../support/filterTests"; import { updateProductVisibleInListings } from "../../../support/pages/catalog/products/productDetailsPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("Products displayed in listings", () => { - const startsWith = "CyVisibleInListings-"; - const name = `${startsWith}${faker.datatype.number()}`; - let productType; - let attribute; - let category; - let defaultChannel; +describe("Products displayed in listings", () => { + const startsWith = "CyVisibleInListings-"; + const name = `${startsWith}${faker.datatype.number()}`; + let productType; + let attribute; + let category; + let defaultChannel; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - productsUtils.deleteProductsStartsWith(startsWith); - productsUtils - .createTypeAttributeAndCategoryForProduct({ name }) - .then( - ({ - attribute: attributeResp, - productType: productTypeResp, - category: categoryResp - }) => { - productType = productTypeResp; - attribute = attributeResp; - category = categoryResp; - getDefaultChannel(); - } - ) - .then(channel => { - defaultChannel = channel; - }); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + productsUtils.deleteProductsStartsWith(startsWith); + productsUtils + .createTypeAttributeAndCategoryForProduct({ name }) + .then( + ({ + attribute: attributeResp, + productType: productTypeResp, + category: categoryResp + }) => { + productType = productTypeResp; + attribute = attributeResp; + category = categoryResp; + getDefaultChannel(); + } + ) + .then(channel => { + defaultChannel = channel; + }); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest( - "auth", - ONE_PERMISSION_USERS.product - ); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest( + "auth", + ONE_PERMISSION_USERS.product + ); + }); - it("should update product to visible in listings", () => { + it( + "should update product to visible in listings", + { tags: ["@products", "@allEnv"] }, + () => { const productName = `${startsWith}${faker.datatype.number()}`; productsUtils @@ -75,9 +76,13 @@ filterTests({ definedTags: ["all"] }, () => { ); expect(isProductVisible).to.be.eq(true); }); - }); + } + ); - it("should update product to not visible in listings", () => { + it( + "should update product to not visible in listings", + { tags: ["@products", "@allEnv"] }, + () => { const productName = `${startsWith}${faker.datatype.number()}`; productsUtils @@ -113,6 +118,6 @@ filterTests({ definedTags: ["all"] }, () => { ); expect(isProductVisible).to.be.eq(true); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/products/productsList/filteringProducts.js b/cypress/e2e/products/productsList/filteringProducts.js index b759f26a2..5b1c4aaa1 100644 --- a/cypress/e2e/products/productsList/filteringProducts.js +++ b/cypress/e2e/products/productsList/filteringProducts.js @@ -17,94 +17,99 @@ import { createShipping, deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils"; -import filterTests from "../../../support/filterTests"; import { selectChannel, selectFilterOption, selectProductsOutOfStock } from "../../../support/pages/catalog/products/productsListPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("Filtering products", () => { - const startsWith = "CyFilterProducts-"; - const name = `${startsWith}${faker.datatype.number()}`; - const stockQuantity = 747; - const price = 342; - let attribute; - let productType; - let category; - let warehouse; - let channel; - let collection; +describe("Filtering products", () => { + const startsWith = "CyFilterProducts-"; + const name = `${startsWith}${faker.datatype.number()}`; + const stockQuantity = 747; + const price = 342; + let attribute; + let productType; + let category; + let warehouse; + let channel; + let collection; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteShippingStartsWith(startsWith); - deleteProductsStartsWith(startsWith); - createTypeAttributeAndCategoryForProduct({ name }).then( - ({ - attribute: attributeResp, - productType: productTypeResp, - category: categoryResp - }) => { - attribute = attributeResp; - productType = productTypeResp; - category = categoryResp; - } - ); - createCollection(name).then( - collectionResp => (collection = collectionResp) - ); - getDefaultChannel() - .then(channelResp => { - channel = channelResp; - cy.fixture("addresses"); - }) - .then(addresses => { - createShipping({ - channelId: channel.id, - name, - address: addresses.plAddress - }); - }) - .then(({ warehouse: warehouseResp }) => { - warehouse = warehouseResp; - createProductInChannel({ - name, - channelId: channel.id, - warehouseId: warehouse.id, - quantityInWarehouse: stockQuantity, - price, - attributeId: attribute.id, - categoryId: category.id, - productTypeId: productType.id - }); - }) - .then(({ product: product }) => { - updateProduct(product.id, { collections: [collection.id] }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteShippingStartsWith(startsWith); + deleteProductsStartsWith(startsWith); + createTypeAttributeAndCategoryForProduct({ name }).then( + ({ + attribute: attributeResp, + productType: productTypeResp, + category: categoryResp + }) => { + attribute = attributeResp; + productType = productTypeResp; + category = categoryResp; + } + ); + createCollection(name).then( + collectionResp => (collection = collectionResp) + ); + getDefaultChannel() + .then(channelResp => { + channel = channelResp; + cy.fixture("addresses"); + }) + .then(addresses => { + createShipping({ + channelId: channel.id, + name, + address: addresses.plAddress }); - }); + }) + .then(({ warehouse: warehouseResp }) => { + warehouse = warehouseResp; + createProductInChannel({ + name, + channelId: channel.id, + warehouseId: warehouse.id, + quantityInWarehouse: stockQuantity, + price, + attributeId: attribute.id, + categoryId: category.id, + productTypeId: productType.id + }); + }) + .then(({ product: product }) => { + updateProduct(product.id, { collections: [collection.id] }); + }); + }); - beforeEach(() => { - cy.clearSessionData() - .loginUserViaRequest() - .visit(urlList.products); - }); + beforeEach(() => { + cy.clearSessionData() + .loginUserViaRequest() + .visit(urlList.products); + }); - // const filterProductsBy = ["category", "collection", "productType"]; - const filterProductsBy = ["category", "productType"]; - filterProductsBy.forEach(filterBy => { - it(`should filter products by ${filterBy}`, () => { - cy.softExpectSkeletonIsVisible().waitForProgressBarToNotExist(); + // const filterProductsBy = ["category", "collection", "productType"]; + const filterProductsBy = ["category", "productType"]; + filterProductsBy.forEach(filterBy => { + it( + `should filter products by ${filterBy}`, + { tags: ["@productsList", "@allEnv"] }, + () => { + cy.expectSkeletonIsVisible().waitForProgressBarToNotExist(); selectFilterOption(filterBy, name); cy.getTextFromElement(PRODUCTS_LIST.productsNames).then(product => { expect(product).to.includes(name); }); - }); - }); + } + ); + }); - it("should filter products out of stock", () => { - cy.softExpectSkeletonIsVisible(); + it( + "should filter products out of stock", + { tags: ["@productsList", "@allEnv"] }, + () => { + cy.expectSkeletonIsVisible(); const productOutOfStock = `${startsWith}${faker.datatype.number()}`; createProductInChannel({ name: productOutOfStock, @@ -126,6 +131,6 @@ filterTests({ definedTags: ["all"] }, () => { .then(product => { expect(product).to.includes(productOutOfStock); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/products/productsList/pagination.js b/cypress/e2e/products/productsList/pagination.js index 3d2b7160d..9312394a3 100644 --- a/cypress/e2e/products/productsList/pagination.js +++ b/cypress/e2e/products/productsList/pagination.js @@ -3,23 +3,23 @@ import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list"; import { BUTTON_SELECTORS } from "../../../elements/shared/button-selectors"; -import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements"; import { urlList } from "../../../fixtures/urlList"; -import filterTests from "../../../support/filterTests"; import { getDisplayedColumnArray, isNumberOfProductsSameAsInSelectResultsOnPage } from "../../../support/pages/catalog/products/productsListPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("Products", () => { - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - cy.visit(urlList.products); - }); +describe("Products", () => { + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + cy.visit(urlList.products); + }); - it("should be able go to the next page on product list. TC: SALEOR_2605", () => { - cy.softExpectSkeletonIsVisible() + it( + "should be able go to the next page on product list. TC: SALEOR_2605", + { tags: ["@productsList", "@allEnv"] }, + () => { + cy.expectSkeletonIsVisible() .get(PRODUCTS_LIST.emptyProductRow) .should("not.exist") .get(PRODUCTS_LIST.previousPagePagination) @@ -48,10 +48,14 @@ filterTests({ definedTags: ["all"] }, () => { JSON.stringify(productsList) === JSON.stringify(firstPageProducts) ).to.be.true; }); - }); + } + ); - it("should see correct amount of products per page. TC: SALEOR_2606", () => { - cy.softExpectSkeletonIsVisible(); + it( + "should see correct amount of products per page. TC: SALEOR_2606", + { tags: ["@productsList", "@allEnv", "@stable"] }, + () => { + cy.expectSkeletonIsVisible(); isNumberOfProductsSameAsInSelectResultsOnPage().then( isTheSame => expect(isTheSame, "check if number of displayed products is correct") @@ -72,6 +76,6 @@ filterTests({ definedTags: ["all"] }, () => { "check if number of displayed products is correct, after changing results number in table footer" ).to.be.true ); - }); - }); + } + ); }); diff --git a/cypress/e2e/products/productsList/sortingProducts.js b/cypress/e2e/products/productsList/sortingProducts.js index dbd0c29a6..1814eaa46 100644 --- a/cypress/e2e/products/productsList/sortingProducts.js +++ b/cypress/e2e/products/productsList/sortingProducts.js @@ -5,17 +5,18 @@ import { PRODUCTS_LIST } from "../../../elements/catalog/products/products-list" import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements"; import { urlList } from "../../../fixtures/urlList"; import { expectProductsSortedBy } from "../../../support/api/utils/products/productsListUtils"; -import filterTests from "../../../support/filterTests"; -filterTests({ definedTags: ["all"] }, () => { - describe("Sorting products", () => { - const sortByList = ["name", "type"]; - sortByList.forEach(sortBy => { - it(`Sorting by ${sortBy}`, () => { +describe("Sorting products", () => { + const sortByList = ["name", "type"]; + sortByList.forEach(sortBy => { + it( + `Sorting by ${sortBy}`, + { tags: ["@productsList", "@allEnv", "@stable"] }, + () => { cy.clearSessionData() .loginUserViaRequest() .visit(urlList.products); - cy.softExpectSkeletonIsVisible(); + cy.expectSkeletonIsVisible(); cy.get(SHARED_ELEMENTS.header).should("be.visible"); if (sortBy !== "name") { cy.get(PRODUCTS_LIST.tableHeaders[sortBy]) @@ -29,7 +30,7 @@ filterTests({ definedTags: ["all"] }, () => { .waitForProgressBarToNotExist() .waitForRequestAndCheckIfNoErrors("@ProductList"); expectProductsSortedBy(sortBy, false); - }); - }); + } + ); }); }); diff --git a/cypress/e2e/products/productsVariants.js b/cypress/e2e/products/productsVariants.js index fd26b51aa..dcf13a35f 100644 --- a/cypress/e2e/products/productsVariants.js +++ b/cypress/e2e/products/productsVariants.js @@ -12,56 +12,54 @@ import { } from "../../support/api/requests/Product"; import * as productUtils from "../../support/api/utils/products/productsUtils"; import { getProductVariants } from "../../support/api/utils/storeFront/storeFrontProductUtils"; -import filterTests from "../../support/filterTests"; import { createFirstVariant, createVariant, variantsShouldBeVisible } from "../../support/pages/catalog/products/VariantsPage"; -import { - enterHomePageChangeChannelAndReturn, - selectChannelInHeader -} from "../../support/pages/channelsPage"; +import { selectChannelInHeader } from "../../support/pages/channelsPage"; -filterTests({ definedTags: ["all", "critical", "refactored"] }, () => { - describe("As an admin I should be able to create variant", () => { - const startsWith = "CyCreateVariants-"; - const attributeValues = ["value1", "value2"]; +describe("As an admin I should be able to create variant", () => { + const startsWith = "CyCreateVariants-"; + const attributeValues = ["value1", "value2"]; - let defaultChannel; - let warehouse; - let attribute; - let productType; - let category; - let newChannel; + let defaultChannel; + let warehouse; + let attribute; + let productType; + let category; + let newChannel; - before(() => { - const name = `${startsWith}${faker.datatype.number()}`; + before(() => { + const name = `${startsWith}${faker.datatype.number()}`; - cy.clearSessionData().loginUserViaRequest(); + cy.clearSessionData().loginUserViaRequest(); - productUtils - .createShippingProductTypeAttributeAndCategory(name, attributeValues) - .then(resp => { - attribute = resp.attribute; - productType = resp.productType; - category = resp.category; - defaultChannel = resp.defaultChannel; - warehouse = resp.warehouse; + productUtils + .createShippingProductTypeAttributeAndCategory(name, attributeValues) + .then(resp => { + attribute = resp.attribute; + productType = resp.productType; + category = resp.category; + defaultChannel = resp.defaultChannel; + warehouse = resp.warehouse; - createChannel({ isActive: true, name, currencyCode: "USD" }); - }) - .then(resp => (newChannel = resp)); - }); + createChannel({ isActive: true, name, currencyCode: "USD" }); + }) + .then(resp => (newChannel = resp)); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest( - "auth", - ONE_PERMISSION_USERS.product - ); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest( + "auth", + ONE_PERMISSION_USERS.product + ); + }); - it("should be able to create variant visible for the customers in all channels. TC: SALEOR_2901", () => { + it( + "should be able to create variant visible for the customers in all channels. TC: SALEOR_2901", + { tags: ["@variants", "@allEnv", "@critical", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; const price = 10; let createdProduct; @@ -108,9 +106,13 @@ filterTests({ definedTags: ["all", "critical", "refactored"] }, () => { expect(variant).to.have.property("name", attributeValues[0]); expect(variant).to.have.property("price", price); }); - }); + } + ); - it("should be able to create several variants visible for the customers. TC: SALEOR_2902", () => { + it( + "should be able to create several variants visible for the customers. TC: SALEOR_2902", + { tags: ["@variants", "@allEnv", "@critical", "@stable"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; const secondVariantSku = `${startsWith}${faker.datatype.number()}`; const variants = [{ price: 7 }, { name: attributeValues[1], price: 16 }]; @@ -149,6 +151,6 @@ filterTests({ definedTags: ["all", "critical", "refactored"] }, () => { expect(secondVariant).to.have.property("name", variants[1].name); expect(secondVariant).to.have.property("price", variants[1].price); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/products/productsWithoutSku/createProductWithoutSku.js b/cypress/e2e/products/productsWithoutSku/createProductWithoutSku.js index 7105a8977..e9f7ab8c3 100644 --- a/cypress/e2e/products/productsWithoutSku/createProductWithoutSku.js +++ b/cypress/e2e/products/productsWithoutSku/createProductWithoutSku.js @@ -22,88 +22,86 @@ import { createWaitingForCaptureOrder } from "../../../support/api/utils/ordersU import * as productUtils from "../../../support/api/utils/products/productsUtils"; import * as shippingUtils from "../../../support/api/utils/shippingUtils"; import { getProductVariants } from "../../../support/api/utils/storeFront/storeFrontProductUtils"; -import filterTests from "../../../support/filterTests"; import { createFirstVariant, createVariant } from "../../../support/pages/catalog/products/VariantsPage"; import { selectChannelInDetailsPages } from "../../../support/pages/channelsPage"; -filterTests({ definedTags: ["all", "critical"], version: "3.1.0" }, () => { - describe("Creating variants", () => { - const startsWith = "CyCreateVariants-"; - const attributeValues = ["value1", "value2"]; +describe("Creating variants", () => { + const startsWith = "CyCreateVariants-"; + const attributeValues = ["value1", "value2"]; - let defaultChannel; - let warehouse; - let attribute; - let productType; - let simpleProductType; - let category; - let shippingMethod; - let address; + let defaultChannel; + let warehouse; + let attribute; + let productType; + let simpleProductType; + let category; + let shippingMethod; + let address; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - shippingUtils.deleteShippingStartsWith(startsWith); - productUtils.deleteProductsStartsWith(startsWith); - deleteChannelsStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + shippingUtils.deleteShippingStartsWith(startsWith); + productUtils.deleteProductsStartsWith(startsWith); + deleteChannelsStartsWith(startsWith); - const name = `${startsWith}${faker.datatype.number()}`; - const simpleProductTypeName = `${startsWith}${faker.datatype.number()}`; - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }) - .then(fixtureAddresses => { - address = fixtureAddresses.usAddress; - shippingUtils.createShipping({ - channelId: defaultChannel.id, - name, - address - }); - }) - .then( - ({ - warehouse: warehouseResp, - shippingMethod: shippingMethodResp - }) => { - warehouse = warehouseResp; - shippingMethod = shippingMethodResp; - } - ); - productUtils - .createTypeAttributeAndCategoryForProduct({ name, attributeValues }) - .then( - ({ - attribute: attributeResp, - productType: productTypeResp, - category: categoryResp - }) => { - attribute = attributeResp; - productType = productTypeResp; - category = categoryResp; - createTypeProduct({ - name: simpleProductTypeName, - attributeId: attribute.id, - hasVariants: false - }); - } - ) - .then(type => { - simpleProductType = type; + const name = `${startsWith}${faker.datatype.number()}`; + const simpleProductTypeName = `${startsWith}${faker.datatype.number()}`; + getDefaultChannel() + .then(channel => { + defaultChannel = channel; + cy.fixture("addresses"); + }) + .then(fixtureAddresses => { + address = fixtureAddresses.usAddress; + shippingUtils.createShipping({ + channelId: defaultChannel.id, + name, + address }); - }); - - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest( - "auth", - ONE_PERMISSION_USERS.product + }) + .then( + ({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => { + warehouse = warehouseResp; + shippingMethod = shippingMethodResp; + } ); - }); + productUtils + .createTypeAttributeAndCategoryForProduct({ name, attributeValues }) + .then( + ({ + attribute: attributeResp, + productType: productTypeResp, + category: categoryResp + }) => { + attribute = attributeResp; + productType = productTypeResp; + category = categoryResp; + createTypeProduct({ + name: simpleProductTypeName, + attributeId: attribute.id, + hasVariants: false + }); + } + ) + .then(type => { + simpleProductType = type; + }); + }); - xit("should create variant without sku by variant creator", () => { + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest( + "auth", + ONE_PERMISSION_USERS.product + ); + }); + + xit( + "should create variant without sku by variant creator", + { tags: ["@products", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; const price = 10; let createdProduct; @@ -142,9 +140,13 @@ filterTests({ definedTags: ["all", "critical"], version: "3.1.0" }, () => { .then(({ order }) => { expect(order.id).to.be.ok; }); - }); + } + ); - xit("should create variant without sku", () => { + xit( + "should create variant without sku", + { tags: ["@products", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; const variants = [{ price: 7 }, { name: attributeValues[1], price: 16 }]; let createdProduct; @@ -187,9 +189,13 @@ filterTests({ definedTags: ["all", "critical"], version: "3.1.0" }, () => { .then(({ order }) => { expect(order.id).to.be.ok; }); - }); + } + ); - it("should create simple product without sku", () => { + it( + "should create simple product without sku", + { tags: ["@products", "@allEnv"] }, + () => { const name = `${startsWith}${faker.datatype.number()}`; cy.visit(urlList.products) .get(PRODUCTS_LIST.createProductBtn) @@ -238,6 +244,6 @@ filterTests({ definedTags: ["all", "critical"], version: "3.1.0" }, () => { address }); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/products/productsWithoutSku/productsWithoutSkuInOrder.js b/cypress/e2e/products/productsWithoutSku/productsWithoutSkuInOrder.js index 0677281c6..f385dcd2d 100644 --- a/cypress/e2e/products/productsWithoutSku/productsWithoutSkuInOrder.js +++ b/cypress/e2e/products/productsWithoutSku/productsWithoutSkuInOrder.js @@ -6,13 +6,14 @@ import faker from "faker"; import { createCustomer } from "../../../support/api/requests/Customer"; import { createReadyToFulfillOrder } from "../../../support/api/utils/ordersUtils"; import { createProductWithShipping } from "../../../support/api/utils/products/productsUtils"; -import filterTests from "../../../support/filterTests"; -filterTests({ definedTags: ["all", "critical", "refactored"] }, () => { - const name = `ProductsWithoutSkuInOrder${faker.datatype.number()}`; +const name = `ProductsWithoutSkuInOrder${faker.datatype.number()}`; - describe("As an admin I should be able to create order with variant without SKU", () => { - it("should create order with variant product without sku. SALEOR_2801", () => { +describe("As an admin I should be able to create order with variant without SKU", () => { + it( + "should create order with variant product without sku. SALEOR_2801", + { tags: ["@products", "@allEnv", "@stable"] }, + () => { let variants; let channel; let shippingMethodId; @@ -47,6 +48,6 @@ filterTests({ definedTags: ["all", "critical", "refactored"] }, () => { .then(({ errors }) => { expect(errors, "check if no errors").to.be.empty; }); - }); - }); + } + ); }); diff --git a/cypress/e2e/products/productsWithoutSku/updatingProductsWithoutSku.js b/cypress/e2e/products/productsWithoutSku/updatingProductsWithoutSku.js index b656b54be..af6e70f87 100644 --- a/cypress/e2e/products/productsWithoutSku/updatingProductsWithoutSku.js +++ b/cypress/e2e/products/productsWithoutSku/updatingProductsWithoutSku.js @@ -30,96 +30,94 @@ import { createShipping, deleteShippingStartsWith } from "../../../support/api/utils/shippingUtils"; -import filterTests from "../../../support/filterTests"; -filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { - describe("Updating products without sku", () => { - const startsWith = "UpdateProductsSku"; +describe("Updating products without sku", () => { + const startsWith = "UpdateProductsSku"; - let defaultChannel; - let address; - let warehouse; - let shippingMethod; - let attribute; - let category; - let productTypeWithVariants; - let productTypeWithoutVariants; - let product; + let defaultChannel; + let address; + let warehouse; + let shippingMethod; + let attribute; + let category; + let productTypeWithVariants; + let productTypeWithoutVariants; + let product; - const name = `${startsWith}${faker.datatype.number()}`; - const productTypeWithoutVariantsName = `${startsWith}${faker.datatype.number()}`; - const email = "example@example.com"; - const attributeValues = ["value1", "value2"]; + const name = `${startsWith}${faker.datatype.number()}`; + const productTypeWithoutVariantsName = `${startsWith}${faker.datatype.number()}`; + const email = "example@example.com"; + const attributeValues = ["value1", "value2"]; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteProductsStartsWith(startsWith); - deleteShippingStartsWith(startsWith); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - cy.fixture("addresses"); - }) - .then(fixtureAddresses => { - address = fixtureAddresses.plAddress; - createShipping({ - channelId: defaultChannel.id, - name, - address - }); - }) - .then( - ({ - warehouse: warehouseResp, - shippingMethod: shippingMethodResp - }) => { - warehouse = warehouseResp; - shippingMethod = shippingMethodResp; - createTypeAttributeAndCategoryForProduct({ name, attributeValues }); - } - ) - .then( - ({ - attribute: attributeResp, - productType: productTypeResp, - category: categoryResp - }) => { - attribute = attributeResp; - productTypeWithVariants = productTypeResp; - category = categoryResp; - productAttributeAssignmentUpdate({ - productTypeId: productTypeWithVariants.id, - attributeId: attribute.id - }); - createTypeProduct({ - name: productTypeWithoutVariantsName, - attributeId: attribute.id, - hasVariants: false - }); - } - ) - .then(productTypeResp => { - productTypeWithoutVariants = productTypeResp; + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteProductsStartsWith(startsWith); + deleteShippingStartsWith(startsWith); + getDefaultChannel() + .then(channel => { + defaultChannel = channel; + cy.fixture("addresses"); + }) + .then(fixtureAddresses => { + address = fixtureAddresses.plAddress; + createShipping({ + channelId: defaultChannel.id, + name, + address + }); + }) + .then( + ({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => { + warehouse = warehouseResp; + shippingMethod = shippingMethodResp; + createTypeAttributeAndCategoryForProduct({ name, attributeValues }); + } + ) + .then( + ({ + attribute: attributeResp, + productType: productTypeResp, + category: categoryResp + }) => { + attribute = attributeResp; + productTypeWithVariants = productTypeResp; + category = categoryResp; productAttributeAssignmentUpdate({ - productTypeId: productTypeWithoutVariants.id, + productTypeId: productTypeWithVariants.id, attributeId: attribute.id }); - createProductInChannelWithoutVariants({ - name, - channelId: defaultChannel.id, + createTypeProduct({ + name: productTypeWithoutVariantsName, attributeId: attribute.id, - productTypeId: productTypeWithVariants.id, - categoryId: category.id + hasVariants: false }); - }) - .then(productResp => (product = productResp)); - }); + } + ) + .then(productTypeResp => { + productTypeWithoutVariants = productTypeResp; + productAttributeAssignmentUpdate({ + productTypeId: productTypeWithoutVariants.id, + attributeId: attribute.id + }); + createProductInChannelWithoutVariants({ + name, + channelId: defaultChannel.id, + attributeId: attribute.id, + productTypeId: productTypeWithVariants.id, + categoryId: category.id + }); + }) + .then(productResp => (product = productResp)); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should add sku to simple product", () => { + it( + "should add sku to simple product", + { tags: ["@products", "@allEnv", "@stable"] }, + () => { const sku = "NewSkuSimpleProd"; const simpleProductName = `${startsWith}${faker.datatype.number()}`; let simpleProduct; @@ -156,9 +154,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { .then(variantResp => { expect(variantResp.sku).to.eq(sku); }); - }); + } + ); - it("should add sku to variant", () => { + it( + "should add sku to variant", + { tags: ["@products", "@allEnv", "@stable"] }, + () => { const sku = "NewSku"; let variant; createVariant({ @@ -187,9 +189,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { .then(variantResp => { expect(variantResp.sku).to.equal(sku); }); - }); + } + ); - it("should remove sku from variant", () => { + it( + "should remove sku from variant", + { tags: ["@products", "@allEnv", "@stable"] }, + () => { let variant; createVariant({ attributeId: attribute.id, @@ -219,9 +225,13 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expect(variantResp.sku).to.be.null; checkIfCheckoutForVariantCanBeCompleted(variantResp); }); - }); + } + ); - it("should remove sku from simple product", () => { + it( + "should remove sku from simple product", + { tags: ["@products", "@allEnv", "@stable"] }, + () => { const simpleProductName = `${startsWith}${faker.datatype.number()}`; let simpleProduct; createProductInChannelWithoutVariants({ @@ -259,18 +269,18 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => { expect(variantResp.sku).to.be.null; checkIfCheckoutForVariantCanBeCompleted(variantResp); }); - }); - - function checkIfCheckoutForVariantCanBeCompleted(variant) { - createWaitingForCaptureOrder({ - address, - channelSlug: defaultChannel.slug, - email, - shippingMethodName: shippingMethod.name, - variantsList: [variant] - }).then(({ order }) => { - expect(order.id).to.be.ok; - }); } - }); + ); + + function checkIfCheckoutForVariantCanBeCompleted(variant) { + createWaitingForCaptureOrder({ + address, + channelSlug: defaultChannel.slug, + email, + shippingMethodName: shippingMethod.name, + variantsList: [variant] + }).then(({ order }) => { + expect(order.id).to.be.ok; + }); + } }); diff --git a/cypress/e2e/products/updatingProducts.js b/cypress/e2e/products/updatingProducts.js index d6306291d..58d81ebd8 100644 --- a/cypress/e2e/products/updatingProducts.js +++ b/cypress/e2e/products/updatingProducts.js @@ -18,120 +18,121 @@ import { createTypeAttributeAndCategoryForProduct, deleteProductsStartsWith } from "../../support/api/utils/products/productsUtils"; -import filterTests from "../../support/filterTests"; import { metadataForms } from "../../support/pages/catalog/metadataComponent"; import { fillUpCommonFieldsForAllProductTypes } from "../../support/pages/catalog/products/productDetailsPage"; -filterTests({ definedTags: ["all"] }, () => { - describe("Update products", () => { - const startsWith = "CyUpdateProducts-"; - const name = `${startsWith}${faker.datatype.number()}`; - const description = faker.lorem.sentences(2); +describe("Update products", () => { + const startsWith = "CyUpdateProducts-"; + const name = `${startsWith}${faker.datatype.number()}`; + const description = faker.lorem.sentences(2); - let defaultChannel; - let collection; - let product; - let attribute; + let defaultChannel; + let collection; + let product; + let attribute; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteProductsStartsWith(startsWith); - deleteCollectionsStartsWith(startsWith); - getDefaultChannel() - .then(channel => { - defaultChannel = channel; - createCollection(name); - }) - .then(collectionResp => { - collection = collectionResp; - createTypeAttributeAndCategoryForProduct({ name }); - }) - .then(({ attribute: attributeResp, category, productType }) => { - attribute = attributeResp; - createProductInChannel({ - attributeId: attribute.id, - categoryId: category.id, - productTypeId: productType.id, - channelId: defaultChannel.id, - name, - collectionId: collection.id, - description - }); - }) - .then(({ product: productResp }) => { - product = productResp; + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteProductsStartsWith(startsWith); + deleteCollectionsStartsWith(startsWith); + getDefaultChannel() + .then(channel => { + defaultChannel = channel; + createCollection(name); + }) + .then(collectionResp => { + collection = collectionResp; + createTypeAttributeAndCategoryForProduct({ name }); + }) + .then(({ attribute: attributeResp, category, productType }) => { + attribute = attributeResp; + createProductInChannel({ + attributeId: attribute.id, + categoryId: category.id, + productTypeId: productType.id, + channelId: defaultChannel.id, + name, + collectionId: collection.id, + description }); - }); + }) + .then(({ product: productResp }) => { + product = productResp; + }); + }); - it("Should update product", () => { - const updatedName = `${startsWith}${faker.random.number()}`; - let updatedCategory; - let updatedCollection; - createCategory({ name: updatedName }) - .then(categoryResp => { - updatedCategory = categoryResp; - createCollection(updatedName); - }) - .then(collectionResp => { - updatedCollection = collectionResp; - const productData = { - generalInfo: { - name: updatedName, - description: faker.lorem.sentence(), - rating: 3 + it("Should update product", { tags: ["@products", "@allEnv"] }, () => { + const updatedName = `${startsWith}${faker.random.number()}`; + let updatedCategory; + let updatedCollection; + createCategory({ name: updatedName }) + .then(categoryResp => { + updatedCategory = categoryResp; + createCollection(updatedName); + }) + .then(collectionResp => { + updatedCollection = collectionResp; + const productData = { + generalInfo: { + name: updatedName, + description: faker.lorem.sentence(), + rating: 3 + }, + seo: { + slug: updatedName, + title: "newTitle", + description: "New description." + }, + metadata: { + private: { + metadataForm: metadataForms.private, + name: "newPrivate", + value: "value1" }, - seo: { - slug: updatedName, - title: "newTitle", - description: "New description." - }, - metadata: { - private: { - metadataForm: metadataForms.private, - name: "newPrivate", - value: "value1" - }, - public: { - metadataForm: metadataForms.public, - name: "newPublic", - value: "value2" - } - }, - productOrganization: { - category: updatedCategory.name, - collection: updatedCollection.name + public: { + metadataForm: metadataForms.public, + name: "newPublic", + value: "value2" } - }; - cy.clearSessionData() - .loginUserViaRequest("auth", ONE_PERMISSION_USERS.product) - .visit(productDetailsUrl(product.id)) - .get(PRODUCT_DETAILS.collectionRemoveButtons) - .click(); - fillUpCommonFieldsForAllProductTypes(productData, false); - cy.addAliasToGraphRequest("UpdatePrivateMetadata") - .addAliasToGraphRequest("UpdateMetadata") - .addAliasToGraphRequest("ProductUpdate") - .get(BUTTON_SELECTORS.confirm) - .click() - .confirmationMessageShouldDisappear() - .waitForRequestAndCheckIfNoErrors("@ProductUpdate") - .waitForRequestAndCheckIfNoErrors("@UpdateMetadata") - .waitForRequestAndCheckIfNoErrors("@UpdatePrivateMetadata"); - productData.productOrganization.productType = name; - productData.attribute = attribute; - cy.loginUserViaRequest("token") - .then(() => { - getProductDetails(product.id, defaultChannel.slug, "auth").its( - "body.data.product" - ); - }) - .then(resp => { - expectCorrectProductInformation(resp, productData); - }); - }); - }); + }, + productOrganization: { + category: updatedCategory.name, + collection: updatedCollection.name + } + }; + cy.clearSessionData() + .loginUserViaRequest("auth", ONE_PERMISSION_USERS.product) + .visit(productDetailsUrl(product.id)) + .get(PRODUCT_DETAILS.collectionRemoveButtons) + .click(); + fillUpCommonFieldsForAllProductTypes(productData, false); + cy.addAliasToGraphRequest("UpdatePrivateMetadata") + .addAliasToGraphRequest("UpdateMetadata") + .addAliasToGraphRequest("ProductUpdate") + .get(BUTTON_SELECTORS.confirm) + .click() + .confirmationMessageShouldDisappear() + .waitForRequestAndCheckIfNoErrors("@ProductUpdate") + .waitForRequestAndCheckIfNoErrors("@UpdateMetadata") + .waitForRequestAndCheckIfNoErrors("@UpdatePrivateMetadata"); + productData.productOrganization.productType = name; + productData.attribute = attribute; + cy.loginUserViaRequest("token") + .then(() => { + getProductDetails(product.id, defaultChannel.slug, "auth").its( + "body.data.product" + ); + }) + .then(resp => { + expectCorrectProductInformation(resp, productData); + }); + }); + }); - it("should delete product", () => { + it( + "should delete product", + { tags: ["@products", "@allEnv", "@stable"] }, + () => { cy.clearSessionData() .loginUserViaRequest("auth", ONE_PERMISSION_USERS.product) .visit(productDetailsUrl(product.id)) @@ -149,6 +150,6 @@ filterTests({ definedTags: ["all"] }, () => { productResp => expect(productResp.product, "Check if product exist").to.be.null ); - }); - }); + } + ); }); diff --git a/cypress/e2e/staffMembers.js b/cypress/e2e/staffMembers.js index e008fb9d6..ed4cfc0a2 100644 --- a/cypress/e2e/staffMembers.js +++ b/cypress/e2e/staffMembers.js @@ -19,7 +19,6 @@ import { getMailActivationLinkForUserAndSubject, inviteStaffMemberWithFirstPermission } from "../support/api/utils/users"; -import filterTests from "../support/filterTests"; import { expectWelcomeMessageIncludes } from "../support/pages/homePage"; import { getDisplayedSelectors } from "../support/pages/permissionsPage"; import { @@ -28,77 +27,81 @@ import { updateUserActiveFlag } from "../support/pages/userPage"; -filterTests({ definedTags: ["stagedOnly"] }, () => { - describe("Staff members", () => { - const startsWith = "StaffMembers"; - const password = Cypress.env("USER_PASSWORD"); - const lastName = faker.name.lastName(); - const email = `${startsWith}${lastName}@example.com`; - let user; +describe("Staff members", () => { + const startsWith = "StaffMembers"; + const password = Cypress.env("USER_PASSWORD"); + const lastName = faker.name.lastName(); + const email = `${startsWith}${lastName}@example.com`; + let user; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteStaffMembersStartsWith(startsWith); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteStaffMembersStartsWith(startsWith); - inviteStaffMemberWithFirstPermission({ email }) - .then(({ user: userResp }) => { - user = userResp; - getMailActivationLinkForUser(email); - }) - .then(urlLink => { - cy.clearSessionData().visit(urlLink); - fillUpSetPassword(password); - cy.clearSessionData(); - }); - }); - - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); - - it("should invite user", () => { - const firstName = faker.name.firstName(); - const emailInvite = `${startsWith}${firstName}@example.com`; - - cy.visit(urlList.staffMembers) - .softExpectSkeletonIsVisible() - .get(STAFF_MEMBERS_LIST.inviteStaffMemberButton) - .click(); - fillUpUserDetails(firstName, lastName, emailInvite); - getMailActivationLinkForUser(emailInvite).then(urlLink => { + inviteStaffMemberWithFirstPermission({ email }) + .then(({ user: userResp }) => { + user = userResp; + getMailActivationLinkForUser(email); + }) + .then(urlLink => { cy.clearSessionData().visit(urlLink); fillUpSetPassword(password); - expectWelcomeMessageIncludes(`${firstName} ${lastName}`); + cy.clearSessionData(); }); - }); + }); - it("should deactivate user", () => { + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); + + it("should invite user", { tags: ["@staffMembers", "@stagedOnly"] }, () => { + const firstName = faker.name.firstName(); + const emailInvite = `${startsWith}${firstName}@example.com`; + + cy.visit(urlList.staffMembers) + .expectSkeletonIsVisible() + .get(STAFF_MEMBERS_LIST.inviteStaffMemberButton) + .click(); + fillUpUserDetails(firstName, lastName, emailInvite); + getMailActivationLinkForUser(emailInvite).then(urlLink => { + cy.clearSessionData().visit(urlLink); + fillUpSetPassword(password); + expectWelcomeMessageIncludes(`${firstName} ${lastName}`); + }); + }); + + it( + "should deactivate user", + { tags: ["@staffMembers", "@stagedOnly"] }, + () => { updateStaffMember({ userId: user.id, isActive: true }); updateUserActiveFlag(user.id); cy.clearSessionData() .loginUserViaRequest("auth", { email, password }) .its("body.data.tokenCreate") .then(tokenCreate => { - chai - .softExpect( - tokenCreate.errors[0].code, - "logging in should return error" - ) - .to.be.eq("INACTIVE"); + expect( + tokenCreate.errors[0].code, + "logging in should return error" + ).to.be.eq("INACTIVE"); expect(tokenCreate.token).to.be.not.ok; }); - }); + } + ); - it("should activate user", () => { - updateStaffMember({ userId: user.id, isActive: false }); - updateUserActiveFlag(user.id); - cy.clearSessionData() - .loginUserViaRequest("auth", { email, password }) - .visit(urlList.homePage); - expectWelcomeMessageIncludes(email); - }); + it("should activate user", { tags: ["@staffMembers", "@stagedOnly"] }, () => { + updateStaffMember({ userId: user.id, isActive: false }); + updateUserActiveFlag(user.id); + cy.clearSessionData() + .loginUserViaRequest("auth", { email, password }) + .visit(urlList.homePage); + expectWelcomeMessageIncludes(email); + }); - it("should remove user permissions", () => { + it( + "should remove user permissions", + { tags: ["@staffMembers", "@stagedOnly"] }, + () => { cy.visit(userDetailsUrl(user.id)) .get(STAFF_MEMBER_DETAILS.removePermissionButton) .click() @@ -117,9 +120,13 @@ filterTests({ definedTags: ["stagedOnly"] }, () => { LEFT_MENU_SELECTORS.home ); }); - }); + } + ); - it("should reset password", () => { + it( + "should reset password", + { tags: ["@staffMembers", "@stagedOnly"] }, + () => { const newPassword = faker.random.alphaNumeric(8); updatePlugin( "mirumee.notifications.admin_email", @@ -149,6 +156,6 @@ filterTests({ definedTags: ["stagedOnly"] }, () => { .should("be.visible") .loginUserViaRequest({ email, password: newPassword }); }); - }); - }); + } + ); }); diff --git a/cypress/e2e/translations.js b/cypress/e2e/translations.js index 28d78cc2f..710660863 100644 --- a/cypress/e2e/translations.js +++ b/cypress/e2e/translations.js @@ -9,30 +9,31 @@ import { updateCategoryTranslation } from "../support/api/requests/Category"; import { deleteCategoriesStartsWith } from "../support/api/utils/catalog/categoryUtils"; -import filterTests from "../support/filterTests"; import { updateTranslationToCategory } from "../support/pages/translationsPage"; -filterTests({ definedTags: ["all"], version: "3.0.0" }, () => { - xdescribe("As an admin I want to manage translations", () => { - const startsWith = "TestTranslations"; - const randomNumber = faker.datatype.number(); - const name = `${startsWith}${randomNumber}`; +xdescribe("As an admin I want to manage translations", () => { + const startsWith = "TestTranslations"; + const randomNumber = faker.datatype.number(); + const name = `${startsWith}${randomNumber}`; - let category; + let category; - before(() => { - cy.clearSessionData().loginUserViaRequest(); - deleteCategoriesStartsWith(startsWith); - createCategory({ name: startsWith }).then( - categoryResp => (category = categoryResp) - ); - }); + before(() => { + cy.clearSessionData().loginUserViaRequest(); + deleteCategoriesStartsWith(startsWith); + createCategory({ name: startsWith }).then( + categoryResp => (category = categoryResp) + ); + }); - beforeEach(() => { - cy.clearSessionData().loginUserViaRequest(); - }); + beforeEach(() => { + cy.clearSessionData().loginUserViaRequest(); + }); - it("should be able to create new translation. TC:SALEOR_1701", () => { + it( + "should be able to create new translation. TC:SALEOR_1701", + { tags: ["@translations", "@stagedOnly"] }, + () => { const translatedName = `TranslatedName${randomNumber}`; const translatedDescription = `TranslatedDescription${randomNumber}`; const translatedSeoTitle = `TranslatedSeoTitle${randomNumber}`; @@ -55,9 +56,13 @@ filterTests({ definedTags: ["all"], version: "3.0.0" }, () => { `TranslatedSeoDescription${randomNumber}` ); }); - }); + } + ); - it("should be able to update translation. TC:SALEOR_1702", () => { + it( + "should be able to update translation. TC:SALEOR_1702", + { tags: ["@translations", "@stagedOnly"] }, + () => { const randomNumber = faker.datatype.number(); const startWithUpdate = `Translations_Update_${randomNumber}`; const seoTitleUpdate = `${startWithUpdate}_seoTitle`; @@ -89,6 +94,6 @@ filterTests({ definedTags: ["all"], version: "3.0.0" }, () => { expect(translation.seoTitle).to.eq(seoTitleUpdate); expect(translation.seoDescription).to.includes(seoDescriptionUpdate); }); - }); - }); + } + ); }); diff --git a/cypress/support/api/utils/attributes/checkAttributeData.js b/cypress/support/api/utils/attributes/checkAttributeData.js index 31b286f7d..b8a04572b 100644 --- a/cypress/support/api/utils/attributes/checkAttributeData.js +++ b/cypress/support/api/utils/attributes/checkAttributeData.js @@ -1,5 +1,3 @@ -const { softExpect } = chai; - export function expectCorrectDataInAttribute( attribute, { @@ -10,10 +8,10 @@ export function expectCorrectDataInAttribute( valueRequired = true } ) { - softExpect(attribute.name).to.eq(attributeName); - softExpect(attribute.slug).to.eq(attributeName); - softExpect(attribute.inputType).to.eq(attributeType); - softExpect(attribute.entityType).to.eq(entityType); - softExpect(attribute.unit).to.eq(unit); - softExpect(attribute.valueRequired).to.eq(valueRequired); + expect(attribute.name).to.eq(attributeName); + expect(attribute.slug).to.eq(attributeName); + expect(attribute.inputType).to.eq(attributeType); + expect(attribute.entityType).to.eq(entityType); + expect(attribute.unit).to.eq(unit); + expect(attribute.valueRequired).to.eq(valueRequired); } diff --git a/cypress/support/api/utils/products/checkProductInfo.js b/cypress/support/api/utils/products/checkProductInfo.js index 2cd06fe4e..63b2f202b 100644 --- a/cypress/support/api/utils/products/checkProductInfo.js +++ b/cypress/support/api/utils/products/checkProductInfo.js @@ -1,4 +1,3 @@ -const { softExpect } = chai; export function expectCorrectProductInformation(productResp, productData) { expectCorrectGeneralInformation(productResp, productData.generalInfo); expectCorrectSeoInfo(productResp, productData.seo); @@ -10,75 +9,67 @@ export function expectCorrectProductInformation(productResp, productData) { expectCorrectProductOrgInfo(productResp, productData.productOrganization); expectCorrectAttribute(productResp.attributes, productData.attribute); } + export function expectCorrectProductVariantInformation( variantsResp, variantName, prices ) { - softExpect( - expect(variantsResp).to.have.length(1), - softExpect(variantsResp[0].sku).to.be.eq(variantName), - softExpect(variantsResp[0].channelListings[0].costPrice.amount).to.be.eq( - prices.costPrice - ), - softExpect(variantsResp[0].channelListings[0].price.amount).to.be.eq( - prices.sellingPrice - ) + expect(variantsResp).to.have.length(1); + expect(variantsResp[0].sku).to.be.eq(variantName); + expect(variantsResp[0].channelListings[0].costPrice.amount).to.be.eq( + prices.costPrice + ); + expect(variantsResp[0].channelListings[0].price.amount).to.be.eq( + prices.sellingPrice ); } + function expectCorrectGeneralInformation(productResp, generalInfo) { - softExpect(productResp.name, "Check product name").to.be.eq(generalInfo.name); - softExpect(productResp.description, "Check product description").includes( + expect(productResp.name, "Check product name").to.be.eq(generalInfo.name); + expect(productResp.description, "Check product description").includes( generalInfo.description ); - softExpect(productResp.rating, "Check product rate").to.be.eq( - generalInfo.rating - ); + expect(productResp.rating, "Check product rate").to.be.eq(generalInfo.rating); } + function expectCorrectSeoInfo(productResp, seo) { - softExpect(productResp.slug, "Check product slug").to.be.eq(seo.slug); - softExpect(productResp.seoTitle, "Check product seo title").to.be.eq( - seo.title + expect(productResp.slug, "Check product slug").to.be.eq(seo.slug); + expect(productResp.seoTitle, "Check product seo title").to.be.eq(seo.title); + expect(productResp.seoDescription, "Check product seo description").to.be.eq( + seo.description ); - softExpect( - productResp.seoDescription, - "Check product seo description" - ).to.be.eq(seo.description); } + function expectCorrectMetadataInfo(metadataResp, expectedMetadata) { - softExpect( - expect(metadataResp, "Check metadata fields length").to.have.length(1), - softExpect(metadataResp[0].key, "Check product metadata key").to.be.eq( - expectedMetadata.name - ), - softExpect(metadataResp[0].value, "Check product metadata value").to.be.eq( - expectedMetadata.value - ) + expect(metadataResp, "Check metadata fields length").to.have.length(1); + expect(metadataResp[0].key, "Check product metadata key").to.be.eq( + expectedMetadata.name + ); + expect(metadataResp[0].value, "Check product metadata value").to.be.eq( + expectedMetadata.value ); } + function expectCorrectProductOrgInfo(productResp, productOrganization) { - softExpect(productResp.productType.name, "Check product type name").to.be.eq( + expect(productResp.productType.name, "Check product type name").to.be.eq( productOrganization.productType ); - softExpect(productResp.category.name, "Check category name").to.be.eq( + expect(productResp.category.name, "Check category name").to.be.eq( productOrganization.category ); - softExpect( - expect( - productResp.collections, - "Check length of assigned collections" - ).to.have.length(1), - softExpect( - productResp.collections[0].name, - "Check collection name" - ).to.be.eq(productOrganization.collection) + expect( + productResp.collections, + "Check length of assigned collections" + ).to.have.length(1); + expect(productResp.collections[0].name, "Check collection name").to.be.eq( + productOrganization.collection ); } + function expectCorrectAttribute(attributes, attribute) { - softExpect( - expect(attributes).to.have.length(1), - softExpect(attributes[0].attribute.name, "Check attribute name").to.be.eq( - attribute.name - ) + expect(attributes).to.have.length(1); + expect(attributes[0].attribute.name, "Check attribute name").to.be.eq( + attribute.name ); } diff --git a/cypress/support/customCommands/softAssertions/index.js b/cypress/support/customCommands/softAssertions/index.js index c353c59b2..ef8001c9b 100644 --- a/cypress/support/customCommands/softAssertions/index.js +++ b/cypress/support/customCommands/softAssertions/index.js @@ -1,148 +1,62 @@ import { SHARED_ELEMENTS } from "../../../elements/shared/sharedElements"; -let isSoftAssertion = false; -let errors = []; - -chai.softExpect = function(...args) { - isSoftAssertion = true; - return chai.expect(...args); -}; -chai.softAssert = function(...args) { - isSoftAssertion = true; - return chai.assert(...args); -}; - -const origAssert = chai.Assertion.prototype.assert; -chai.Assertion.prototype.assert = function(...args) { - if (isSoftAssertion) { - try { - origAssert.call(this, ...args); - } catch (error) { - errors.push(error); - } - isSoftAssertion = false; - } else { - origAssert.call(this, ...args); - } -}; - -// monkey-patch `Cypress.log` so that the last `cy.then()` isn't logged to command log -const origLog = Cypress.log; -Cypress.log = function(data) { - if (data && data.error && /soft assertions/i.test(data.error.message)) { - data.error.message = "\n\n\t" + data.error.message + "\n\n"; - throw data.error; - } - return origLog.call(Cypress, ...arguments); -}; - -// monkey-patch `it` callback so we insert `cy.then()` as a last command -// to each test case where we'll assert if there are any soft assertion errors -function itCallback(func) { - func(); - cy.then(() => { - if (errors.length) { - const _ = Cypress._; - let msg = ""; - - if (Cypress.browser.isHeaded) { - msg = "Failed soft assertions... check log above ↑"; - } else { - _.each(errors, error => { - msg += "\n" + error; - }); - - msg = msg.replace(/^/gm, "\t"); - } - - throw new Error(msg); - } - }); -} - -const origIt = window.it; -window.it = (title, func) => { - origIt(title, func && (() => itCallback(func))); -}; -window.it.only = (title, func) => { - origIt.only(title, func && (() => itCallback(func))); -}; -window.it.skip = (title, func) => { - origIt.skip(title, func); -}; - -beforeEach(() => { - errors = []; -}); -afterEach(() => { - errors = []; - isSoftAssertion = false; -}); - -Cypress.Commands.add("softAssertMatch", (selector, regexp) => { - cy.get(selector) - .invoke("text") - .then(text => - chai.softExpect(assert.match(text, regexp, "regexp matches")) - ); -}); - -Cypress.Commands.add("softAssertVisibility", selector => { +Cypress.Commands.add("assertVisibility", selector => { cy.get(selector).then( - element => - chai.softExpect(element, "element should be visible").to.be.visible + element => expect(element, "element should be visible").to.be.visible ); }); Cypress.Commands.add( "expectCorrectBasicAddress", (responseAddress, expectedAddress) => { - chai - .softExpect(responseAddress.city.toUpperCase()) - .to.eq(expectedAddress.city.toUpperCase()); - chai - .softExpect(responseAddress) - .to.have.property("countryArea", expectedAddress.countryArea); - chai - .softExpect(responseAddress) - .to.have.property("phone", expectedAddress.phone); - chai - .softExpect(responseAddress) - .to.have.property("postalCode", expectedAddress.postalCode); - chai - .softExpect(responseAddress) - .to.have.property("streetAddress1", expectedAddress.streetAddress1); - chai - .softExpect(responseAddress) - .to.have.property("streetAddress2", expectedAddress.streetAddress2); + expect(responseAddress.city.toUpperCase()).to.eq( + expectedAddress.city.toUpperCase() + ); + expect(responseAddress).to.have.property( + "countryArea", + expectedAddress.countryArea + ); + expect(responseAddress).to.have.property("phone", expectedAddress.phone); + expect(responseAddress).to.have.property( + "postalCode", + expectedAddress.postalCode + ); + expect(responseAddress).to.have.property( + "streetAddress1", + expectedAddress.streetAddress1 + ); + expect(responseAddress).to.have.property( + "streetAddress2", + expectedAddress.streetAddress2 + ); } ); Cypress.Commands.add( "expectCorrectFullAddress", (responseAddress, expectedAddress) => { - chai - .softExpect(responseAddress) - .to.have.property("firstName", expectedAddress.firstName); - chai - .softExpect(responseAddress) - .to.have.property("firstName", expectedAddress.lastName); + expect(responseAddress).to.have.property( + "firstName", + expectedAddress.firstName + ); + expect(responseAddress).to.have.property( + "firstName", + expectedAddress.lastName + ); cy.expectCorrectBasicAddress(responseAddress, expectedAddress); } ); -Cypress.Commands.add("softExpectSkeletonIsVisible", () => { +Cypress.Commands.add("expectSkeletonIsVisible", () => { cy.get(SHARED_ELEMENTS.circularProgress).should("not.exist"); cy.get(SHARED_ELEMENTS.progressBar).should("be.visible"); cy.get("body").then($body => { if ($body.find(SHARED_ELEMENTS.skeleton).length) { - cy.softAssertVisibility(SHARED_ELEMENTS.skeleton); + cy.assertVisibility(SHARED_ELEMENTS.skeleton); } else { - chai - .softExpect( - $body.find(SHARED_ELEMENTS.skeleton, "skeleton should exist").length - ) - .to.be.eq(1); + expect( + $body.find(SHARED_ELEMENTS.skeleton, "skeleton should exist").length + ).to.be.eq(1); } }); }); diff --git a/cypress/support/cypress-grep/index.d.ts b/cypress/support/cypress-grep/index.d.ts new file mode 100644 index 000000000..8e78771f2 --- /dev/null +++ b/cypress/support/cypress-grep/index.d.ts @@ -0,0 +1,20 @@ +/// + +declare namespace Cypress { + // specify additional properties in the TestConfig object + // in our case we will add "tags" property + interface TestConfigOverrides { + /** + * List of tags for this test + * @example a single tag + * it('logs in', { tags: '@smoke' }, () => { ... }) + * @example multiple tags + * it('works', { tags: ['@smoke', '@slow'] }, () => { ... }) + */ + tags?: string | string[]; + } + + interface Cypress { + grep?: (grep?: string, tags?: string, burn?: string) => void; + } +} diff --git a/cypress/support/cypress-grep/plugin.js b/cypress/support/cypress-grep/plugin.js new file mode 100644 index 000000000..0f53c7f59 --- /dev/null +++ b/cypress/support/cypress-grep/plugin.js @@ -0,0 +1,137 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +/* eslint-disable no-console */ + +const debug = require("debug")("cypress-grep"); +const globby = require("globby"); +const { getTestNames } = require("find-test-names"); +const fs = require("fs"); +const path = require("path"); +const { version } = 10; +const { resolveConfig, parseGrep, shouldTestRun } = require("./utils"); + +/** + * Prints the cypress-grep environment values if any. + * @param {Cypress.PluginConfigOptions} config + */ +function cypressGrepPlugin(config) { + if (!config || !config.env) { + return config; + } + + const { env } = config; + + debug("cypress-grep plugin version %s", version); + debug("Cypress config env object: %o", env); + + const grep = env.grep ? String(env.grep) : undefined; + if (grep) { + console.log('cypress-grep: tests with "%s" in their names', grep.trim()); + } + + const grepTags = env.grepTags || env["grep-tags"]; + if (grepTags) { + console.log('cypress-grep: filtering using tag(s) "%s"', grepTags); + const parsedGrep = parseGrep(null, grepTags); + debug("parsed grep tags %o", parsedGrep.tags); + } + + const grepBurn = env.grepBurn || env["grep-burn"] || env.burn; + if (grepBurn) { + console.log("cypress-grep: running filtered tests %d times", grepBurn); + } + const grepUntagged = env.grepUntagged || env["grep-untagged"]; + if (grepUntagged) { + console.log("cypress-grep: running untagged tests"); + } + + const omitFiltered = env.grepOmitFiltered || env["grep-omit-filtered"]; + if (omitFiltered) { + console.log("cypress-grep: will omit filtered tests"); + } + + const { resolvedConfig } = resolveConfig(config); + const { specPattern, excludeSpecPattern, integrationFolder } = resolvedConfig; + + const grepFilterSpecs = env.grepFilterSpecs === true; + if (grepFilterSpecs) { + debug(resolvedConfig); + const specFiles = globby.sync(specPattern, { + cwd: integrationFolder, + ignore: excludeSpecPattern, + absolute: true + }); + debug("found %d spec files", specFiles.length); + debug("%o", specFiles); + let greppedSpecs = []; + if (grep) { + console.log( + 'cypress-grep: filtering specs using "%s" in the title', + grep + ); + const parsedGrep = parseGrep(grep); + debug("parsed grep %o", parsedGrep); + greppedSpecs = specFiles.filter(specFile => { + const text = fs.readFileSync(specFile, { encoding: "utf8" }); + try { + const names = getTestNames(text); + const testAndSuiteNames = names.suiteNames.concat(names.testNames); + debug("spec file %s", specFile); + debug("suite and test names: %o", testAndSuiteNames); + + return testAndSuiteNames.some(name => { + const shouldRun = shouldTestRun(parsedGrep, name); + return shouldRun; + }); + } catch (err) { + debug(err.message); + debug(err.stack); + console.error("Could not determine test names in file: %s", specFile); + console.error("Will run it to let the grep filter the tests"); + return true; + } + }); + debug('found grep "%s" in %d specs', grep, greppedSpecs.length); + debug("%o", greppedSpecs); + } else if (grepTags) { + const parsedGrep = parseGrep(null, grepTags); + debug("parsed grep tags %o", parsedGrep); + greppedSpecs = specFiles.filter(specFile => { + const text = fs.readFileSync(specFile, { encoding: "utf8" }); + try { + const testInfo = getTestNames(text); + debug("spec file %s", specFile); + debug("test info: %o", testInfo.tests); + + return testInfo.tests.some(info => { + const shouldRun = shouldTestRun(parsedGrep, null, info.tags); + return shouldRun; + }); + } catch (err) { + console.error("Could not determine test names in file: %s", specFile); + console.error("Will run it to let the grep filter the tests"); + return true; + } + }); + debug('found grep tags "%s" in %d specs', grepTags, greppedSpecs.length); + debug("%o", greppedSpecs); + } + if (greppedSpecs.length) { + config.specPattern = greppedSpecs; + console.log(config.specPattern); + } else { + // hmm, we filtered out all specs, probably something is wrong + console.warn("grep and/or grepTags has eliminated all specs"); + if (grep) { + console.warn("grep: %s", grep); + } + if (grepTags) { + console.warn("grepTags: %s", grepTags); + } + console.warn("Will leave all specs to run to filter at run-time"); + } + } + + return config; +} + +module.exports = cypressGrepPlugin; diff --git a/cypress/support/cypress-grep/support.js b/cypress/support/cypress-grep/support.js new file mode 100644 index 000000000..4c8a9e20f --- /dev/null +++ b/cypress/support/cypress-grep/support.js @@ -0,0 +1,217 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ + +const { parseGrep, shouldTestRun } = require("./utils"); +const version = 10; +const debug = require("debug")("cypress-grep"); +debug.log = console.info.bind(console); + +// preserve the real "it" function +const _it = it; +const _describe = describe; + +/** + * Wraps the "it" and "describe" functions that support tags. + * @see https://github.com/cypress-io/cypress-grep + */ +function cypressGrep() { + /** @type {string} Part of the test title go grep */ + let grep = Cypress.env("grep"); + if (grep) { + grep = String(grep).trim(); + } + + /** @type {string} Raw tags to grep string */ + const grepTags = Cypress.env("grepTags") || Cypress.env("grep-tags"); + + const burnSpecified = + Cypress.env("grepBurn") || Cypress.env("grep-burn") || Cypress.env("burn"); + + const grepUntagged = + Cypress.env("grepUntagged") || Cypress.env("grep-untagged"); + + if (!grep && !grepTags && !burnSpecified && !grepUntagged) { + // nothing to do, the user has no specified the "grep" string + debug("Nothing to grep, version %s", version); + return; + } + + /** @type {number} Number of times to repeat each running test */ + const grepBurn = + Cypress.env("grepBurn") || + Cypress.env("grep-burn") || + Cypress.env("burn") || + 1; + + /** @type {boolean} Omit filtered tests completely */ + const omitFiltered = + Cypress.env("grepOmitFiltered") || Cypress.env("grep-omit-filtered"); + + debug("grep %o", { grep, grepTags, grepBurn, omitFiltered, version }); + if (!Cypress._.isInteger(grepBurn) || grepBurn < 1) { + throw new Error(`Invalid grep burn value: ${grepBurn}`); + } + + const parsedGrep = parseGrep(grep, grepTags); + debug("parsed grep %o", parsedGrep); + + // prevent multiple registrations + // https://github.com/cypress-io/cypress-grep/issues/59 + if (it.name === "itGrep") { + debug("already registered cypress-grep"); + return; + } + + it = function itGrep(name, options, callback) { + if (typeof options === "function") { + // the test has format it('...', cb) + callback = options; + options = {}; + } + + if (!callback) { + // the pending test by itself + return _it(name, options); + } + + let configTags = options && options.tags; + if (typeof configTags === "string") { + configTags = [configTags]; + } + + const nameToGrep = suiteStack + .map(item => item.name) + .concat(name) + .join(" "); + const tagsToGrep = suiteStack + .flatMap(item => item.tags) + .concat(configTags) + .filter(Boolean); + + const shouldRun = shouldTestRun( + parsedGrep, + nameToGrep, + tagsToGrep, + grepUntagged + ); + + if (tagsToGrep && tagsToGrep.length) { + debug( + 'should test "%s" with tags %s run? %s', + name, + tagsToGrep.join(","), + shouldRun + ); + } else { + debug('should test "%s" run? %s', nameToGrep, shouldRun); + } + + if (shouldRun) { + if (grepBurn > 1) { + // repeat the same test to make sure it is solid + return Cypress._.times(grepBurn, k => { + const fullName = `${name}: burning ${k + 1} of ${grepBurn}`; + _it(fullName, options, callback); + }); + } + return _it(name, options, callback); + } + + if (omitFiltered) { + // omit the filtered tests completely + return; + } else { + // skip tests without grep string in their names + return _it.skip(name, options, callback); + } + }; + + // list of "describe" suites for the current test + // when we encounter a new suite, we push it to the stack + // when the "describe" function exits, we pop it + // Thus a test can look up the tags from its parent suites + const suiteStack = []; + + describe = function describeGrep(name, options, callback) { + if (typeof options === "function") { + // the block has format describe('...', cb) + callback = options; + options = {}; + } + + const stackItem = { name }; + suiteStack.push(stackItem); + + if (!callback) { + // the pending suite by itself + const result = _describe(name, options); + suiteStack.pop(); + return result; + } + + let configTags = options && options.tags; + if (typeof configTags === "string") { + configTags = [configTags]; + } + + if (!configTags || !configTags.length) { + // if the describe suite does not have explicit tags + // move on, since the tests inside can have their own tags + _describe(name, options, callback); + suiteStack.pop(); + return; + } + + // when looking at the suite of the tests, I found + // that using the name is quickly becoming very confusing + // and thus we need to use the explicit tags + stackItem.tags = configTags; + _describe(name, options, callback); + suiteStack.pop(); + + return; + }; + + // overwrite "context" which is an alias to "describe" + context = describe; + + // overwrite "specify" which is an alias to "it" + specify = it; + + // keep the ".skip", ".only" methods the same as before + it.skip = _it.skip; + it.only = _it.only; + // preserve "it.each" method if found + // https://github.com/cypress-io/cypress-grep/issues/72 + if (typeof _it.each === "function") { + it.each = _it.each; + } + + describe.skip = _describe.skip; + describe.only = _describe.only; + if (typeof _describe.each === "function") { + describe.each = _describe.each; + } +} + +function restartTests() { + setTimeout(() => { + window.top.document.querySelector(".reporter .restart").click(); + }, 0); +} + +if (!Cypress.grep) { + Cypress.grep = function grep(grep, tags, burn) { + Cypress.env("grep", grep); + Cypress.env("grepTags", tags); + Cypress.env("grepBurn", burn); + // remove any aliased values + Cypress.env("grep-tags", null); + Cypress.env("grep-burn", null); + Cypress.env("burn", null); + + debug('set new grep to "%o" restarting tests', { grep, tags, burn }); + restartTests(); + }; +} + +module.exports = cypressGrep; diff --git a/cypress/support/cypress-grep/utils.js b/cypress/support/cypress-grep/utils.js new file mode 100644 index 000000000..8d908a79a --- /dev/null +++ b/cypress/support/cypress-grep/utils.js @@ -0,0 +1,195 @@ +// @ts-check + +// Universal code - should run in Node or in the browser + +/** + * Parses test title grep string. + * The string can have "-" in front of it to invert the match. + * @param {string} s Input substring of the test title + */ +function parseTitleGrep(s) { + if (!s || typeof s !== "string") { + return null; + } + + s = s.trim(); + if (s.startsWith("-")) { + return { + title: s.substring(1), + invert: true + }; + } + return { + title: s, + invert: false + }; +} + +function parseFullTitleGrep(s) { + if (!s || typeof s !== "string") { + return []; + } + + // separate each title + return s.split(";").map(parseTitleGrep); +} + +/** + * Parses tags to grep for. + * @param {string} s Tags string like "@tag1+@tag2" + */ +function parseTagsGrep(s) { + if (!s) { + return []; + } + + const explicitNotTags = []; + + // top level split - using space or comma, each part is OR + const ORS = s + .split(/[ ,]/) + // remove any empty tags + .filter(Boolean) + .map(part => { + // now every part is an AND + if (part.startsWith("--")) { + explicitNotTags.push({ + tag: part.slice(2), + invert: true + }); + return; + } + const parsed = part.split("+").map(tag => { + if (tag.startsWith("-")) { + return { + tag: tag.slice(1), + invert: true + }; + } else { + return { + tag, + invert: false + }; + } + }); + + return parsed; + }); + + // filter out undefined from explicit not tags + const ORS_filtered = ORS.filter(x => x !== undefined); + if (explicitNotTags.length > 0) { + ORS_filtered.forEach((OR, index) => { + ORS_filtered[index] = OR.concat(explicitNotTags); + }); + } + return ORS_filtered; +} + +function shouldTestRunTags(parsedGrepTags, tags = []) { + if (!parsedGrepTags.length) { + // there are no parsed tags to search for, the test should run + return true; + } + + // now the test has tags and the parsed tags are present + + // top levels are OR + const onePartMatched = parsedGrepTags.some(orPart => { + const everyAndPartMatched = orPart.every(p => { + if (p.invert) { + return !tags.includes(p.tag); + } + + return tags.includes(p.tag); + }); + // console.log('every part matched %o?', orPart, everyAndPartMatched) + + return everyAndPartMatched; + }); + + // console.log('onePartMatched', onePartMatched) + return onePartMatched; +} + +function shouldTestRunTitle(parsedGrep, testName) { + if (!testName) { + // if there is no title, let it run + return true; + } + if (!parsedGrep) { + return true; + } + + if (!Array.isArray(parsedGrep)) { + console.error("Invalid parsed title grep"); + console.error(parsedGrep); + throw new Error("Expected title grep to be an array"); + } + + if (!parsedGrep.length) { + return true; + } + + const inverted = parsedGrep.filter(g => g.invert); + const straight = parsedGrep.filter(g => !g.invert); + + return ( + inverted.every(titleGrep => !testName.includes(titleGrep.title)) && + (!straight.length || + straight.some(titleGrep => testName.includes(titleGrep.title))) + ); +} + +// note: tags take precedence over the test name +function shouldTestRun(parsedGrep, testName, tags = [], grepUntagged = false) { + if (grepUntagged) { + return !tags.length; + } + + if (Array.isArray(testName)) { + // the caller passed tags only, no test name + tags = testName; + testName = undefined; + } + + return ( + shouldTestRunTitle(parsedGrep.title, testName) && + shouldTestRunTags(parsedGrep.tags, tags) + ); +} + +function parseGrep(titlePart, tags) { + return { + title: parseFullTitleGrep(titlePart), + tags: parseTagsGrep(tags) + }; +} + +function resolveConfig(config) { + const specPattern = config.specPattern || ""; + let excludeSpecPattern = config.excludeSpecPattern || ""; + if (typeof excludeSpecPattern === "string") { + excludeSpecPattern = [excludeSpecPattern]; + } + const integrationFolder = config.env.grepIntegrationFolder || process.cwd(); + + return { + resolvedConfig: { + specPattern, + excludeSpecPattern, + integrationFolder + } + }; +} + +module.exports = { + parseGrep, + parseTitleGrep, + parseFullTitleGrep, + parseTagsGrep, + resolveConfig, + shouldTestRun, + shouldTestRunTags, + shouldTestRunTitle +}; diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index 5b075f8ba..83b72ed89 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -16,10 +16,14 @@ import "cypress-file-upload"; import "cypress-mochawesome-reporter/register"; import { commandTimings } from "cypress-timings"; + +import cypressGrep from "../support/cypress-grep/support"; commandTimings(); import { urlList } from "../fixtures/urlList"; +cypressGrep(); + Cypress.Commands.add("clearSessionData", () => { cy.clearCookies(); cy.clearLocalStorage(); diff --git a/cypress/support/index.d.ts b/cypress/support/index.d.ts index 6ae7a0f5d..6efd967eb 100644 --- a/cypress/support/index.d.ts +++ b/cypress/support/index.d.ts @@ -13,7 +13,6 @@ declare namespace Cypress { startsWith: string, name? = string ): Chainable; - softExpectSkeletonIsVisible(): Chainable; expectCorrectFullAddress( responseAddress: string, expectedAddress: string @@ -22,8 +21,6 @@ declare namespace Cypress { responseAddress: string, expectedAddress: string ): Chainable; - softAssertVisibility(selector: string): Chainable; - softAssertMatch(selector: string, regexp: string): Chainable; getTextFromElement(element: {}): Chainable; clearAndType(subject: {}, text: string): Chainable; loginUser(): Chainable; diff --git a/cypress/support/pages/catalog/products/productsListPage.js b/cypress/support/pages/catalog/products/productsListPage.js index 38a9f6ee2..1922650a9 100644 --- a/cypress/support/pages/catalog/products/productsListPage.js +++ b/cypress/support/pages/catalog/products/productsListPage.js @@ -111,6 +111,6 @@ function submitFilters() { export function enterProductListPage() { cy.visit(urlList.products) - .softExpectSkeletonIsVisible() + .expectSkeletonIsVisible() .waitForProgressBarToNotExist(); } diff --git a/cypress/support/pages/discounts/salesPage.js b/cypress/support/pages/discounts/salesPage.js index 037e0bd64..6f08361ca 100644 --- a/cypress/support/pages/discounts/salesPage.js +++ b/cypress/support/pages/discounts/salesPage.js @@ -100,7 +100,7 @@ export function createSaleWithNewProduct({ */ cy.visit(urlList.sales); - cy.softExpectSkeletonIsVisible(); + cy.expectSkeletonIsVisible(); const product = productResp; createSale({ saleName: name, @@ -138,7 +138,7 @@ export function createSaleWithNewVariant({ .loginUserViaRequest("auth", ONE_PERMISSION_USERS.discount) */ cy.visit(urlList.sales); - cy.softExpectSkeletonIsVisible(); + cy.expectSkeletonIsVisible(); const variant = variantsListResp[0]; createSale({ saleName: name, diff --git a/cypress/support/pages/discounts/vouchersPage.js b/cypress/support/pages/discounts/vouchersPage.js index 9222287b4..033328309 100644 --- a/cypress/support/pages/discounts/vouchersPage.js +++ b/cypress/support/pages/discounts/vouchersPage.js @@ -100,7 +100,7 @@ export function loginAndCreateCheckoutForVoucherWithDiscount({ cy.clearSessionData() .loginUserViaRequest("auth", ONE_PERMISSION_USERS.discount) .visit(urlList.vouchers); - cy.softExpectSkeletonIsVisible(); + cy.expectSkeletonIsVisible(); createVoucher({ voucherCode, voucherValue, diff --git a/package-lock.json b/package-lock.json index 556545393..955fac5ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7927,7 +7927,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", - "dev": true, "requires": { "string-width": "^3.0.0" }, @@ -7935,20 +7934,17 @@ "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", - "dev": true + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", - "dev": true + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", - "dev": true, "requires": { "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", @@ -8317,8 +8313,7 @@ "array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", - "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", - "dev": true + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==" }, "array-uniq": { "version": "1.0.3", @@ -10721,8 +10716,7 @@ "ci-info": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==" }, "cipher-base": { "version": "1.0.4", @@ -10782,8 +10776,7 @@ "cli-boxes": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", - "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", - "dev": true + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==" }, "cli-cursor": { "version": "2.1.0", @@ -11006,7 +10999,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", - "dev": true, "requires": { "mimic-response": "^1.0.0" } @@ -11246,7 +11238,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", "integrity": "sha512-aMKprgk5YhBNyH25hj8wGt2+D52Sw1DRRIzqBwLp2Ya9mFmY8KPvvtvmna8SxVR9JMZ4kzMD68N22vlaRpkeFA==", - "dev": true, "requires": { "dot-prop": "^5.2.0", "graceful-fs": "^4.1.2", @@ -11260,7 +11251,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", - "dev": true, "requires": { "semver": "^6.0.0" } @@ -11268,14 +11258,12 @@ "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, "write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", - "dev": true, "requires": { "imurmurhash": "^0.1.4", "is-typedarray": "^1.0.0", @@ -11738,8 +11726,7 @@ "crypto-random-string": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-2.0.0.tgz", - "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==", - "dev": true + "integrity": "sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA==" }, "css-jss": { "version": "10.6.0", @@ -12677,8 +12664,7 @@ "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" }, "deep-is": { "version": "0.1.4", @@ -13025,7 +13011,6 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", - "dev": true, "requires": { "path-type": "^4.0.0" } @@ -13220,7 +13205,6 @@ "version": "5.3.0", "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", - "dev": true, "requires": { "is-obj": "^2.0.0" }, @@ -13228,8 +13212,7 @@ "is-obj": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", - "dev": true + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==" } } }, @@ -13286,8 +13269,7 @@ "duplexer3": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", - "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", - "dev": true + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=" }, "duplexify": { "version": "3.7.1", @@ -13413,7 +13395,6 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, "requires": { "once": "^1.4.0" } @@ -13941,8 +13922,7 @@ "escape-goat": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/escape-goat/-/escape-goat-2.1.1.tgz", - "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==", - "dev": true + "integrity": "sha512-8/uIhbG12Csjy2JEW7D9pHbreaVaS/OpN3ycnyvElTdwM5n6GY6W6e2IPemfvGZeUMqZ9A/3GqIZMgKnBhAw/Q==" }, "escape-html": { "version": "1.0.3", @@ -15741,6 +15721,87 @@ "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", "dev": true }, + "find-test-names": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/find-test-names/-/find-test-names-1.17.1.tgz", + "integrity": "sha512-vfEqh/WHoe23kCsmTPwv2V6KDsjbt5zkOhOfNi69ZDw65l/vdST1MU81x7mHnbeMgBoQOPouFpnyazzgXTRBng==", + "requires": { + "@babel/parser": "^7.16.5", + "acorn-walk": "^8.2.0", + "debug": "^4.3.3", + "globby": "^11.0.4", + "simple-bin-help": "^1.7.6" + }, + "dependencies": { + "@babel/parser": { + "version": "7.18.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.5.tgz", + "integrity": "sha512-YZWVaglMiplo7v8f1oMQ5ZPQr0vn7HPeZXxXWsxXJRjGVrzUFn9OxFQl1sb5wzfootjA/yChhW84BV+383FSOw==" + }, + "acorn-walk": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", + "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==" + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "requires": { + "ms": "2.1.2" + } + }, + "fast-glob": { + "version": "3.2.11", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.11.tgz", + "integrity": "sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew==", + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + } + }, + "globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "requires": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + } + }, + "ignore": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==" + }, + "merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==" + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + } + }, + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==" + } + } + }, "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", @@ -16910,8 +16971,7 @@ "has-yarn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", - "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", - "dev": true + "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==" }, "hash-base": { "version": "3.1.0", @@ -17308,8 +17368,7 @@ "http-cache-semantics": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", - "dev": true + "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==" }, "http-deceiver": { "version": "1.2.7", @@ -17766,8 +17825,7 @@ "import-lazy": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", - "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", - "dev": true + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=" }, "import-local": { "version": "2.0.0", @@ -17782,8 +17840,7 @@ "imurmurhash": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", - "dev": true + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, "indefinite-observable": { "version": "2.0.1", @@ -17828,8 +17885,7 @@ "ini": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" }, "inquirer": { "version": "7.3.3", @@ -18110,7 +18166,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", - "dev": true, "requires": { "ci-info": "^2.0.0" } @@ -18307,8 +18362,7 @@ "is-npm": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-5.0.0.tgz", - "integrity": "sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==", - "dev": true + "integrity": "sha512-WW/rQLOazUq+ST/bCAVBp/2oMERWLsR7OrKyt052dNDk4DHcDE0/7QSXITlmi+VBcV13DfIbysG3tZJm5RfdBA==" }, "is-number": { "version": "7.0.0", @@ -18365,8 +18419,7 @@ "is-path-inside": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==" }, "is-plain-obj": { "version": "1.1.0", @@ -18499,8 +18552,7 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "dev": true + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" }, "is-unc-path": { "version": "1.0.0", @@ -18573,8 +18625,7 @@ "is-yarn-global": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", - "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", - "dev": true + "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==" }, "isarray": { "version": "0.0.1", @@ -20763,7 +20814,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", - "dev": true, "requires": { "package-json": "^6.3.0" } @@ -21999,8 +22049,7 @@ "mimic-response": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "dev": true + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" }, "min-document": { "version": "2.19.0", @@ -22091,8 +22140,7 @@ "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", - "dev": true + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" }, "minipass": { "version": "3.1.3", @@ -22786,8 +22834,7 @@ "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "multicast-dns": { "version": "6.2.3", @@ -23625,7 +23672,6 @@ "version": "6.5.0", "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", - "dev": true, "requires": { "got": "^9.6.0", "registry-auth-token": "^4.0.0", @@ -23636,14 +23682,12 @@ "@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", - "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", - "dev": true + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==" }, "@szmarczak/http-timer": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", - "dev": true, "requires": { "defer-to-connect": "^1.0.1" } @@ -23652,7 +23696,6 @@ "version": "6.1.0", "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", - "dev": true, "requires": { "clone-response": "^1.0.2", "get-stream": "^5.1.0", @@ -23667,7 +23710,6 @@ "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dev": true, "requires": { "pump": "^3.0.0" } @@ -23675,8 +23717,7 @@ "lowercase-keys": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", - "dev": true + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==" } } }, @@ -23684,7 +23725,6 @@ "version": "3.3.0", "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", - "dev": true, "requires": { "mimic-response": "^1.0.0" } @@ -23692,14 +23732,12 @@ "defer-to-connect": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", - "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==", - "dev": true + "integrity": "sha512-0ISdNousHvZT2EiFlZeZAHBUvSxmKswVCEf8hW7KWgG4a8MVEu/3Vb6uWYozkjylyCxe0JBIiRB1jV45S70WVQ==" }, "get-stream": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "dev": true, "requires": { "pump": "^3.0.0" } @@ -23708,7 +23746,6 @@ "version": "9.6.0", "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", - "dev": true, "requires": { "@sindresorhus/is": "^0.14.0", "@szmarczak/http-timer": "^1.1.2", @@ -23726,14 +23763,12 @@ "json-buffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", - "dev": true + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=" }, "keyv": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", - "dev": true, "requires": { "json-buffer": "3.0.0" } @@ -23741,26 +23776,22 @@ "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", - "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", - "dev": true + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" }, "normalize-url": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", - "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", - "dev": true + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==" }, "p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", - "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", - "dev": true + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==" }, "responselike": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", - "dev": true, "requires": { "lowercase-keys": "^1.0.0" } @@ -23768,8 +23799,7 @@ "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" } } }, @@ -24098,8 +24128,7 @@ "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", - "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", - "dev": true + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==" }, "pause-stream": { "version": "0.0.11", @@ -24750,7 +24779,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "dev": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -24789,7 +24817,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/pupa/-/pupa-2.1.1.tgz", "integrity": "sha512-l1jNAspIBSFqbT+y+5FosojNpVpF94nlI+wDUpqP9enwOTfHx9f0gh5nB96vl+6yTpsJsypeNrwfzPrKuHB41A==", - "dev": true, "requires": { "escape-goat": "^2.0.0" } @@ -24949,7 +24976,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, "requires": { "deep-extend": "^0.6.0", "ini": "~1.3.0", @@ -24960,8 +24986,7 @@ "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" } } }, @@ -26404,7 +26429,6 @@ "version": "4.2.1", "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.2.1.tgz", "integrity": "sha512-6gkSb4U6aWJB4SF2ZvLb76yCBjcvufXBqvvEx1HbmKPkutswjW1xNVRY0+daljIYRbogN7O0etYSlbiaEQyMyw==", - "dev": true, "requires": { "rc": "^1.2.8" } @@ -26413,7 +26437,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", - "dev": true, "requires": { "rc": "^1.2.8" } @@ -27805,7 +27828,6 @@ "version": "7.3.5", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", - "dev": true, "requires": { "lru-cache": "^6.0.0" }, @@ -27814,7 +27836,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", - "dev": true, "requires": { "yallist": "^4.0.0" } @@ -27822,8 +27843,7 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "dev": true + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" } } }, @@ -27836,7 +27856,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-3.1.1.tgz", "integrity": "sha512-GX0Ix/CJcHyB8c4ykpHGIAvLyOwOobtM/8d+TQkAd81/bEjgPHrfba41Vpesr7jX/t8Uh+R3EX9eAS5be+jQYg==", - "dev": true, "requires": { "semver": "^6.3.0" }, @@ -27844,8 +27863,7 @@ "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" } } }, @@ -28218,8 +28236,7 @@ "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, "signedsource": { "version": "1.0.0", @@ -28227,6 +28244,26 @@ "integrity": "sha1-HdrOSYF5j5O9gzlzgD2A1S6TrWo=", "dev": true }, + "simple-bin-help": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/simple-bin-help/-/simple-bin-help-1.7.7.tgz", + "integrity": "sha512-e36uqSXbTL0yNUc7RgjMFAEMDgV5jbPd18LrCeswZJ7aUtEq0qPf4rroQyW3Tfl1E7rcsW1amZoV3OCGOne1Tg==", + "requires": { + "debug": "3.2.7", + "update-notifier": "5.1.0", + "word-wrap": "1.2.3" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "requires": { + "ms": "^2.1.1" + } + } + } + }, "simplebar": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/simplebar/-/simplebar-4.2.3.tgz", @@ -28279,8 +28316,7 @@ "slash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", - "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", - "dev": true + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==" }, "slice-ansi": { "version": "0.0.4", @@ -30031,8 +30067,7 @@ "to-readable-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", - "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", - "dev": true + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==" }, "to-regex": { "version": "3.0.2", @@ -30409,7 +30444,6 @@ "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dev": true, "requires": { "is-typedarray": "^1.0.0" } @@ -30572,7 +30606,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-2.0.0.tgz", "integrity": "sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg==", - "dev": true, "requires": { "crypto-random-string": "^2.0.0" } @@ -30723,7 +30756,6 @@ "version": "5.1.0", "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-5.1.0.tgz", "integrity": "sha512-ItnICHbeMh9GqUy31hFPrD1kcuZ3rpxDZbf4KUDavXwS0bW5m7SLbDQpGX3UYr072cbrF5hFUs3r5tUsPwjfHw==", - "dev": true, "requires": { "boxen": "^5.0.0", "chalk": "^4.1.0", @@ -30745,7 +30777,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.0.1.tgz", "integrity": "sha512-49VBlw+PrWEF51aCmy7QIteYPIFZxSpvqBdP/2itCPPlJ49kj9zg/XPRFrdkne2W+CfwXUls8exMvu1RysZpKA==", - "dev": true, "requires": { "ansi-align": "^3.0.0", "camelcase": "^6.2.0", @@ -30760,14 +30791,12 @@ "camelcase": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", - "dev": true + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==" }, "chalk": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", - "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -30777,7 +30806,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.0.tgz", "integrity": "sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA==", - "dev": true, "requires": { "ini": "2.0.0" } @@ -30785,20 +30813,17 @@ "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "ini": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", - "dev": true + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==" }, "is-installed-globally": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", - "dev": true, "requires": { "global-dirs": "^3.0.0", "is-path-inside": "^3.0.2" @@ -30808,7 +30833,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "requires": { "has-flag": "^4.0.0" } @@ -30816,8 +30840,7 @@ "type-fest": { "version": "0.20.2", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==" } } }, @@ -30937,7 +30960,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", - "dev": true, "requires": { "prepend-http": "^2.0.0" }, @@ -30945,8 +30967,7 @@ "prepend-http": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", - "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", - "dev": true + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=" } } }, @@ -32152,7 +32173,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", - "dev": true, "requires": { "string-width": "^4.0.0" } @@ -32238,8 +32258,7 @@ "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==" }, "workbox-background-sync": { "version": "6.1.5", @@ -32526,7 +32545,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dev": true, "requires": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -32536,14 +32554,12 @@ "ansi-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" }, "ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "requires": { "color-convert": "^2.0.1" } @@ -32552,7 +32568,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "requires": { "color-name": "~1.1.4" } @@ -32560,26 +32575,22 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, "string-width": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -32590,7 +32601,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, "requires": { "ansi-regex": "^5.0.0" } @@ -32630,8 +32640,7 @@ "xdg-basedir": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-4.0.0.tgz", - "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==", - "dev": true + "integrity": "sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q==" }, "xml": { "version": "1.0.1", diff --git a/package.json b/package.json index e8118358e..fa49281f2 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "editorjs-inline-tool": "^0.4.0", "faker": "^5.1.0", "fast-array-diff": "^0.2.0", + "find-test-names": "^1.17.1", "fuzzaldrin": "^2.1.0", "graphql": "^15.4.0", "hotkeys-js": "^3.8.1", @@ -266,19 +267,13 @@ "start": "npm run build-types && webpack-dev-server -d", "storybook": "start-storybook -p 3000 -c src/storybook/", "cy:run": "cypress run", - "cy:run:report": "cypress run --env tags=all --reporter cypress-mochawesome-reporter --reporter-options reportDir='cypress/reports',overwrite=true,charts=true", - "cy:combine:reports": "npx mochawesome-merge 'cypress/results/*.json' > mochawesome.json", - "cy:run:merge": "npx marge mochawesome.json", "cy:run:dashboard": "cypress run --record", "cy:open": "cypress open", - "cy:run:refactored:locally": "cypress run --env tags=refactored --spec cypress/e2e/navigation.js,cypress/e2e/products/createProduct.js,cypress/e2e/products/productsVariants.js --reporter cypress-mochawesome-reporter --reporter-options reportDir='cypress/reports',overwrite=true,charts=true", - "cy:run:critical": "cypress run --record --env tags=critical --spec cypress/e2e/navigation.js,cypress/e2e/products/createProduct.js,cypress/e2e/products/productsVariants.js --tag Critical, PR Deploy", - "cy:run:allEnv": "cypress run --record --env tags=all", - "cy:run:critical:parallel": "cypress run --record --env tags=critical --spec cypress/e2e/navigation.js,cypress/e2e/products/createProduct.js,cypress/e2e/products/productsVariants.js --parallel --tag Critical", - "cy:run:allEnv:parallel": "cypress run --record --env tags=all --parallel", - "test:e2e:run": "start-server-and-test start http://localhost:9000 cy:run", - "test:e2e:run:record": "start-server-and-test start http://localhost:9000 cy:run:record", - "test:e2e:dev": "start-server-and-test start http://localhost:9000 cy:open", + "cy:run:critical": "cypress run --record --env grepTags=@critical", + "cy:run:allEnv": "cypress run --record --env grepTags=@allEnv", + "cy:run:critical:parallel": "cypress run --record --env grepTags=@critical --parallel --tag Critical", + "cy:run:allEnv:parallel": "cypress run --record --env grepTags=@allEnv --parallel", + "cy:run:stable:parallel": "cypress run --record --env grepTags=@critical --parallel --tag Stable", "test": "TZ=UTC jest src/", "lint": "npx eslint \"src/**/*.@(tsx|ts|jsx|js)\" --fix ; npx prettier --check \"src/**/*.@(tsx|ts|jsx|js)\" --write", "postbuild": "rimraf ./build/**/*.js.map", diff --git a/tsconfig.json b/tsconfig.json index 013912c4c..4b11a1952 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,5 +17,5 @@ }, "resolveJsonModule": true }, - "exclude": ["node_modules"] + "exclude": ["node_modules", "cypress"] } \ No newline at end of file