Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dockerfile and release gitflow #586

Merged
merged 29 commits into from
Dec 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6bd368e
Update Dockerfile and release gitflow
brankologeecom Dec 13, 2024
cda7f99
Revert "Temporary disable e2e tests"
brankologeecom Dec 19, 2024
f7d3797
Revert "Temporary disable e2e tests"
brankologeecom Dec 19, 2024
db01571
Add e2e tests to the same repositories
brankologeecom Dec 19, 2024
f547f46
Add e2e tests to the same repositories
brankologeecom Dec 19, 2024
c26f1e2
Add e2e tests to the same repositories
brankologeecom Dec 19, 2024
963340c
Add e2e tests to the same repositories
brankologeecom Dec 19, 2024
fd159af
Add e2e tests to the same repositories
brankologeecom Dec 19, 2024
21c13fd
Add e2e tests to the same repositories
brankologeecom Dec 19, 2024
9f7d97d
Add e2e tests to the same repositories
brankologeecom Dec 19, 2024
fcdf4f6
Merge pull request #590 from Adyen/develop
teodoratimoti Dec 19, 2024
fe90a64
Fix the condition for executing E2E tests
Dec 23, 2024
05a8219
Fix the test - Payment methods should be updated when the billing add…
Dec 23, 2024
e97aee1
Add adyen logs to artifacts
Dec 23, 2024
78ec329
Add adyen logs to artifacts
Dec 23, 2024
e1f505b
Add adyen logs to artifacts
Dec 23, 2024
93a8a7a
Add adyen logs to artifacts
Dec 23, 2024
967ef21
Fix the issue with failed Klarna payment
Dec 23, 2024
1a3a868
Remove unnecessary step in Klarna Pay Now test case
Dec 24, 2024
0da999f
Run skipped tests
Dec 24, 2024
dc1b19b
Revert ClearPay payment test case to skipped
Dec 24, 2024
af23322
Replace test-report directory and git ignore
Dec 24, 2024
65a8cb6
Add adyen logs to artifacts
Dec 24, 2024
1056e6d
Add e2e tests to the same repositories
brankologeecom Dec 24, 2024
a2df336
Merge remote-tracking branch 'origin/fature/docker-build-on-release' …
brankologeecom Dec 24, 2024
617623e
Merge branch 'develop' into fature/docker-build-on-release
Dec 25, 2024
dc29442
Merge branch 'main' into fature/docker-build-on-release
Dec 25, 2024
2bad985
Version bump 4.2.3
Dec 25, 2024
837ff62
Remove Docker file from release zip
Dec 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ jobs:
timeout-minutes: 20
strategy:
fail-fast: false
# if: ${{ github.actor != 'renovate[bot]' || github.actor != 'lgtm-com[bot]' }}
if: false
if: ${{ github.actor != 'renovate[bot]' && github.actor != 'lgtm-com[bot]' }}
# Prevent bots from initiating E2E pipeline
steps:
- name: Clone Code
Expand All @@ -33,7 +32,8 @@ jobs:
docker exec shopware6 bash -c "sudo mysql -u root -proot shopware -e \"UPDATE sales_channel_domain SET url='https://local.shopware.shop' WHERE url NOT LIKE 'default.%';\""
docker exec shopware6 bash -c \
"sudo mysql -u root -proot shopware -e \"SELECT @RULE_ID := id FROM rule WHERE name = 'All customers'; UPDATE shipping_method SET availability_rule_id = @RULE_ID;\""

docker exec shopware6 bash -c "sudo mysql -u root -proot shopware -e \"UPDATE system_config SET configuration_value='{\"enabled\": false}' WHERE configuration_key='core.basicInformation.cookieConsent';\""

docker network create localnetwork
docker network connect --alias local.shopware.shop localnetwork shopware6

Expand All @@ -56,7 +56,6 @@ jobs:
- name: Run E2E Tests
run: docker compose -f .github/workflows/templates/docker-compose.playwright.yml run --rm playwright /e2e.sh
env:
INTEGRATION_TESTS_BRANCH: develop
SHOPWARE_BASE_URL: ${{secrets.SHOPWARE_BASE_URL}}
PAYPAL_USERNAME: ${{secrets.PLAYWRIGHT_PAYPAL_USERNAME}}
PAYPAL_PASSWORD: ${{secrets.PLAYWRIGHT_PAYPAL_PASSWORD}}
Expand All @@ -67,3 +66,25 @@ jobs:
with:
name: html-report
path: test-report

- name: Copy Adyen api logs from container if available
if: always()
run: |
# Create a local directory for logs
mkdir -p logs

# Check if the log file exists in the container
if docker exec shopware6 test -f /var/www/html/var/log/adyen/api.log; then
echo "Log file exists. Copying..."
docker cp shopware6:/var/www/html/var/log/adyen/api.log logs
else
echo "Log file does not exist. Skipping copy."
fi
shell: bash

- name: Upload Adyen api Logs
if: always()
uses: actions/upload-artifact@v3
with:
name: adyen-api-logs
path: logs/*
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SHOPWARE_BASE_URL=""
PAYPAL_USERNAME=""
PAYPAL_PASSWORD=""
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
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"
}
}
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!");
}
}
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();
}
}
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);
}
}
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);
}
}
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}`);
}
}
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
}
}
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();
}
}
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);
}
}
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();
}
}
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);
}
}
Loading
Loading