Fix test case numeration (#4087)

* update tec id for presets and pages

* update tc id for creating page with attribute types tests

* update tc id for customer registration

* update tc id for metadata

* restore original condition
This commit is contained in:
Anna Szczęch 2023-08-17 13:43:03 +03:00 committed by GitHub
parent 7c38c29cae
commit 4c7ad92e76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 27 deletions

View file

@ -37,7 +37,7 @@ describe("As an admin I want to create product attribute", () => {
const attributeReferenceType = [ const attributeReferenceType = [
{ type: "PRODUCT", testCase: "SALEOR_0506" }, { type: "PRODUCT", testCase: "SALEOR_0506" },
{ type: "PAGE", testCase: "SALEOR_0507" }, { type: "PAGE", testCase: "SALEOR_0507" },
{ type: "PRODUCT_VARIANT", testCase: "SALEOR_0539" }, { type: "PRODUCT_VARIANT", testCase: "SALEOR_0540" },
]; ];
const attributeNumericType = [ const attributeNumericType = [
{ {

View file

@ -29,7 +29,7 @@ describe("Tests for customer registration", () => {
}); });
}); });
it("should register customer", { tags: ["@customer", "@allEnv"] }, () => { it("should register customer TC: SALEOR_1212", { tags: ["@customer", "@allEnv"] }, () => {
const email = `${startsWith}${faker.datatype.number()}@example.com`; const email = `${startsWith}${faker.datatype.number()}@example.com`;
customerRegistration({ email, channel: defaultChannel.slug }); customerRegistration({ email, channel: defaultChannel.slug });
const registrationLinkRegex = /\[(\s*http[^\]]*)\]/; const registrationLinkRegex = /\[(\s*http[^\]]*)\]/;
@ -53,7 +53,7 @@ describe("Tests for customer registration", () => {
}); });
it( it(
"shouldn't register customer with duplicated email", "shouldn't register customer with duplicated email TC: SALEOR_1213",
{ tags: ["@customer", "@allEnv", "@stable"] }, { tags: ["@customer", "@allEnv", "@stable"] },
() => { () => {
const duplicatedEmail = Cypress.env("USER_NAME"); const duplicatedEmail = Cypress.env("USER_NAME");
@ -68,7 +68,7 @@ describe("Tests for customer registration", () => {
); );
it( it(
"should activate customer from dashboard", "should activate customer from dashboard SALEOR_1211",
{ tags: ["@customer", "@allEnv", "@stable"] }, { tags: ["@customer", "@allEnv", "@stable"] },
() => { () => {
customerRegistration({ email, channel: defaultChannel.slug }) customerRegistration({ email, channel: defaultChannel.slug })

View file

@ -49,7 +49,7 @@ describe("Test for metadata", () => {
}); });
it( it(
"should create metadata for product", "should create metadata for product TC: SALEOR_3301",
{ tags: ["@metadata", "@allEnv", "@stable"] }, { tags: ["@metadata", "@allEnv", "@stable"] },
() => { () => {
cy.loginUserViaRequest(); cy.loginUserViaRequest();
@ -91,7 +91,7 @@ describe("Test for metadata", () => {
}, },
); );
it( it(
"should create metadata for order", "should create metadata for order TC: SALEOR_3302",
{ tags: ["@metadata", "@allEnv", "@stable"] }, { tags: ["@metadata", "@allEnv", "@stable"] },
() => { () => {
let order; let order;

View file

@ -19,13 +19,14 @@ describe("Tests for pages", () => {
let pageType; let pageType;
let pageTypeId; let pageTypeId;
const attributeValuesOnPage = {
NUMERIC: 1, const attributes = [
RICH_TEXT: faker.lorem.sentence(), { key: "DROPDOWN", value: "value", TC: "SALEOR_2203" },
DROPDOWN: "value", { key: "MULTISELECT", value: "value", TC: "SALEOR_2204" },
MULTISELECT: "value", { key: "RICH_TEXT", value: faker.lorem.sentence(), TC: "SALEOR_2205" },
BOOLEAN: true, { key: "BOOLEAN", value: true, TC: "SALEOR_2206" },
}; { key: "NUMERIC", value: 1, TC: "SALEOR_2207" },
];
before(() => { before(() => {
cy.loginUserViaRequest(); cy.loginUserViaRequest();
@ -46,7 +47,7 @@ describe("Tests for pages", () => {
}); });
it( it(
"should create not published page", "should create not published page. TC: SALEOR_2201",
{ tags: ["@pages", "@allEnv", "@stable"] }, { tags: ["@pages", "@allEnv", "@stable"] },
() => { () => {
cy.addAliasToGraphRequest("PageType"); cy.addAliasToGraphRequest("PageType");
@ -69,7 +70,7 @@ describe("Tests for pages", () => {
); );
it( it(
"should create published page", "should create published page. TC: SALEOR_2202",
{ tags: ["@pages", "@allEnv", "@stable"] }, { tags: ["@pages", "@allEnv", "@stable"] },
() => { () => {
const randomName = `${startsWith}${faker.datatype.number()}`; const randomName = `${startsWith}${faker.datatype.number()}`;
@ -91,19 +92,20 @@ describe("Tests for pages", () => {
}, },
); );
Object.keys(pagesPage.attributesTypes).forEach(attributeType => { attributes.forEach(attributeType => {
it( it(
`should create page with ${attributeType} attribute`, `should create page with ${attributeType.key} attribute TC: ${attributeType.TC}`,
{ tags: ["@pages", "@allEnv", "@stable"] }, { tags: ["@attribute", "@pages", "@allEnv"] },
() => { () => {
const randomName = `${startsWith}${faker.datatype.number()}`; const randomName = `${startsWith}${faker.datatype.number()}`;
const attributeValues = [attributeValuesOnPage[attributeType]]; const attributeKey = attributeType.key
const attributeValue = attributeType.value
attributeRequests attributeRequests
.createAttribute({ .createAttribute({
name: randomName, name: randomName,
type: "PAGE_TYPE", type: "PAGE_TYPE",
inputType: attributeType, inputType: attributeKey,
attributeValues, attributeValues: [attributeValue]
}) })
.then(attributeResp => { .then(attributeResp => {
attribute = attributeResp; attribute = attributeResp;
@ -119,15 +121,15 @@ describe("Tests for pages", () => {
.createPageWithAttribute({ .createPageWithAttribute({
pageName: randomName, pageName: randomName,
pageTypeName: randomName, pageTypeName: randomName,
attributeType, attributeType: attributeKey,
attributeValue: attributeValuesOnPage[attributeType], attributeValue: attributeValue,
}) })
.then(page => { .then(page => {
pageRequests.getPage(page.id); pageRequests.getPage(page.id);
}) })
.then(page => { .then(page => {
expect(page.attributes[0].values[0].inputType).to.eq( expect(page.attributes[0].values[0].inputType).to.eq(
attributeType, attributeKey,
); );
if (attributeType !== "BOOLEAN") { if (attributeType !== "BOOLEAN") {
expect(page.attributes[0].values[0].name).to.eq( expect(page.attributes[0].values[0].name).to.eq(
@ -145,7 +147,8 @@ describe("Tests for pages", () => {
); );
}); });
it("should delete page", { tags: ["@pages", "@allEnv", "@stable"] }, () => { it("should delete page TC: SALEOR_2209",
{ tags: ["@pages", "@allEnv", "@stable"] }, () => {
const randomName = `${startsWith}${faker.datatype.number()}`; const randomName = `${startsWith}${faker.datatype.number()}`;
pageRequests pageRequests
@ -165,7 +168,8 @@ describe("Tests for pages", () => {
}); });
}); });
it("should update page", { tags: ["@pages", "@allEnv", "@stable"] }, () => { it("should update page TC: SALEOR_2208",
{ tags: ["@pages", "@allEnv", "@stable"] }, () => {
const randomName = `${startsWith}${faker.datatype.number()}`; const randomName = `${startsWith}${faker.datatype.number()}`;
const updatedName = `${startsWith}${faker.datatype.number()}`; const updatedName = `${startsWith}${faker.datatype.number()}`;

View file

@ -23,7 +23,7 @@ describe("As a user I should be able to save selected filters with search querie
}); });
it( it(
"should be able to add preset. TC: SALEOR_3802", "should be able to add preset. TC: SALEOR_2712",
{ tags: ["@productsList", "@allEnv", "@stable"] }, { tags: ["@productsList", "@allEnv", "@stable"] },
() => { () => {
cy.visit(urlList.products); cy.visit(urlList.products);