-
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.
Order payment and fulfillment with transaction flow tests (#4561)
* Create order with activated transaction flow in channel test * new assertions * Mark order as fully paid and fullfill all variants * Trigger Build * capture manual transactions test * remove not needed expect
- Loading branch information
1 parent
2948281
commit 7d59680
Showing
10 changed files
with
218 additions
and
4 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 | ||
--- | ||
|
||
Mark order as fully paid and fulfill all variants test | ||
Manual capture transactions and fulfill order test |
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,45 @@ | ||
import type { Page } from "@playwright/test"; | ||
|
||
export class ManualTransactionDialog { | ||
constructor( | ||
page: Page, | ||
readonly transactionDescriptionInput = page.getByTestId( | ||
"transactionDescription", | ||
), | ||
readonly createManualTransactionButton = page.getByTestId( | ||
"manualTransactionSubmit", | ||
), | ||
readonly transactionPspReferenceInput = page.getByTestId( | ||
"transactionPspReference", | ||
), | ||
readonly transactAmountInput = page.getByTestId("transactAmountInput"), | ||
) {} | ||
|
||
async clickCreateManualTransactionButton() { | ||
await this.createManualTransactionButton.click(); | ||
await this.createManualTransactionButton.waitFor({ state: "hidden" }); | ||
} | ||
|
||
async typeTransactionDescription(description = "partial payment") { | ||
await this.transactionDescriptionInput.fill(description); | ||
} | ||
|
||
async typeTransactionPspReference(reference = "999999999") { | ||
await this.transactionPspReferenceInput.fill(reference); | ||
} | ||
|
||
async typeTransactionAmount(amount = "100") { | ||
await this.transactAmountInput.fill(amount); | ||
} | ||
|
||
async completeManualTransactionDialogAndSave( | ||
description: string, | ||
reference: string, | ||
transactionAmount: string, | ||
) { | ||
await this.typeTransactionDescription(description); | ||
await this.typeTransactionDescription(reference); | ||
await this.typeTransactionAmount(transactionAmount); | ||
await this.clickCreateManualTransactionButton(); | ||
} | ||
} |
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,17 @@ | ||
import type { Page } from "@playwright/test"; | ||
|
||
export class MarkOrderAsPaidDialog { | ||
constructor( | ||
page: Page, | ||
readonly transactionReferenceInput = page | ||
.getByTestId("transaction-reference-input") | ||
.locator("input"), | ||
readonly confirmButton = page.getByTestId("submit"), | ||
) {} | ||
|
||
async typeAndSaveOrderReference(value = "09728937896253") { | ||
await this.transactionReferenceInput.fill(value); | ||
await this.confirmButton.click(); | ||
await this.transactionReferenceInput.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import type { Page } from "@playwright/test"; | ||
|
||
export class FulfillmentPage { | ||
readonly page: Page; | ||
constructor( | ||
page: Page, | ||
readonly fulfillButton = page.getByTestId("button-bar-confirm"), | ||
) { | ||
this.page = page; | ||
} | ||
|
||
async clickFulfillButton() { | ||
await this.fulfillButton.click(); | ||
} | ||
} |
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
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