Skip to content

Commit

Permalink
Merge pull request #53 from Adyen/release/2.3.0
Browse files Browse the repository at this point in the history
Release/2.3.0
  • Loading branch information
dcardos authored Aug 1, 2024
2 parents c35ad14 + 4d9ed51 commit 0779f44
Show file tree
Hide file tree
Showing 37 changed files with 805 additions and 97 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @amihajlovski @dcardos @shanikantsingh @shubhamvijaivargiya @zenit2001
* @amihajlovski @dcardos @shanikantsingh @shubhamvijaivargiya @zenit2001 @shubhamk67
99 changes: 99 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
name: Salesforce b2b e2e test

on:
pull_request:
branches:
- '**'
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: ubuntu-latest

env:
B2B_E2E_AUTH_URL: ${{ secrets.B2B_E2E_AUTH_URL }}

steps:
- name: Checkout This Repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install Salesforce CLI
run: npm install @salesforce/cli --global

- name: Create authentication file from secret
run: echo ${B2B_E2E_AUTH_URL} > secret.json

- name: Authenticate to E2E org
run: sf org login sfdx-url -f secret.json --set-default --alias e2eOrg

- name: Checkout Apex-Library Repository
uses: actions/checkout@v4
with:
repository: Adyen/adyen-apex-api-library
ref: develop
path: dependency-repo

- name: Push Apex Lib Source to the Org
run: |
cd dependency-repo
sf project deploy start --target-org e2eOrg
- name: Checkout This Repository Back
uses: actions/checkout@v4

- name: Install xmlstarlet
run: sudo apt-get install -y xmlstarlet

- name: Update customMetadata XML
run: |
chmod +x ./scripts/updateCustomMetadata.sh
./scripts/updateCustomMetadata.sh
env:
MERCHANT_ACCOUNT: ${{ secrets.B2B_E2E_MERCHANT_ACCOUNT }}
CLIENT_KEY: ${{ secrets.B2B_E2E_CLIENT_KEY }}
HMAC_KEY: ${{ secrets.B2B_E2E_HMAC_KEY }}

- name: Deploy This Repository Code and run unit tests
run: sf project deploy start --target-org e2eOrg --test-level RunLocalTests --ignore-conflicts

e2e-testing:
runs-on: ubuntu-latest
needs: build-and-deploy

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: lts/*

- name: Install dependencies
working-directory: ./e2e
run: npm ci

- name: Install Playwright dependencies
working-directory: ./e2e
run: npx playwright install --with-deps

- name: Run Playwright tests
working-directory: ./e2e
run: npx playwright test
env:
STORE_BASE_URL: ${{ secrets.STORE_BASE_URL }}
STORE_ID: ${{ secrets.STORE_ID }}
STORE_USERNAME: ${{ secrets.STORE_USERNAME }}
STORE_PASSWORD: ${{ secrets.STORE_PASSWORD }}

- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
4 changes: 2 additions & 2 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: sf org login sfdx-url -f secret.json --set-default-dev-hub

- name: Create Scratch Org
run: sf org create scratch -f config/project-scratch-def.json --set-default --alias ScratchOrg --no-namespace -y 1
run: sf org create scratch -f config/project-scratch-def.json --set-default --alias ScratchOrg -y 1

- name: Checkout Apex-Library Repository
uses: actions/checkout@v4
Expand All @@ -53,7 +53,7 @@ jobs:
run: sf project deploy start --target-org ScratchOrg --ignore-conflicts

- name: Run Apex tests
run: sf apex run test --target-org ScratchOrg --code-coverage -w 5
run: sf apex run test --target-org ScratchOrg --synchronous --code-coverage

- name: Delete Scratch Org
if: always()
Expand Down
2 changes: 1 addition & 1 deletion config/project-scratch-def.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"orgName": "Adyen",
"edition": "Developer",
"features": ["MultiCurrency", "Communities", "B2BCommerce", "EnableSetPasswordInApi"],
"features": ["MultiCurrency", "Communities", "B2BCommerce", "EnableSetPasswordInApi", "OrderSaveBehaviorBoth"],
"settings": {
"lightningExperienceSettings": {
"enableS1DesktopEnabled": true
Expand Down
4 changes: 4 additions & 0 deletions e2e/.env_example
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
STORE_BASE_URL = ""
STORE_ID = ""
STORE_USERNAME = ""
STORE_PASSWORD = ""
6 changes: 6 additions & 0 deletions e2e/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
.env
12 changes: 12 additions & 0 deletions e2e/data/PaymentResources.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export const masterCard3DS2 = "5454545454545454";
export const visa = "4111111111111111";
export const amex = "371449635398431";

export const wrongExpDate = "1130";
export const expDate = "0330";
export const cvc = "737";
export const amexCvc = "7373";

export const threeDSCorrectUser = "user";
export const threeDSCorrectPassword = "password";
export const threeDSWrongPassword = "wrong answer";
68 changes: 68 additions & 0 deletions e2e/local.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { defineConfig, devices } from '@playwright/test';
import dotenv from "dotenv";

/**
* Read environment variables from file.
* https://github.com/motdotla/dotenv
*/
dotenv.config();

/**
* @see https://playwright.dev/docs/test-configuration
*/
module.exports = defineConfig({
testDir: "./tests",
/* Run tests in files in parallel */
fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI,
/* Retry on CI only */
retries: 0,
/* Opt out of parallel tests on CI. */
workers: 1,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "list",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: process.env.STORE_BASE_URL,

/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
trace: "on",
},

/* Configure projects for major browsers */
projects: [
{
name: "chromium",
use: { ...devices["Desktop Chrome"] },
},

/* Test against mobile viewports. */
// {
// name: 'Mobile Chrome',
// use: { ...devices['Pixel 5'] },
// },
// {
// name: 'Mobile Safari',
// use: { ...devices['iPhone 12'] },
// },

/* Test against branded browsers. */
// {
// name: 'Microsoft Edge',
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
// },
// {
// name: 'Google Chrome',
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
// },
],

/* Run your local dev server before starting the tests */
// webServer: {
// command: 'npm run start',
// url: 'http://127.0.0.1:3000',
// reuseExistingServer: !process.env.CI,
// },
});
105 changes: 105 additions & 0 deletions e2e/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions e2e/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "adyen_salesforce_b2b_e2e_tests",
"version": "1.0.0",
"description": "e2e tests for Adyen Salesforce B2B Lightning",
"main": "index.js",
"scripts": {},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@playwright/test": "^1.44.1"
},
"dependencies": {
"dotenv": "^16.4.5"
}
}
Loading

0 comments on commit 0779f44

Please sign in to comment.