-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrated warehouses tests: Edit warehouse; Delete warehouse (#4593)
* Migrated warehouses tests: Edit warehouse; Delete warehouse * Update nervous-flowers-hear.md * Update nervous-flowers-hear.md
- Loading branch information
1 parent
b606c3e
commit 460f033
Showing
9 changed files
with
159 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"saleor-dashboard": minor | ||
--- | ||
|
||
Migrated warehouses tests: Edit warehouse; Delete warehouse | ||
nightly workflow: do not trigger test complete job if testmo-report-preparation is skipped/failed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { Page } from "@playwright/test"; | ||
|
||
export class DeleteWarehouseDialog { | ||
readonly page: Page; | ||
|
||
constructor(page: Page, readonly deleteButton = page.getByTestId("submit")) { | ||
this.page = page; | ||
} | ||
|
||
async clickDeleteButton() { | ||
await this.deleteButton.click(); | ||
await this.deleteButton.waitFor({ state: "hidden" }); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,44 @@ | ||
import { URL_LIST } from "@data/url"; | ||
import { WAREHOUSES } from "@data/e2eTestData"; | ||
import { WarehousePage } from "@pages/warehousePage"; | ||
import { test } from "@playwright/test"; | ||
import { expect, test } from "@playwright/test"; | ||
|
||
test.use({ storageState: "playwright/.auth/admin.json" }); | ||
let warehousePage: WarehousePage; | ||
test.beforeEach(({ page }) => { | ||
warehousePage = new WarehousePage(page); | ||
}); | ||
|
||
test("TC: SALEOR_30 Create basic warehouse @e2e @warehouse", async ({ | ||
page, | ||
}) => { | ||
const warehousePage = new WarehousePage(page); | ||
|
||
await page.goto(URL_LIST.warehouses); | ||
test("TC: SALEOR_30 Create basic warehouse @e2e @warehouse", async () => { | ||
await warehousePage.gotoWarehouseListView(); | ||
await warehousePage.clickCreateNewWarehouseButton(); | ||
await warehousePage.completeWarehouseForm(); | ||
await warehousePage.clickSaveButton(); | ||
await warehousePage.basePage.expectSuccessBanner(); | ||
}); | ||
test("TC: SALEOR_100 Edit warehouse @e2e @warehouse", async () => { | ||
await warehousePage.gotoExistingWarehousePage( | ||
WAREHOUSES.warehouseToBeEdited.id, | ||
); | ||
|
||
await warehousePage.typeWarehouseName("edited warehouse"); | ||
await warehousePage.typeCompanyName("Umbrella"); | ||
await warehousePage.typeAddressLine1("edited warehouse address 1"); | ||
await warehousePage.typeAddressLine2("edited warehouse address 2"); | ||
await warehousePage.typePhone("+48655922888"); | ||
await warehousePage.rightSideDetailsPage.clickPublicStockButton(); | ||
await warehousePage.rightSideDetailsPage.clickPickupAllWarehousesButton(); | ||
await warehousePage.clickSaveButton(); | ||
await warehousePage.basePage.expectSuccessBanner(); | ||
}); | ||
test("TC: SALEOR_101 Delete warehouse @e2e @warehouse", async () => { | ||
await warehousePage.gotoWarehouseListView(); | ||
await warehousePage.clickDeleteWarehouseButton( | ||
WAREHOUSES.warehouseToBeDeleted.name, | ||
); | ||
|
||
await warehousePage.deleteWarehouseDialog.clickDeleteButton(); | ||
await warehousePage.expectSuccessBanner(); | ||
await expect(warehousePage.warehousesList).not.toContainText( | ||
WAREHOUSES.warehouseToBeDeleted.name, | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters