Skip to content

Commit

Permalink
Merge branch 'main' into MERX-637-search-bar-order
Browse files Browse the repository at this point in the history
  • Loading branch information
Cloud11PL authored Jul 29, 2024
2 parents 4f0cd4c + 862e5dc commit 7f345a1
Show file tree
Hide file tree
Showing 107 changed files with 386 additions and 2,006 deletions.
5 changes: 0 additions & 5 deletions .changeset/big-squids-tie.md

This file was deleted.

7 changes: 0 additions & 7 deletions .changeset/fair-masks-dance.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/lazy-moose-study.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/mighty-apricots-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

The migrated dropdown components and there types no longer exist within the codebase
5 changes: 5 additions & 0 deletions .changeset/nervous-comics-sleep.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

You can run e2e test for an order type discount in a draft order
5 changes: 0 additions & 5 deletions .changeset/nice-bears-shake.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/pretty-masks-lay.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

You can now run E2E tests locally with no issues
5 changes: 0 additions & 5 deletions .changeset/real-icons-share.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/slimy-eggs-heal.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/slimy-rocks-explode.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/strong-kings-watch.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/two-actors-walk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": patch
---

Text in Dashboard now is aligned and is displayed correctly
5 changes: 5 additions & 0 deletions .changeset/unlucky-starfishes-hammer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"saleor-dashboard": minor
---

Create CORE release PR even if automation tests fail
5 changes: 0 additions & 5 deletions .changeset/wise-ads-mix.md

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/automation-tests-on-repository-dispatch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ jobs:
with:
VERSION: ${{needs.get-environment-variables.outputs.VERSION}}
CUSTOM_VERSION: ${{github.event.client_payload.custom_version }}
ADDITIONAL_TITLE: "Core automation test. !!!\n If tests fail, release PR in cloud deployments will not be created !!!"
ADDITIONAL_TITLE: "Core automation test"
secrets: inherit

add-tests-status-to-release-PR:
needs: run-tests-on-release
if: ${{ github.event.client_payload.project == 'CORE' }}
if: ${{ always() && github.event.client_payload.project == 'CORE' }}
runs-on: ubuntu-22.04
steps:
- name: Open release PR
Expand Down
3 changes: 0 additions & 3 deletions locale/defaultMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -934,9 +934,6 @@
"context": "Transaction capture button - charge preauthorized transaction amount",
"string": "Capture"
},
"450Fty": {
"string": "None"
},
"45aV8u": {
"context": "gift card bulk create modal bottom explanation",
"string": "After creation Saleor will create a list of gift card codes that you will be able to download."
Expand Down
2 changes: 1 addition & 1 deletion playwright/api/basics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ export class BasicApiService {
});
const loginResponseJson = await loginResponse.json();

return loginResponseJson as ApiResponse<TokenCreateResponse>;
return loginResponseJson;
}
}
16 changes: 15 additions & 1 deletion playwright/data/e2eTestData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,20 @@ export const PRODUCTS = {
"a product to be deleted via bulk 3/3",
],
},
productWithPriceHigherThan20: {
id: "HJvZHVjdDo2NA==",
name: "Ocean Poems",
variantSKU: "ocean-poems-mp3",
price: 22,
},
productWithPriceLowerThan20: {
name: "Bean Juice",
variantSKU: "57423879",
price: 3,
},
giftProduct: {
name: "Power Juice",
},
productWithDiscountChannelPLN: {
id: "UHJvZHVjdDo3NzA=",
name: "e2e-do-not-touch",
Expand All @@ -424,7 +438,7 @@ export const ORDERS = {
draftOrderChannelPLN: {
id: "T3JkZXI6Zjg0NTk3N2EtM2Y3Yy00NDY3LWI3N2MtZDY0ZjhhMDU2MmQy",
productInBasket: {
name: "Black Hoodie",
productName: "Black Hoodie",
price: 20,
variantId: "UHJvZHVjdFZhcmlhbnQ6Mjk3",
},
Expand Down
1 change: 1 addition & 0 deletions playwright/pages/appPageThirdparty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export class AppPage extends BasePage {
const appUrl = URL_LIST.apps + appId;

await this.page.goto(appUrl);
await this.pageHeader.waitFor({ state: "visible", timeout: 10000 });
}

async clickAppSettingsButton() {
Expand Down
1 change: 1 addition & 0 deletions playwright/pages/appsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class AppsPage extends BasePage {

async gotoAppsList() {
await this.page.goto(URL_LIST.apps);
await this.waitForDOMToFullyLoad();
}

async typeManifestUrl(manifestUrl: string) {
Expand Down
2 changes: 0 additions & 2 deletions playwright/pages/basePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -265,14 +265,12 @@ export class BasePage {
return await this.findRowIndexBasedOnText([searchItem]);
}

// check row on grid list view
async checkListRowsBasedOnContainingText(searchText: string[]) {
const rowIndexes = await this.findRowIndexBasedOnText(searchText);

for (const rowIndex of rowIndexes) {
await this.clickGridCell(0, rowIndex);
}
// make sure all searched texts were found and checked
await expect(searchText.length).toEqual(rowIndexes.length);
}

Expand Down
6 changes: 6 additions & 0 deletions playwright/pages/dialogs/draftOrderCreateDialog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ export class DraftOrderCreateDialog {
await this.channelOption.first().click();
await this.clickConfirmButton();
}

async completeDraftOrderCreateDialogWithSpecificChannel(channel: string) {
await this.expandChannelsSearchList();
await this.channelOption.filter({ hasText: channel }).first().click();
await this.clickConfirmButton();
}
}
5 changes: 4 additions & 1 deletion playwright/pages/ordersPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { ShippingAddressDialog } from "@pages/dialogs/shippingMethodDialog";
import { Page } from "@playwright/test";

import { OrderRefundDialog } from "./dialogs/orderRefundDialog";
import { DraftOrdersPage } from "./draftOrdersPage";

export class OrdersPage extends BasePage {
orderCreateDialog: OrderCreateDialog;
Expand Down Expand Up @@ -62,6 +61,9 @@ export class OrdersPage extends BasePage {
readonly totalPrice = page
.getByTestId("order-total-price")
.locator(page.getByTestId("money-value")),
readonly subTotalPrice = page
.getByTestId("order-total-price")
.locator(page.getByTestId("money-value")),
) {
super(page);
this.markOrderAsPaidDialog = new MarkOrderAsPaidDialog(page);
Expand Down Expand Up @@ -125,6 +127,7 @@ export class OrdersPage extends BasePage {
await this.page.goto(orderLink);
await this.waitForDOMToFullyLoad();
await this.waitForGrid();
await this.waitForGrid();
}

async clickAddRefundButton() {
Expand Down
4 changes: 2 additions & 2 deletions playwright/pages/productPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class ProductPage extends BasePage {
}

async clickBulkDeleteButton() {
await this.bulkDeleteButton.click();
await this.submitButton.click();
}

async addSeo() {
Expand Down Expand Up @@ -211,7 +211,7 @@ export class ProductPage extends BasePage {

async gotoProductListPage() {
await this.page.goto(URL_LIST.products);
await this.waitForDOMToFullyLoad();
await this.waitForGrid();
}

async uploadProductImage(fileName: string) {
Expand Down
4 changes: 1 addition & 3 deletions playwright/pages/shippingRatesPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ export class ShippingRatesPage extends BasePage {
await this.assignDialogProductRow.filter({ hasText: name }).waitFor({ state: "visible" });
await this.assignProductsDialog.selectProduct(name);
await expect(this.assignProductsDialog.assignAndSaveButton).toBeEnabled();
await this.waitForNetworkIdleAfterAction(() =>
this.assignProductsDialog.assignAndSaveButton.click(),
);
await this.assignProductsDialog.assignAndSaveButton.click();
await this.assignProductsDialog.assignAndSaveButton.waitFor({
state: "hidden",
timeout: 5000,
Expand Down
6 changes: 1 addition & 5 deletions playwright/tests/apps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ test.skip("TC: SALEOR_119 User should be able to install and configure app from
page,
}) => {
await appsPage.gotoAppsList();
await appsPage.waitForDOMToFullyLoad();
await expect(appsPage.installExternalAppButton).toBeVisible();
await appsPage.installExternalAppButton.click();
await appsPage.typeManifestUrl("https://klaviyo.saleor.app/api/manifest");
Expand Down Expand Up @@ -50,10 +49,7 @@ test.skip("TC: SALEOR_119 User should be able to install and configure app from
await appsPage.expectSuccessBanner();
});
test("TC: SALEOR_120 User should be able to delete thirdparty app @e2e", async () => {
await appPage.waitForNetworkIdleAfterAction(() =>
appPage.goToExistingAppPage(APPS.appToBeDeleted.id),
);
await appPage.pageHeader.waitFor({ state: "visible", timeout: 10000 });
await appPage.goToExistingAppPage(APPS.appToBeDeleted.id);
await expect(appPage.pageHeader).toContainText("Saleor QA App");
await appPage.deleteButton.click();
await appPage.deleteAppDialog.clickDeleteButton();
Expand Down
38 changes: 15 additions & 23 deletions playwright/tests/attributes.spec.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import { ATTRIBUTES } from "@data/e2eTestData";
import { AttributesPage } from "@pages/attributesPage";
import { ConfigurationPage } from "@pages/configurationPage";
import { expect, test } from "@playwright/test";
import { BrowserContext, expect, test } from "@playwright/test";
import faker from "faker";

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

let context: BrowserContext;
let attributesPage: AttributesPage;
let configurationPage: ConfigurationPage;

test.beforeEach(({ page }) => {
test.beforeEach(async ({ browser }) => {
context = await browser.newContext({
storageState: "playwright/.auth/admin.json",
});

const page = await context.newPage();

attributesPage = new AttributesPage(page);
configurationPage = new ConfigurationPage(page);
});
Expand All @@ -21,10 +26,7 @@ for (const attr of attributeClasses) {
for (const type of ATTRIBUTES.attributeTypesWithAbilityToAddValues.names) {
const uniqueSlug = `${attr}-${type.replace(" ", "-")}-${SALEOR_124_uuid}`;

test(`TC: SALEOR_124 User should be able to create ${attr} ${type} attribute with ability to add values, required, public @e2e @attributes`, async ({
page,
}) => {
await page.context().storageState({ path: "./playwright/.auth/admin.json" });
test(`TC: SALEOR_124 User should be able to create ${attr} ${type} attribute with ability to add values, required, public @e2e @attributes`, async () => {
await configurationPage.goToConfigurationView();
await configurationPage.openAttributes();
await attributesPage.clickCreateAttributeButton();
Expand Down Expand Up @@ -55,10 +57,7 @@ for (const attr of attributeClasses) {
for (const type of ATTRIBUTES.attributeTypesWithoutAbilityToAddValues.names) {
const uniqueSlug = `${attr}-${type.replace(" ", "-")}-${SALEOR_125_uuid}`;

test(`TC: SALEOR_125 User should be able to create ${attr} ${type} attribute without ability to add values, NOT required, private @e2e @attributes`, async ({
page,
}) => {
await page.context().storageState({ path: "./playwright/.auth/admin.json" });
test(`TC: SALEOR_125 User should be able to create ${attr} ${type} attribute without ability to add values, NOT required, private @e2e @attributes`, async () => {
await configurationPage.goToConfigurationView();
await configurationPage.openAttributes();
await attributesPage.waitForDOMToFullyLoad();
Expand Down Expand Up @@ -90,10 +89,7 @@ for (const attr of attributeClasses) {
for (const entity of ATTRIBUTES.attributeReferencesEntities.names) {
const uniqueSlug = `${attr}-${entity.replaceAll(" ", "-")}-${SALEOR_126_uuid}`;

test(`TC: SALEOR_126 User should be able to create ${attr} References attribute for ${entity}, NOT required, public @e2e @attributes`, async ({
page,
}) => {
await page.context().storageState({ path: "./playwright/.auth/admin.json" });
test(`TC: SALEOR_126 User should be able to create ${attr} References attribute for ${entity}, NOT required, public @e2e @attributes`, async () => {
await configurationPage.goToConfigurationView();
await configurationPage.openAttributes();
await attributesPage.waitForDOMToFullyLoad();
Expand Down Expand Up @@ -133,9 +129,7 @@ const attributesWithValuesToBeUpdated = [productAttrWithValues, contentAttrWithV

for (const attribute of attributesWithValuesToBeUpdated) {
test(`TC: SALEOR_127 User should be able to update attribute values in existing ${attribute.name} attribute @e2e @attributes`, async () => {
await attributesPage.waitForNetworkIdleAfterAction(() =>
attributesPage.gotoExistingAttributePage(attribute.id, attribute.name),
);
await attributesPage.gotoExistingAttributePage(attribute.id, attribute.name);
await attributesPage.clickDeleteAttrValueButton(attribute.valueToBeDeleted);
await expect(attributesPage.dialog).toBeVisible();
await attributesPage.deleteAttributeValueDialog.deleteAttributeValue();
Expand All @@ -162,15 +156,13 @@ for (const attribute of attributesWithValuesToBeUpdated) {

for (const attr of ATTRIBUTES.attributesToBeUpdated) {
test(`TC: SALEOR_128 User should be able to edit existing ${attr.name} attribute @e2e @attributes`, async () => {
await attributesPage.waitForNetworkIdleAfterAction(() =>
attributesPage.gotoExistingAttributePage(attr.id, attr.name),
);
await attributesPage.gotoExistingAttributePage(attr.id, attr.name);
await attributesPage.attributeDefaultLabelInput.clear();
await attributesPage.typeAttributeDefaultLabel(`updated ${attr.name}`);
await attributesPage.expandMetadataSection();
await attributesPage.metadataAddFieldButton.click();
await attributesPage.fillMetadataFields("new key", "new value");
await attributesPage.waitForNetworkIdleAfterAction(() => attributesPage.clickSaveButton());
await attributesPage.clickSaveButton();
await attributesPage.expectSuccessBanner();
await expect(attributesPage.attributeSelect).toHaveAttribute("aria-disabled", "true");
await expect(attributesPage.metadataKeyInput).toHaveValue("new key");
Expand Down
Loading

0 comments on commit 7f345a1

Please sign in to comment.