-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #598 from Adyen/develop-3
Release version 3.17.4
- Loading branch information
Showing
55 changed files
with
2,557 additions
and
22 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
3 changes: 3 additions & 0 deletions
3
.github/workflows/e2e/adyen-integration-tools-tests/.env_example_shopware
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,3 @@ | ||
SHOPWARE_BASE_URL="" | ||
PAYPAL_USERNAME="" | ||
PAYPAL_PASSWORD="" |
7 changes: 7 additions & 0 deletions
7
.github/workflows/e2e/adyen-integration-tools-tests/.gitignore
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,7 @@ | ||
node_modules/ | ||
playwright-report/ | ||
test-results.json | ||
test-report/ | ||
.DS_Store | ||
.idea | ||
.env |
23 changes: 23 additions & 0 deletions
23
.github/workflows/e2e/adyen-integration-tools-tests/package.json
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,23 @@ | ||
{ | ||
"name": "pluginstest", | ||
"version": "1.0.0", | ||
"description": "", | ||
"main": "index.js", | ||
"type": "module", | ||
"scripts": { | ||
"test:ci:shopware": "npx playwright test --config=projects/shopware/shopwareCIContainer.config.cjs", | ||
"test:adyenlocal:shopware": "npx playwright test --workers=1 --headed --project=chromium --config=projects/shopware/shopware.config.cjs", | ||
"test:adyenlocal:shopware:headless": "npx playwright test --workers=1 --project=chromium --config=projects/shopware/shopware.config.cjs", | ||
"test:adyenlocal:shopware:parallel": "npx playwright test --headed --project=chromium --config=projects/shopware/shopware.config.cjs", | ||
"test:adyenlocal:shopware:headless:parallel": "npx playwright test --project=chromium --config=projects/shopware/shopware.config.cjs" | ||
}, | ||
"keywords": [], | ||
"author": "", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"@playwright/test": "^1.42.1" | ||
}, | ||
"dependencies": { | ||
"dotenv": "^16.3.1" | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
...adyen-integration-tools-tests/projects/common/checkoutComponents/AdyenGivingComponents.js
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,58 @@ | ||
import { expect } from "@playwright/test"; | ||
export class AdyenGivingComponents { | ||
constructor(page) { | ||
this.page = page; | ||
|
||
this.adyenGivingContainer = page.locator(".adyen-checkout__adyen-giving"); | ||
this.adyenGivingActionsContainer = this.adyenGivingContainer.locator( | ||
".adyen-checkout__adyen-giving-actions" | ||
); | ||
this.actionButtonsContainer = this.adyenGivingActionsContainer.locator( | ||
".adyen-checkout__amounts" | ||
); | ||
|
||
this.leastAmountButton = this.actionButtonsContainer | ||
.locator(".adyen-checkout__button") | ||
.nth(0); | ||
this.midAmountButton = this.actionButtonsContainer | ||
.locator(".adyen-checkout__button") | ||
.nth(1); | ||
this.mostAmountButton = this.actionButtonsContainer | ||
.locator(".adyen-checkout__button") | ||
.nth(2); | ||
|
||
this.donateButton = this.adyenGivingActionsContainer.locator( | ||
".adyen-checkout__button--donate" | ||
); | ||
this.declinelButton = this.adyenGivingActionsContainer.locator( | ||
".adyen-checkout__button--decline" | ||
); | ||
|
||
this.DonationMessage = this.adyenGivingContainer.locator( | ||
".adyen-checkout__status__text" | ||
); | ||
} | ||
|
||
async makeDonation(amount = "least") { | ||
switch (amount) { | ||
case "least": | ||
await this.leastAmountButton.click(); | ||
break; | ||
case "mid": | ||
await this.midAmountButton.click(); | ||
break; | ||
case "most": | ||
await this.mostAmountButton.click(); | ||
break; | ||
} | ||
await this.donateButton.click(); | ||
} | ||
|
||
async declineDonation() { | ||
await this.declinelButton.click(); | ||
} | ||
|
||
async verifySuccessfulDonationMessage() { | ||
await expect(this.DonationMessage).toHaveText("Thanks for your support!"); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...e/adyen-integration-tools-tests/projects/common/checkoutComponents/AmazonPayComponents.js
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,13 @@ | ||
export class AmazonPayComponents { | ||
constructor(page) { | ||
this.page = page; | ||
|
||
this.amazonPayContainer = page.locator("#amazonpayContainer"); | ||
this.amazonPayButton = this.amazonPayContainer.getByLabel('Amazon Pay - Use your Amazon Pay Sandbox test account'); | ||
|
||
} | ||
|
||
async clickAmazonPayButton() { | ||
await this.amazonPayButton.click(); | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
...en-integration-tools-tests/projects/common/checkoutComponents/BancontactCardComponents.js
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,42 @@ | ||
export class BancontactCardComponents { | ||
constructor(page) { | ||
this.page = page; | ||
|
||
this.cardNumberInput = page | ||
.frameLocator( | ||
".adyen-checkout__card__cardNumber__input iframe" | ||
) | ||
.locator(".input-field"); | ||
|
||
this.expDateInput = page | ||
.frameLocator( | ||
".adyen-checkout__card__exp-date__input iframe" | ||
) | ||
.locator(".input-field"); | ||
|
||
this.holderNameInput = page.locator( | ||
"input.adyen-checkout__card__holderName__input" | ||
); | ||
} | ||
|
||
async fillHolderName(holderName) { | ||
await this.holderNameInput.click(); | ||
await this.holderNameInput.fill(holderName); | ||
} | ||
async fillCardNumber(cardNumber) { | ||
await this.cardNumberInput.click(); | ||
await this.cardNumberInput.fill(cardNumber); | ||
} | ||
async fillExpDate(expDate) { | ||
await this.expDateInput.click(); | ||
await this.expDateInput.fill(expDate); | ||
} | ||
|
||
async fillBancontacCardInfo( | ||
cardNumber, | ||
cardExpirationDate, | ||
) { | ||
await this.fillCardNumber(cardNumber); | ||
await this.fillExpDate(cardExpirationDate); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
.../e2e/adyen-integration-tools-tests/projects/common/checkoutComponents/BoletoComponents.js
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 @@ | ||
export class BoletoComponents { | ||
constructor(page) { | ||
this.page = page; | ||
|
||
this.socialSecurityNumberInput = page.locator( | ||
"#adyen_boleto_social_security_number" | ||
); | ||
this.firstNameInput = page.locator("#adyen_boleto_firstname"); | ||
this.lastNameInput = page.locator("#adyen_boleto_lastname"); | ||
} | ||
|
||
async fillBoletoDetails(socialSecurityNumber, firstName, lastName) { | ||
await this.socialSecurityNumberInput.fill(socialSecurityNumber); | ||
await this.firstNameInput.fill(firstName); | ||
await this.lastNameInput.fill(lastName); | ||
} | ||
} |
60 changes: 60 additions & 0 deletions
60
.../adyen-integration-tools-tests/projects/common/checkoutComponents/CreditCardComponents.js
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,60 @@ | ||
export class CreditCardComponents { | ||
constructor(page) { | ||
this.page = page; | ||
|
||
this.holderNameInput = page.locator( | ||
".adyen-checkout__card__holderName input" | ||
); | ||
|
||
this.cardNumberInput = page | ||
.frameLocator(".adyen-checkout__card__cardNumber__input iframe") | ||
.locator(".input-field"); | ||
|
||
this.expDateInput = page | ||
.frameLocator(".adyen-checkout__card__exp-date__input iframe") | ||
.locator(".input-field"); | ||
|
||
this.cvcInput = page | ||
.frameLocator(".adyen-checkout__card__cvc__input iframe") | ||
.locator(".input-field"); | ||
|
||
this.typeDelay = 50; | ||
} | ||
|
||
async fillHolderName(holderName) { | ||
await this.holderNameInput.scrollIntoViewIfNeeded(); | ||
await this.holderNameInput.click(); | ||
await this.holderNameInput.type(holderName); | ||
} | ||
async fillCardNumber(cardNumber) { | ||
await this.cardNumberInput.scrollIntoViewIfNeeded(); | ||
await this.cardNumberInput.click(); | ||
await this.cardNumberInput.type(cardNumber, { delay: this.typeDelay }); | ||
} | ||
async fillExpDate(expDate) { | ||
await this.expDateInput.scrollIntoViewIfNeeded(); | ||
await this.expDateInput.click(); | ||
await this.expDateInput.type(expDate, { delay: this.typeDelay }); | ||
} | ||
async fillCVC(CVC) { | ||
await this.cvcInput.scrollIntoViewIfNeeded(); | ||
await this.cvcInput.click(); | ||
await this.cvcInput.type(CVC, { delay: this.typeDelay }); | ||
} | ||
|
||
async fillCreditCardInfo( | ||
cardHolderName, | ||
cardHolderLastName, | ||
cardNumber, | ||
cardExpirationDate, | ||
cardCVC = undefined | ||
) { | ||
await this.fillCardNumber(cardNumber); | ||
await this.fillExpDate(cardExpirationDate); | ||
if (cardCVC !== undefined ) { | ||
await this.fillCVC(cardCVC); | ||
} | ||
await this.fillHolderName(cardHolderName); | ||
await this.fillHolderName(` ${cardHolderLastName}`); | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...2e/adyen-integration-tools-tests/projects/common/checkoutComponents/GiftcardComponents.js
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,5 @@ | ||
export class GiftcardComponents { | ||
constructor(page) { | ||
// Abstract implementation is being extended in GiftcardComponentsMagento.js | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
...s/e2e/adyen-integration-tools-tests/projects/common/checkoutComponents/IDealComponents.js
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,25 @@ | ||
export class IDealComponents { | ||
constructor(page) { | ||
this.page = page; | ||
|
||
this.iDealDropDown = page.locator( | ||
"#payment_form_adyen_hpp_ideal .adyen-checkout__dropdown__button" | ||
); | ||
} | ||
|
||
iDealDropDownSelectorGenerator(issuerName) { | ||
return this.page.locator( | ||
`#payment_form_adyen_hpp_ideal .adyen-checkout__dropdown__list li [alt='${issuerName}']` | ||
); | ||
} | ||
|
||
async selectIdealIssuer(issuerName) { | ||
await this.iDealDropDown.click(); | ||
await this.iDealDropDownSelectorGenerator(issuerName).click(); | ||
} | ||
|
||
async selectRefusedIdealIssuer() { | ||
await this.iDealDropDown.click(); | ||
await this.iDealDropDownSelectorGenerator("Test Issuer Refused").click(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...ws/e2e/adyen-integration-tools-tests/projects/common/checkoutComponents/OneyComponents.js
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,22 @@ | ||
export class OneyComponents { | ||
constructor(page) { | ||
this.activePaymentMethodSection = page; | ||
|
||
this.maleGenderRadioButton = this.activePaymentMethodSection | ||
.locator(".adyen-checkout__radio_group__input-wrapper") | ||
.nth(0); | ||
this.birthdayInput = this.activePaymentMethodSection.locator( | ||
".adyen-checkout__input--dateOfBirth" | ||
); | ||
this.telephoneNumberInput = this.activePaymentMethodSection.locator( | ||
".adyen-checkout__input--telephoneNumber"); | ||
} | ||
|
||
async completeOneyForm(user) { | ||
await this.maleGenderRadioButton.click(); | ||
await this.birthdayInput.type(user.dateOfBirth); | ||
|
||
await this.telephoneNumberInput.fill(""); | ||
await this.telephoneNumberInput.type(user.phoneNumber); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
.../e2e/adyen-integration-tools-tests/projects/common/checkoutComponents/PayPalComponents.js
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 @@ | ||
export class PayPalComponents { | ||
constructor(page) { | ||
this.page = page; | ||
|
||
this.payPalButton = page | ||
.frameLocator("iframe[title='PayPal']").last() | ||
.locator(".paypal-button").first(); | ||
} | ||
|
||
async proceedToPayPal() { | ||
// The iframe which contains PayPal button may require extra time to load | ||
await new Promise(r => setTimeout(r, 500)); | ||
await this.payPalButton.scrollIntoViewIfNeeded(); | ||
await this.payPalButton.hover(); | ||
await this.payPalButton.click(); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
...n-integration-tools-tests/projects/common/checkoutComponents/SepaDirectDebitComponents.js
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,20 @@ | ||
export class SepaDirectDebitComponents { | ||
constructor(page) { | ||
this.page = page; | ||
|
||
this.accountHolderNameInput = this.page.locator( | ||
"input[name='ownerName']" | ||
); | ||
this.accountNumberInput = this.page.locator( | ||
"input[name='ibanNumber']" | ||
); | ||
} | ||
|
||
async fillSepaDirectDebitInfo(accountHolderName, accountNumber) { | ||
await this.accountHolderNameInput.click(); | ||
await this.accountHolderNameInput.fill(accountHolderName); | ||
|
||
await this.accountNumberInput.click(); | ||
await this.accountNumberInput.fill(accountNumber); | ||
} | ||
} |
Oops, something went wrong.