Skip to content

Commit

Permalink
[QA] Correcting e2e test case ids (#4764)
Browse files Browse the repository at this point in the history
* correcting test case ids

* fixing flaky test

* Update .changeset/serious-books-wave.md

Co-authored-by: Jonatan Witoszek <[email protected]>

---------

Co-authored-by: Jonatan Witoszek <[email protected]>
  • Loading branch information
yellowee and witoszekdev authored Mar 29, 2024
1 parent 18cb0ec commit bde2fe8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/serious-books-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

Changed e2e test case ids to remove duplicate case ids and fix inconsistencies between repo and Testmo. Thanks to this, our QA reports will be more accurate
3 changes: 2 additions & 1 deletion playwright/pages/dialogs/productCreateDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export class ProductCreateDialog {
}
async selectProductTypeWithVariants() {
await this.dialogProductTypeInput.fill("beer");
await this.promptedOptions.filter({ hasText: "Beer" }).click();
await this.promptedOptions.filter({ hasText: "Beer" }).first().click();
await this.confirmButton.waitFor({ state: "visible", timeout: 30000});
}
async clickConfirmButton() {
await this.confirmButton.click();
Expand Down
18 changes: 9 additions & 9 deletions playwright/tests/discounts.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test.beforeEach(({ page }) => {

const discountType = ['Order', 'Catalog'];
for (const type of discountType) {
test(`TC: SALEOR_97 Create promotion with ${type} predicate @discounts @e2e`, async () => {
test(`TC: SALEOR_149 Create promotion with ${type} predicate @discounts @e2e`, async () => {
const discountName = `${faker.lorem.word()}+${type}`;
await discounts.gotoListView();
await discounts.clickCreateDiscountButton();
Expand All @@ -33,7 +33,7 @@ const discountType = ['Order', 'Catalog'];
})};


test(`TC: SALEOR_98 Update existing promotion @discounts @e2e`, async () => {
test(`TC: SALEOR_151 Update existing promotion @discounts @e2e`, async () => {
const newDiscountName = `${faker.lorem.word()}`;
await discounts.gotoExistingDiscount(DISCOUNTS.promotionToBeEdited.id);
await discounts.ruleSection.waitFor({
Expand All @@ -57,7 +57,7 @@ test(`TC: SALEOR_98 Update existing promotion @discounts @e2e`, async () => {

const promotions = [DISCOUNTS.promotionWithoutRulesToBeDeleted, DISCOUNTS.promotionWithRulesToBeDeleted];
for (const promotion of promotions) {
test(`TC: SALEOR_99 Delete existing ${promotion.name} @discounts @e2e`, async () => {
test(`TC: SALEOR_153 Delete existing ${promotion.name} @discounts @e2e`, async () => {
await discounts.gotoExistingDiscount(promotion.id);
await discounts.ruleSection.waitFor({
state: "visible",
Expand All @@ -83,7 +83,7 @@ const predicateValues = [categories, collections, products, variants];
const rewardValue = "10";
const channelName = CHANNELS.channelPLN.name
for (const { promotionRule, predicateValue } of predicateValues) {
test(`TC: SALEOR_100 Create ${promotionRule} rule for ${predicateValue} in a catalogue promotion @discounts @e2e`, async () => {
test(`TC: SALEOR_155 Create ${promotionRule} rule for ${predicateValue} in a catalogue promotion @discounts @e2e`, async () => {
await discounts.gotoExistingDiscount(promotion.id);
await discounts.ruleSection.waitFor({
state: "visible",
Expand Down Expand Up @@ -115,7 +115,7 @@ const conditionGte = { conditionType: "greater", value: "20.00", conditionDesc:
const notEqConditions = [conditionLte, conditionGte]
const orderPromotion = DISCOUNTS.orderPromotion
for (const { conditionType, value, conditionDesc } of notEqConditions) {
test(`TC: SALEOR_101 Create subtotal type rule with multiple conditions with ${conditionDesc} in order promotion @discounts @e2e`, async () => {
test(`TC: SALEOR_157 Create subtotal type rule with multiple conditions with ${conditionDesc} in order promotion @discounts @e2e`, async () => {
await discounts.gotoExistingDiscount(orderPromotion.id);
await discounts.ruleSection.waitFor({
state: "visible",
Expand Down Expand Up @@ -150,7 +150,7 @@ const condition1 = { condition: "Subtotal", gte:"150.00", lte: "170.00"}
const condition2 = { condition: "Total", gte:"20.00", lte: "50.00"}
const conditionsBetween = [condition1, condition2]
for (const { condition, lte, gte } of conditionsBetween) {
test(`TC: SALEOR_102 Create gift reward rule with ${condition} between ${gte} and ${lte} in order promotion @discounts @e2e`, async () => {
test(`TC: SALEOR_160 Create gift reward rule with ${condition} between ${gte} and ${lte} in order promotion @discounts @e2e`, async () => {
await discounts.gotoExistingDiscount(orderPromotion.id);
await discounts.ruleSection.waitFor({
state: "visible",
Expand Down Expand Up @@ -178,7 +178,7 @@ for (const { condition, lte, gte } of conditionsBetween) {

const orderRules = [DISCOUNTS.orderPromotionWithRulesToBeUpdated.rules[0], DISCOUNTS.orderPromotionWithRulesToBeUpdated.rules[1]]
for (const rule of orderRules) {
test(`TC: SALEOR_103 Update promotion ${rule.name} from Order promotion @discounts @e2e`, async () => {
test(`TC: SALEOR_163 Update promotion ${rule.name} from Order promotion @discounts @e2e`, async () => {
await discounts.gotoExistingDiscount(DISCOUNTS.orderPromotionWithRulesToBeUpdated.id);
await discounts.ruleSection.waitFor({
state: "visible",
Expand Down Expand Up @@ -213,7 +213,7 @@ for (const rule of orderRules) {

const catalogRules = [DISCOUNTS.catalogPromotionWithRulesToBeUpdated.rules[0], DISCOUNTS.catalogPromotionWithRulesToBeUpdated.rules[1]]
for (const rule of catalogRules) {
test(`TC: SALEOR_104 Update promotion ${rule.name} from Catalog promotion @discounts @e2e`, async () => {
test(`TC: SALEOR_166 Update promotion ${rule.name} from Catalog promotion @discounts @e2e`, async () => {
await discounts.gotoExistingDiscount(DISCOUNTS.catalogPromotionWithRulesToBeUpdated.id);
await discounts.ruleSection.waitFor({
state: "visible",
Expand Down Expand Up @@ -243,7 +243,7 @@ for (const rule of catalogRules) {
const promotionsWithRules = [DISCOUNTS.orderPromotionWithRulesToBeDeleted, DISCOUNTS.catalogPromotionWithRulesToBeDeleted]
for (const promotion of promotionsWithRules) {
for (const rule of promotion.rules) {
test(`TC: SALEOR_105 Delete promotion ${rule.name} from ${promotion.type} promotion @discounts @e2e`, async () => {
test(`TC: SALEOR_167 Delete promotion ${rule.name} from ${promotion.type} promotion @discounts @e2e`, async () => {
await discounts.gotoExistingDiscount(promotion.id);
await discounts.ruleSection.waitFor({
state: "visible",
Expand Down
6 changes: 3 additions & 3 deletions playwright/tests/giftCards.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@ test("TC: SALEOR_111 Bulk delete gift cards @e2e @gift", async () => {
),
).toEqual([]);
});
test("TC: SALEOR_112 Set gift card balance @e2e @gift", async () => {
test("TC: SALEOR_181 Set gift card balance @e2e @gift", async () => {
await giftCardsPage.gotoExistingGiftCardView(GIFT_CARDS.giftCardToBeEdited.id);
await giftCardsPage.clickSetBalance();
await giftCardsPage.setGiftCardsBalanceDialog.setBalance("34")
await giftCardsPage.expectSuccessBanner();
});
test("TC: SALEOR_113 Export gift card codes in XLSX file @e2e @gift", async () => {
test("TC: SALEOR_182 Export gift card codes in XLSX file @e2e @gift", async () => {
await giftCardsPage.gotoGiftCardsListView();
await giftCardsPage.clickShowMoreMenu();
await giftCardsPage.clickExportGiftCards();
Expand All @@ -129,7 +129,7 @@ test("TC: SALEOR_113 Export gift card codes in XLSX file @e2e @gift", async () =
// "Your exported gift cards data is ready",
// );
});
test("TC: SALEOR_114 Export gift card codes in CSV file @e2e @gift", async () => {
test("TC: SALEOR_183 Export gift card codes in CSV file @e2e @gift", async () => {
await giftCardsPage.gotoGiftCardsListView();
await giftCardsPage.clickShowMoreMenu();
await giftCardsPage.clickExportGiftCards();
Expand Down
2 changes: 1 addition & 1 deletion playwright/tests/staffMembers.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { expect, test } from "@playwright/test";

test.use({ storageState: "./playwright/.auth/admin.json" });

test("TC: SALEOR_37 Admin User should be able to deactivate other user @e2e @staff-members", async ({
test("TC: SALEOR_137 Admin User should be able to deactivate other user @e2e @staff-members", async ({
page,
request,
}) => {
Expand Down

0 comments on commit bde2fe8

Please sign in to comment.