Change way of tagging tests, add stable tag (#2102)

* change tags in tests

* change tags in tests

* add finde-names

* correct critical tag

* fix navigation

* remove comments

* fix config

* fix baseUrl port
This commit is contained in:
Karolina Rakoczy 2022-06-27 11:30:51 +02:00 committed by GitHub
parent 69eeb4c280
commit fd7813692a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
91 changed files with 5134 additions and 4187 deletions

View file

@ -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

View file

@ -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}}

View file

@ -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:
@ -132,32 +133,15 @@ jobs:
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 }}
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

View file

@ -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}"

View file

@ -11,9 +11,7 @@ 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()}`;
@ -29,13 +27,13 @@ filterTests({ definedTags: ["all"] }, () => {
});
beforeEach(() => {
cy.clearSessionData().loginUserViaRequest(
"auth",
ONE_PERMISSION_USERS.app
);
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);
});
});
});
}
);
});

View file

@ -19,13 +19,11 @@ 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()}`;
@ -75,7 +73,10 @@ filterTests({ definedTags: ["all"] }, () => {
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;
});
});
});
}
);
});

View file

@ -82,12 +82,15 @@ filterTests({ definedTags: ["all"] }, () => {
cy.clearSessionData().loginUserViaRequest();
});
xit("should create hidden collection. TC: SALEOR_0301", () => {
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.expectSkeletonIsVisible();
createCollection(collectionName, false, defaultChannel)
.then(collectionResp => {
@ -104,14 +107,18 @@ filterTests({ definedTags: ["all"] }, () => {
const isVisible = isCollectionVisible(resp, collection.id);
expect(isVisible).to.equal(false);
});
});
}
);
it("should create published collection. TC: SALEOR_0302", () => {
it(
"should create published collection. TC: SALEOR_0302",
{ tags: ["@collection", "@allEnv", "@stable"] },
() => {
const collectionName = `${startsWith}${faker.datatype.number()}`;
let collection;
cy.visit(urlList.collections);
cy.softExpectSkeletonIsVisible();
cy.expectSkeletonIsVisible();
createCollection(collectionName, true, defaultChannel)
.then(collectionResp => {
@ -126,9 +133,13 @@ filterTests({ definedTags: ["all"] }, () => {
const isVisible = isCollectionVisible(resp, collection.id);
expect(isVisible).to.equal(true);
});
});
}
);
it("create collection not available for channel. TC: SALEOR_0303", () => {
it(
"create collection not available for channel. TC: SALEOR_0303",
{ tags: ["@collection", "@allEnv", "@stable"] },
() => {
const collectionName = `${startsWith}${faker.datatype.number()}`;
let collection;
let channel;
@ -140,7 +151,7 @@ filterTests({ definedTags: ["all"] }, () => {
})
.then(() => {
cy.visit(urlList.collections);
cy.softExpectSkeletonIsVisible();
cy.expectSkeletonIsVisible();
createCollection(collectionName, true, channel);
})
.then(collectionResp => {
@ -155,9 +166,13 @@ filterTests({ definedTags: ["all"] }, () => {
const isVisible = isCollectionVisible(resp, collection.id);
expect(isVisible).to.equal(false);
});
});
}
);
it("create published collection with products hidden in listings. TC: SALEOR_0304", () => {
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()}`;
@ -175,7 +190,7 @@ filterTests({ definedTags: ["all"] }, () => {
})
.then(({ product: productResp }) => (createdProduct = productResp));
cy.visit(urlList.collections);
cy.softExpectSkeletonIsVisible();
cy.expectSkeletonIsVisible();
createCollection(collectionName, true, defaultChannel)
.then(collectionResp => {
collection = collectionResp;
@ -204,9 +219,13 @@ filterTests({ definedTags: ["all"] }, () => {
);
expect(isVisible).to.equal(false);
});
});
}
);
it("should delete collection. TC: SALEOR_0305", () => {
it(
"should delete collection. TC: SALEOR_0305",
{ tags: ["@collection", "@allEnv", "@stable"] },
() => {
const collectionName = `${startsWith}${faker.datatype.number()}`;
createCollectionRequest(collectionName).then(collectionResp => {
@ -221,9 +240,13 @@ filterTests({ definedTags: ["all"] }, () => {
.its("collection")
.should("be.null");
});
});
}
);
it("delete several collections on collections list page. TC: SALEOR_0309", () => {
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()}`;
@ -258,9 +281,13 @@ filterTests({ definedTags: ["all"] }, () => {
.its("collection")
.should("be.null");
});
});
}
);
xit("should assign product to collection. TC: SALEOR_0307", () => {
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()}`;
@ -293,9 +320,13 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
});
});
}
);
it("remove product from collection. TC: SALEOR_0308", () => {
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;
@ -338,9 +369,13 @@ filterTests({ definedTags: ["all"] }, () => {
.should("be.empty");
});
});
});
}
);
it("should update collection. TC: SALEOR_0306", () => {
it(
"should update collection. TC: SALEOR_0306",
{ tags: ["@collection", "@allEnv"] },
() => {
const collectionName = `${startsWith}${faker.datatype.number()}`;
const updatedName = `${startsWith}updatedCollection`;
@ -358,6 +393,7 @@ filterTests({ definedTags: ["all"] }, () => {
const descriptionText = descriptionJson.blocks[0].data.text;
expect(descriptionText).to.eq(updatedName);
});
});
}
);
});
});

View file

@ -20,13 +20,11 @@ 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;
@ -72,7 +70,10 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
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);
});
});
});
}
);
});

View file

@ -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,7 +15,6 @@ 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;
@ -31,7 +29,10 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
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);
});
});
});
}
);
});

View file

@ -9,9 +9,7 @@ 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;
@ -67,8 +65,7 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
price: shippingPrice
});
})
.then(
({ shippingMethod: shippingMethodResp, warehouse: warehouse }) => {
.then(({ shippingMethod: shippingMethodResp, warehouse: warehouse }) => {
shippingMethod = shippingMethodResp;
productsUtils.createProductInChannel({
name,
@ -79,8 +76,7 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
categoryId: category.id,
price: productPrice
});
}
)
})
.then(({ variantsList: variantsResp }) => {
variants = variantsResp;
});
@ -90,7 +86,10 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
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;
});
});
});
}
);
});

View file

@ -11,10 +11,8 @@ 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";
@ -27,7 +25,10 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
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);
});
});
});
}
);
});

View file

@ -22,7 +22,6 @@ import {
createShipping,
deleteShippingStartsWith
} from "../../support/api/utils/shippingUtils";
import filterTests from "../../support/filterTests";
import {
createWarehouse,
pickupOptions,
@ -30,7 +29,6 @@ import {
visitSetPublicStockAndEnablePickup
} from "../../support/pages/warehousePage";
filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
describe("Warehouses in checkout", () => {
const startsWith = `CyWarehouseCheckout`;
let defaultChannel;
@ -91,7 +89,10 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
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);
});
});
});
}
);
});

View file

@ -19,9 +19,7 @@ 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()}`;
@ -58,10 +56,7 @@ filterTests({ definedTags: ["all"] }, () => {
});
})
.then(
({
warehouse: warehouseResp,
shippingMethod: shippingMethodResp
}) => {
({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => {
warehouse = warehouseResp;
shippingMethod = shippingMethodResp;
createTypeAttributeAndCategoryForProduct({ name });
@ -95,7 +90,10 @@ filterTests({ definedTags: ["all"] }, () => {
);
});
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"
);
});
});
});
}
);
});

View file

@ -18,16 +18,13 @@ 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;
let defaultChannel;
let address;
@ -49,7 +46,10 @@ filterTests({ definedTags: ["all", "refactored"] }, () => {
});
});
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");
});
});
});
}
);
});

View file

@ -10,9 +10,7 @@ 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()}`;
@ -61,7 +59,10 @@ filterTests({ definedTags: ["all", "refactored"] }, () => {
});
});
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);
});
});
});
}
);
});

View file

@ -14,9 +14,7 @@ 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;
@ -24,7 +22,10 @@ filterTests({ definedTags: ["all"] }, () => {
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");
});
});
});
}
);
});

View file

@ -12,10 +12,8 @@ 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";
@ -44,7 +42,10 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
});
attributesTypes.forEach(attributeType => {
it(`should create variant with ${attributeType.key} attribute. TC: ${attributeType.TC}`, () => {
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();
});
});
});
}
);
});
});

View file

@ -6,16 +6,11 @@ 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 = [
@ -63,7 +58,10 @@ filterTests({ definedTags: ["all"] }, () => {
});
attributesTypes.forEach(attributeType => {
it(`should be able to create ${attributeType.type} attribute. TC:${attributeType.testCase}`, () => {
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}`, () => {
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}`, () => {
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
});
});
});
});
}
);
});

View file

@ -13,13 +13,11 @@ 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 = [
@ -65,7 +63,10 @@ filterTests({ definedTags: ["all"] }, () => {
});
attributesTypes.forEach(attributeType => {
it(`should be able to create ${attributeType.type} attribute. TC:${attributeType.testCase}`, () => {
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}`, () => {
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}`, () => {
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);
});
});
});
}
);
});

View file

@ -10,10 +10,8 @@ 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;
@ -33,7 +31,10 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
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);
});
});
});
}
);
});

View file

@ -19,7 +19,6 @@ import {
showFilters
} from "../../../support/pages/catalog/products/productsListPage";
filterTests({ definedTags: ["all"] }, () => {
xdescribe("Tests for using attributes in filters", () => {
const startsWith = "AttrFilter";
@ -47,7 +46,10 @@ filterTests({ definedTags: ["all"] }, () => {
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");
});
});
}
);
});

View file

@ -18,15 +18,12 @@ 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;
before(() => {
@ -45,11 +42,14 @@ filterTests({ definedTags: ["all"] }, () => {
);
});
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");
});
});
}
);
});

View file

@ -23,9 +23,7 @@ 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()}`;
@ -57,7 +55,10 @@ filterTests({ definedTags: ["all"] }, () => {
cy.clearSessionData().loginUserViaRequest();
});
it("should not be possible to add products to order with inactive channel", () => {
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);
});
});
});
}
);
});

View file

@ -8,16 +8,13 @@ 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;
@ -36,7 +33,10 @@ filterTests({ definedTags: ["all"] }, () => {
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);
});
});
}
);
});

View file

@ -8,17 +8,16 @@ 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()}`;
let testCase = 1301;
let menu;
@ -34,7 +33,10 @@ filterTests({ definedTags: ["all"] }, () => {
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`, () => {
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);
});
});
});
}
);
});
});

View file

@ -21,7 +21,6 @@ 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-";
@ -34,7 +33,10 @@ filterTests({ definedTags: ["all"] }, () => {
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");
});
});
});
}
);
});

View file

@ -23,9 +23,7 @@ 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();
@ -114,7 +112,10 @@ filterTests({ definedTags: ["stagedOnly"] }, () => {
});
});
it("should purchase products with simple card", () => {
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);
});
});
});
}
);
});

View file

@ -21,9 +21,7 @@ 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()}`;
@ -41,10 +39,10 @@ filterTests({ definedTags: ["stagedOnly"], version: "3.1.0" }, () => {
cy.clearSessionData()
.loginUserViaRequest()
.visit(urlList.plugins)
.softExpectSkeletonIsVisible();
.expectSkeletonIsVisible();
});
it("should change user email", () => {
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)
@ -66,7 +64,10 @@ filterTests({ definedTags: ["stagedOnly"], version: "3.1.0" }, () => {
});
});
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;
});
});
});
}
);
});

View file

@ -14,9 +14,7 @@ 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`;
@ -72,7 +70,10 @@ filterTests({ definedTags: ["stagedOnly"] }, () => {
});
});
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;
});
});
});
}
);
});

View file

@ -15,9 +15,7 @@ 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;
@ -36,7 +34,10 @@ filterTests({ definedTags: ["all"] }, () => {
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);
});
});
});
}
);
});

View file

@ -6,10 +6,8 @@ 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";
@ -22,10 +20,13 @@ filterTests({ definedTags: ["all"] }, () => {
cy.clearSessionData()
.loginUserViaRequest()
.visit(urlList.productTypes)
.softExpectSkeletonIsVisible();
.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");
});
});
});
}
);
});

View file

@ -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,9 +17,7 @@ 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;
@ -39,7 +36,10 @@ filterTests({ definedTags: ["all"] }, () => {
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");
});
});
});
}
);
});

View file

@ -13,14 +13,12 @@ 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;
@ -31,7 +29,10 @@ filterTests({ definedTags: ["all"] }, () => {
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);
});
});
});
});
}
);
});

View file

@ -13,14 +13,12 @@ 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()}`;
@ -103,13 +101,16 @@ filterTests({ definedTags: ["all"] }, () => {
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;
});
});
});
}
);
});

View file

@ -12,13 +12,11 @@ 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()}`;
@ -55,7 +53,10 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
it("should be able to update shipping rate. TC: SALEOR_0806", () => {
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;
});
});
});
}
);
});

View file

@ -12,11 +12,9 @@ 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()}`;
@ -44,14 +42,15 @@ filterTests({ definedTags: ["all"] }, () => {
const rateName = `${startsWith}${faker.datatype.number()}`;
cy.clearSessionData().loginUserViaRequest();
createShippingZone(name, "US", defaultChannel.id).then(
shippingZoneResp => {
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");
}
);
});
});
}
);
});

View file

@ -16,13 +16,11 @@ 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()}`;
@ -89,7 +87,10 @@ filterTests({ definedTags: ["all"] }, () => {
.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,7 +128,8 @@ filterTests({ definedTags: ["all"] }, () => {
isShippingAvailableForAddress(secondUsAddress, rateName).then(
isAvailable => expect(isAvailable).to.be.true
);
});
}
);
function isShippingAvailableForAddress(address, rateName) {
return createCheckout({
@ -136,4 +142,3 @@ filterTests({ definedTags: ["all"] }, () => {
);
}
});
});

View file

@ -16,13 +16,11 @@ 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()}`;
@ -83,7 +81,10 @@ filterTests({ definedTags: ["all"] }, () => {
.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;
});
});
});
}
);
});

View file

@ -14,10 +14,8 @@ 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()}`;
@ -48,7 +46,10 @@ filterTests({ definedTags: ["all"] }, () => {
});
// Log in as user with shipping permissions after resolving SALEOR-3407 bug
it("should recalculate weight after changing shipping weight unit. TC: SALEOR_0901", () => {
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);
});
});
});
}
);
});

View file

@ -10,9 +10,7 @@ import {
getShopInfo,
updateShopAddress
} from "../../support/api/requests/ShopSettings";
import filterTests from "../../support/filterTests";
filterTests({ definedTags: ["all"] }, () => {
xdescribe("Tests for site settings", () => {
let address;
@ -31,7 +29,7 @@ filterTests({ definedTags: ["all"] }, () => {
.visit(urlList.siteSettings);
});
it("should change store name", () => {
it("should change store name", { tags: ["@siteSettings", "@allEnv"] }, () => {
const name = `Cypress-${faker.datatype.number()}`;
cy.get(SITE_SETTINGS_DETAILS.nameInput)
@ -44,7 +42,10 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
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);
});
});
});
}
);
});

View file

@ -19,9 +19,7 @@ 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;
@ -40,7 +38,7 @@ filterTests({ definedTags: ["all"] }, () => {
cy.clearSessionData().loginUserViaRequest();
});
it("should create warehouse", () => {
it("should create warehouse", { tags: ["@warehouse", "@allEnv"] }, () => {
const name = `${startsWith}${faker.datatype.number()}`;
cy.visit(urlList.warehouses)
.get(WAREHOUSES_LIST.createNewButton)
@ -58,12 +56,15 @@ filterTests({ definedTags: ["all"] }, () => {
})
.then(warehouse => {
const addressResp = warehouse.address;
chai.softExpect(warehouse.name).to.be.eq(name);
expect(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,9 +100,10 @@ filterTests({ definedTags: ["all"] }, () => {
shippingZone.id
);
});
});
}
);
it("should delete warehouse", () => {
it("should delete warehouse", { tags: ["@warehouse", "@allEnv"] }, () => {
const name = `${startsWith}${faker.datatype.number()}`;
createWarehouseViaApi({
name,
@ -118,7 +120,10 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
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,9 +156,10 @@ filterTests({ definedTags: ["all"] }, () => {
.then(warehouseResp => {
expect(warehouseResp.shippingZones.edges).to.be.empty;
});
});
}
);
it("should update warehouse", () => {
it("should update warehouse", { tags: ["@warehouse", "@allEnv"] }, () => {
const name = `${startsWith}${faker.datatype.number()}`;
const updatedName = `${startsWith}${faker.datatype.number()}`;
let warehouse;
@ -176,9 +182,8 @@ filterTests({ definedTags: ["all"] }, () => {
})
.then(warehouseResp => {
const addressResp = warehouseResp.address;
chai.softExpect(warehouseResp.name).to.be.eq(updatedName);
expect(warehouseResp.name).to.be.eq(updatedName);
cy.expectCorrectBasicAddress(addressResp, secondUsAddress);
});
});
});
});

View file

@ -29,8 +29,7 @@ describe("Tests for customer registration", () => {
});
});
filterTests({ definedTags: ["stagedOnly"] }, () => {
it("should register customer", () => {
it("should register customer", { tags: ["@customer", "@stagedOnly"] }, () => {
const email = `${startsWith}${faker.datatype.number()}@example.com`;
customerRegistration({ email, channel: defaultChannel.slug });
getMailActivationLinkForUser(email)
@ -51,10 +50,11 @@ describe("Tests for customer registration", () => {
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;
});
});
});
}
);
});

View file

@ -25,9 +25,7 @@ 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;
@ -85,7 +83,10 @@ filterTests({ definedTags: ["all"] }, () => {
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,9 +133,10 @@ filterTests({ definedTags: ["all"] }, () => {
productData.price - saleValue
);
});
});
}
);
it("should delete sale", () => {
it("should delete sale", { tags: ["@sales", "@allEnv", "@stable"] }, () => {
const name = `${startsWith}${faker.datatype.number()}`;
let variants;
let saleToDelete;
@ -171,13 +173,14 @@ filterTests({ definedTags: ["all"] }, () => {
})
.then(variantResp => {
expect(variantResp.pricing.onSale).to.be.false;
expect(variantResp.pricing.price.gross.amount).to.eq(
productData.price
);
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
);
});
});
});
}
);
});

View file

@ -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,7 +21,6 @@ import {
discountOptions
} from "../../support/pages/discounts/salesPage";
filterTests({ definedTags: ["all"] }, () => {
xdescribe("Sales discounts for products", () => {
const startsWith = "CySales-";
@ -76,7 +74,10 @@ filterTests({ definedTags: ["all"] }, () => {
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));
});
});
}
);
});

View file

@ -10,13 +10,11 @@ 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-";
@ -69,7 +67,10 @@ filterTests({ definedTags: ["all"] }, () => {
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);
});
});
});
}
);
});

View file

@ -20,7 +20,6 @@ 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;
@ -66,7 +65,10 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
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");
}
);
});
});
}
);
});

View file

@ -11,13 +11,11 @@ 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;
@ -58,7 +56,10 @@ filterTests({ definedTags: ["all"] }, () => {
);
});
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,7 +213,8 @@ 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()}`;
@ -232,4 +246,3 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
});
});

View file

@ -12,11 +12,9 @@ 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;
@ -54,7 +52,10 @@ filterTests({ definedTags: ["all"] }, () => {
);
});
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");
});
});
});
}
);
});

View file

@ -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", () => {
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}`
);
});
});
}
);
});

View file

@ -22,7 +22,6 @@ 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;
@ -96,9 +95,7 @@ filterTests({ definedTags: ["all", "critical", "refactored"] }, () => {
);
});
homePageUtils
.getSalesAmount(defaultChannel.slug)
.then(salesAmount => {
homePageUtils.getSalesAmount(defaultChannel.slug).then(salesAmount => {
salesAmountRegexp = getSalesAmountRegex(
salesAmount,
productPrice * 2 + shippingPrice
@ -148,7 +145,10 @@ filterTests({ definedTags: ["all", "critical", "refactored"] }, () => {
cy.clearSessionData().loginUserViaRequest();
});
it("should display correct information on dashboard home page. SALEOR_2004", () => {
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");
});
});
}
);
});

View file

@ -2,23 +2,28 @@
/// <reference types="../support"/>
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();
});
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");
});
});
}
);
});

View file

@ -14,9 +14,7 @@ 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()}`;
@ -46,7 +44,10 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
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);
});
});
});
}
);
});

View file

@ -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,19 +44,17 @@ 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}`, () => {
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
);
if (key === "all") {
return;
}
permissionsSteps
.getDisplayedSelectors()
.then(selectors => {
@ -88,7 +85,20 @@ describe("As a staff user I want to navigate through shop using different permis
}
});
});
}
);
}
});
});
});
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
);
}
);
});

View file

@ -10,13 +10,11 @@ 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();
@ -42,7 +40,10 @@ filterTests({ definedTags: ["all"] }, () => {
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);
}
);
});
});
}
);
});

View file

@ -17,11 +17,9 @@ 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();
@ -86,9 +84,12 @@ filterTests({ definedTags: ["all"] }, () => {
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;
});
});
});
});
}
);
});

View file

@ -15,13 +15,11 @@ 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()}`;
@ -97,7 +95,10 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
});
});
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;
});
});
});
}
);
});

View file

@ -28,11 +28,9 @@ 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();
@ -60,12 +58,7 @@ filterTests({ definedTags: ["all"] }, () => {
})
.then(addresses => {
address = addresses.plAddress;
createCustomer(
`${randomName}@example.com`,
randomName,
address,
true
);
createCustomer(`${randomName}@example.com`, randomName, address, true);
})
.then(customerResp => {
customer = customerResp.user;
@ -76,10 +69,7 @@ filterTests({ definedTags: ["all"] }, () => {
});
})
.then(
({
warehouse: warehouseResp,
shippingMethod: shippingMethodResp
}) => {
({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => {
shippingMethod = shippingMethodResp;
warehouse = warehouseResp;
productsUtils.createTypeAttributeAndCategoryForProduct({
@ -115,7 +105,10 @@ filterTests({ definedTags: ["all"] }, () => {
);
});
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,9 +140,10 @@ filterTests({ definedTags: ["all"] }, () => {
.find("[button]")
.should("not.exist");
});
});
}
);
it("should cancel fulfillment", () => {
it("should cancel fulfillment", { tags: ["@orders", "@allEnv"] }, () => {
let order;
createFulfilledOrder({
customerId: customer.id,
@ -158,7 +156,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(SHARED_ELEMENTS.skeleton)
.should("not.exist")
@ -179,7 +177,10 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
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");
});
});
});
}
);
});

View file

@ -13,9 +13,7 @@ import {
createPageType,
getPageType
} from "../../support/api/requests/PageType";
import filterTests from "../../support/filterTests";
filterTests({ definedTags: ["all"] }, () => {
describe("Tests for page types", () => {
const startsWith = "PageTypes";
@ -23,7 +21,10 @@ filterTests({ definedTags: ["all"] }, () => {
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,9 +44,10 @@ filterTests({ definedTags: ["all"] }, () => {
.then(pageType => {
expect(pageType.name).to.eq(randomName);
});
});
}
);
xit("should assign attribute", () => {
xit("should assign attribute", { tags: ["@pages", "@allEnv"] }, () => {
const randomName = startsWith + faker.datatype.number();
createAttribute({ name: randomName, type: "PAGE_TYPE" });
@ -65,4 +67,3 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
});
});

View file

@ -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,10 +14,8 @@ 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()}`;
@ -49,7 +47,10 @@ filterTests({ definedTags: ["all"] }, () => {
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`, () => {
it(
`should create page with ${attributeType} attribute`,
{ tags: ["@pages", "@allEnv"] },
() => {
const randomName = `${startsWith}${faker.datatype.number()}`;
const attributeValues = [attributeValuesOnPage[attributeType]];
createAttribute({
@ -116,10 +125,11 @@ filterTests({ definedTags: ["all"] }, () => {
);
}
});
});
}
);
});
it("should delete page", () => {
it("should delete page", { tags: ["@pages", "@allEnv", "@stable"] }, () => {
const randomName = `${startsWith}${faker.datatype.number()}`;
createPageRequest({
@ -137,7 +147,7 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
it("should update page", () => {
it("should update page", { tags: ["@pages", "@allEnv", "@stable"] }, () => {
const randomName = `${startsWith}${faker.datatype.number()}`;
const updatedName = `${startsWith}${faker.datatype.number()}`;
@ -163,4 +173,3 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
});
});

View file

@ -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,7 +23,6 @@ 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"];
@ -57,7 +55,10 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
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));
});
});
});
}
);
});

View file

@ -13,10 +13,8 @@ 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"];
@ -57,7 +55,10 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
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;
});
});
});
}
);
});

View file

@ -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,7 +22,6 @@ 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()}`;
@ -60,7 +58,10 @@ filterTests({ definedTags: ["all", "critical"] }, () => {
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,7 +138,8 @@ filterTests({ definedTags: ["all", "critical"] }, () => {
prices
);
});
});
}
);
function createTpeAndFillUpProductFields(
randomName,
@ -153,4 +159,3 @@ filterTests({ definedTags: ["all", "critical"] }, () => {
return fillUpCommonFieldsForAllProductTypes(productData);
}
});
});

View file

@ -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();
});
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,9 +49,10 @@ filterTests({ definedTags: ["all"] }, () => {
.should("have.length", expectedProductsSvgAvatars);
});
});
});
}
);
it("Should display product image", () => {
it("Should display product image", { tags: ["@products", "@allEnv"] }, () => {
getFirstProducts(1, demoProductsNames.carrotJuice)
.then(resp => {
const product = resp[0].node;
@ -67,7 +69,7 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
it("Should upload saved image", () => {
it("Should upload saved image", { tags: ["@products", "@allEnv"] }, () => {
const name = "CyImages";
cy.clearSessionData().loginUserViaRequest();
@ -93,4 +95,3 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
});
});

View file

@ -10,10 +10,8 @@ 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()}`;
@ -66,7 +64,10 @@ filterTests({ definedTags: ["all"] }, () => {
);
});
it("should update product to available for purchase", () => {
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);
});
});
});
}
);
});

View file

@ -9,10 +9,8 @@ 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()}`;
@ -50,7 +48,10 @@ filterTests({ definedTags: ["all"] }, () => {
);
});
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);
});
});
});
}
);
});

View file

@ -8,10 +8,8 @@ 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()}`;
@ -49,7 +47,10 @@ filterTests({ definedTags: ["all"] }, () => {
);
});
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);
});
});
});
}
);
});

View file

@ -17,14 +17,12 @@ 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()}`;
@ -94,17 +92,24 @@ filterTests({ definedTags: ["all"] }, () => {
// const filterProductsBy = ["category", "collection", "productType"];
const filterProductsBy = ["category", "productType"];
filterProductsBy.forEach(filterBy => {
it(`should filter products by ${filterBy}`, () => {
cy.softExpectSkeletonIsVisible().waitForProgressBarToNotExist();
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);
});
});
});
}
);
});

View file

@ -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);
});
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
);
});
});
}
);
});

View file

@ -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}`, () => {
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);
});
});
}
);
});
});

View file

@ -12,18 +12,13 @@ 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"];
@ -61,7 +56,10 @@ filterTests({ definedTags: ["all", "critical", "refactored"] }, () => {
);
});
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);
});
});
});
}
);
});

View file

@ -22,14 +22,12 @@ 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"];
@ -65,10 +63,7 @@ filterTests({ definedTags: ["all", "critical"], version: "3.1.0" }, () => {
});
})
.then(
({
warehouse: warehouseResp,
shippingMethod: shippingMethodResp
}) => {
({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => {
warehouse = warehouseResp;
shippingMethod = shippingMethodResp;
}
@ -103,7 +98,10 @@ filterTests({ definedTags: ["all", "critical"], version: "3.1.0" }, () => {
);
});
xit("should create variant without sku by variant creator", () => {
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
});
});
});
});
}
);
});

View file

@ -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()}`;
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", () => {
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;
});
});
});
}
);
});

View file

@ -30,9 +30,7 @@ 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";
@ -69,10 +67,7 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
});
})
.then(
({
warehouse: warehouseResp,
shippingMethod: shippingMethodResp
}) => {
({ warehouse: warehouseResp, shippingMethod: shippingMethodResp }) => {
warehouse = warehouseResp;
shippingMethod = shippingMethodResp;
createTypeAttributeAndCategoryForProduct({ name, attributeValues });
@ -119,7 +114,10 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
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,7 +269,8 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
expect(variantResp.sku).to.be.null;
checkIfCheckoutForVariantCanBeCompleted(variantResp);
});
});
}
);
function checkIfCheckoutForVariantCanBeCompleted(variant) {
createWaitingForCaptureOrder({
@ -273,4 +284,3 @@ filterTests({ definedTags: ["all"], version: "3.1.0" }, () => {
});
}
});
});

View file

@ -18,11 +18,9 @@ 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()}`;
@ -63,7 +61,7 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
it("Should update product", () => {
it("Should update product", { tags: ["@products", "@allEnv"] }, () => {
const updatedName = `${startsWith}${faker.random.number()}`;
let updatedCategory;
let updatedCollection;
@ -131,7 +129,10 @@ filterTests({ definedTags: ["all"] }, () => {
});
});
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
);
});
});
}
);
});

View file

@ -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,7 +27,6 @@ import {
updateUserActiveFlag
} from "../support/pages/userPage";
filterTests({ definedTags: ["stagedOnly"] }, () => {
describe("Staff members", () => {
const startsWith = "StaffMembers";
const password = Cypress.env("USER_PASSWORD");
@ -56,12 +54,12 @@ filterTests({ definedTags: ["stagedOnly"] }, () => {
cy.clearSessionData().loginUserViaRequest();
});
it("should invite user", () => {
it("should invite user", { tags: ["@staffMembers", "@stagedOnly"] }, () => {
const firstName = faker.name.firstName();
const emailInvite = `${startsWith}${firstName}@example.com`;
cy.visit(urlList.staffMembers)
.softExpectSkeletonIsVisible()
.expectSkeletonIsVisible()
.get(STAFF_MEMBERS_LIST.inviteStaffMemberButton)
.click();
fillUpUserDetails(firstName, lastName, emailInvite);
@ -72,24 +70,26 @@ filterTests({ definedTags: ["stagedOnly"] }, () => {
});
});
it("should deactivate user", () => {
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(
expect(
tokenCreate.errors[0].code,
"logging in should return error"
)
.to.be.eq("INACTIVE");
).to.be.eq("INACTIVE");
expect(tokenCreate.token).to.be.not.ok;
});
});
}
);
it("should activate user", () => {
it("should activate user", { tags: ["@staffMembers", "@stagedOnly"] }, () => {
updateStaffMember({ userId: user.id, isActive: false });
updateUserActiveFlag(user.id);
cy.clearSessionData()
@ -98,7 +98,10 @@ filterTests({ definedTags: ["stagedOnly"] }, () => {
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 });
});
});
});
}
);
});

View file

@ -9,10 +9,8 @@ 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();
@ -32,7 +30,10 @@ filterTests({ definedTags: ["all"], version: "3.0.0" }, () => {
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);
});
});
});
}
);
});

View file

@ -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);
}

View file

@ -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(
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
),
softExpect(variantsResp[0].channelListings[0].price.amount).to.be.eq(
);
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(
expect(metadataResp, "Check metadata fields length").to.have.length(1);
expect(metadataResp[0].key, "Check product metadata key").to.be.eq(
expectedMetadata.name
),
softExpect(metadataResp[0].value, "Check product metadata value").to.be.eq(
);
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)
).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(
expect(attributes).to.have.length(1);
expect(attributes[0].attribute.name, "Check attribute name").to.be.eq(
attribute.name
)
);
}

View file

@ -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(
expect(
$body.find(SHARED_ELEMENTS.skeleton, "skeleton should exist").length
)
.to.be.eq(1);
).to.be.eq(1);
}
});
});

20
cypress/support/cypress-grep/index.d.ts vendored Normal file
View file

@ -0,0 +1,20 @@
/// <reference types="cypress" />
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;
}
}

View file

@ -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;

View file

@ -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;

View file

@ -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
};

View file

@ -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();

View file

@ -13,7 +13,6 @@ declare namespace Cypress {
startsWith: string,
name? = string
): Chainable<any>;
softExpectSkeletonIsVisible(): Chainable<any>;
expectCorrectFullAddress(
responseAddress: string,
expectedAddress: string
@ -22,8 +21,6 @@ declare namespace Cypress {
responseAddress: string,
expectedAddress: string
): Chainable<any>;
softAssertVisibility(selector: string): Chainable<any>;
softAssertMatch(selector: string, regexp: string): Chainable<any>;
getTextFromElement(element: {}): Chainable<any>;
clearAndType(subject: {}, text: string): Chainable<any>;
loginUser(): Chainable<any>;

View file

@ -111,6 +111,6 @@ function submitFilters() {
export function enterProductListPage() {
cy.visit(urlList.products)
.softExpectSkeletonIsVisible()
.expectSkeletonIsVisible()
.waitForProgressBarToNotExist();
}

View file

@ -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,

View file

@ -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,

291
package-lock.json generated
View file

@ -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",

View file

@ -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",

View file

@ -17,5 +17,5 @@
},
"resolveJsonModule": true
},
"exclude": ["node_modules"]
"exclude": ["node_modules", "cypress"]
}