Skip to content

Commit 210a4b2

Browse files
jlengrandgcatanese
andauthored
E2E Integration (#26)
* Testing Dockerfile * Files to ignore when building Docker image * Remove unnecessary parameter * Inject REACT env variables, use adyen-testing-suite:v0.0.1 * Inject REACT env variables, use adyen-testing-suite:v0.0.1 Co-authored-by: Beppe Catanese <[email protected]>
1 parent ba82592 commit 210a4b2

File tree

6 files changed

+39
-1
lines changed

6 files changed

+39
-1
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.env
2+
.idea
3+
.github
4+
5+
build
6+
node_modules

.github/workflows/e2e.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: E2E (Playwright)
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
checkout:
11+
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout project
15+
uses: actions/checkout@v2
16+
- name: Build image (application)
17+
run: docker build -t test-image:latest .
18+
- name: Start container (application)
19+
run: docker run --rm -d --name test-image -p 8080:8080 -e REACT_APP_ADYEN_API_KEY="${{ secrets.ADYEN_API_KEY }}" -e REACT_APP_ADYEN_MERCHANT_ACCOUNT=${{ secrets.ADYEN_MERCHANT_ACCOUNT }} -e REACT_APP_ADYEN_CLIENT_KEY=${{ secrets.ADYEN_CLIENT_KEY }} -e REACT_APP_ADYEN_HMAC_KEY=${{ secrets.ADYEN_HMAC_KEY }} test-image:latest
20+
- name: Run testing suite
21+
run: docker run --rm --name adyen-testing-suite --network host ghcr.io/adyen-examples/adyen-testing-suite:v0.0.1
22+
23+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@
2222
npm-debug.log*
2323
yarn-debug.log*
2424
yarn-error.log*
25+
.env.bak

Dockerfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM node:16
2+
3+
COPY . .
4+
5+
RUN npm install
6+
7+
EXPOSE 8080
8+
CMD [ "npm", "run", "server"]

server.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ app.post("/api/sessions", async (req, res) => {
7070
amount: { currency: "EUR", value: 1000 }, // value is 10€ in minor units
7171
reference: orderRef, // required
7272
merchantAccount: process.env.REACT_APP_ADYEN_MERCHANT_ACCOUNT, // required
73-
channel: "Web", // required
7473
returnUrl: `${determineHostUrl(req)}/redirect?orderRef=${orderRef}`, // required for 3ds2 redirect flow
7574
});
7675

startDocker.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
docker run -p8080:8080 online-payments-react-adyen:latest

0 commit comments

Comments
 (0)