Skip to content

Commit

Permalink
Add Gitpod support (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwok-he-Chu authored Feb 27, 2023
1 parent b391ad2 commit 500b9e1
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
tasks:
- name: Gitpod Task
init: |
npm install
npm i -D @playwright/test
npx playwright install-deps
npx playwright install
command: |
echo "Run the test suite using the following command: URL=https://8080-adyenexampl-adyendotnet-1xxxxxxxxxx.ws-eu88.gitpod.io npx playwright test checkout"
echo "The URL refers to the baseUrl of the application you want to test."
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,27 @@ Note: the localhost application will resolve to `http://docker:8080` from inside


```
# run on Mac (i.e. --platform linux/arm64/v8)
# Run on Mac (i.e. --platform linux/arm64/v8)
# NOTE!! Set <host IP address> before executing docker run
docker run -t -i --rm --name adyen-testing-suite -e URL=http://docker:8080 -e PLAYWRIGHT_FOLDERNAME=checkout --add-host=docker:<host IP address> --platform linux/arm64/v8 ghcr.io/adyen-examples/adyen-testing-suite:main
```


## Run in Gitpod

Run the testing-suite in Gitpod by pointing the `baseUrl` of our test configuration to the public URL of the application.

[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/adyen-examples/adyen-testing-suite)

There are two ways to run the tests:

1. Run the following command with the URL set to the public URL of the application.
```
URL=https://8080-adyenexampl-adyendotnet-1xxxxxxxxxx.ws-eu88.gitpod.io npx playwright test checkout
```

2. Modify the `playwright.config.js` file and replace `http://localhost:8080` with the public URL of the application. After modifying the URL, (re)run the command `npx playwright install`, followed by `npx playwright test checkout`.
```
# See 'http://localhost:8080' in playwright.config.js
baseURL: process.env.URL || 'http://localhost:8080'
```
2 changes: 1 addition & 1 deletion tests/checkout/klarna-paynow.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ test('Klarna Pay Now', async ({ page }) => {

// Click "Continue to Klarna"
await page.locator('text="Continue to Pay now with Klarna."').click();
await expect(page).toHaveTitle("Je bestelling afronden");
await expect(page).toHaveTitle("Complete your purchase");
});

0 comments on commit 500b9e1

Please sign in to comment.