Skip to content

Commit

Permalink
Add .env (#99)
Browse files Browse the repository at this point in the history
* Add .env in ignore file and .env-example to have more clear env reqierments

* Update README

* Update .env_example
  • Loading branch information
hossam-adyen authored Dec 12, 2023
1 parent 2c2a70e commit c976adf
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 15 deletions.
13 changes: 13 additions & 0 deletions .env_example
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
MAGENTO_BASE_URL=""
MAGENTO_ADMIN_USERNAME=""
MAGENTO_ADMIN_PASSWORD=""
PAYPAL_USERNAME=""
PAYPAL_PASSWORD=""
ADYEN_MERCHANT=""
ADYEN_CLIENT_KEY=""
ADYEN_API_KEY=""
WEBHOOK_USERNAME=""
WEBHOOK_PASSWORD=""
GOOGLE_USERNAME=""
GOOGLE_PASSWORD=""
PWDEBUG=0
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ playwright-report/
test-results.json
test-report/
.DS_Store
.idea
.idea
.env
20 changes: 20 additions & 0 deletions package-lock.json

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

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test:ci:magento:all": "npx playwright test --config=projects/magento/magentoCIContainer.config.cjs",
"test:ci:magento": "npx playwright test --config=projects/magento/magentoCIContainer.config.cjs --project='backoffice' --project='user'",
"test:ci:magento:express-checkout": "npx playwright test --config=projects/magento/magentoCIContainer.config.cjs --project='express-checkout'",
"test:adyenlocal:magento": "npx playwright test --workers=1 --headed --project=chromium --config=projects/magento/magento.config.cjs",
"test:adyenlocal:magento": "npx playwright test --workers=1 --headed --project='backoffice' --project='user' --config=projects/magento/magento.config.cjs",
"test:adyenlocal:magento:headless": "npx playwright test --workers=1 --project=chromium --config=projects/magento/magento.config.cjs",
"test:adyenlocal:magento:parallel": "npx playwright test --headed --project=chromium --config=projects/magento/magento.config.cjs",
"test:adyenlocal:magento:headless:parallel": "npx playwright test --project=chromium --config=projects/magento/magento.config.cjs",
Expand All @@ -23,5 +23,8 @@
"license": "MIT",
"devDependencies": {
"@playwright/test": "^1.38.0"
},
"dependencies": {
"dotenv": "^16.3.1"
}
}
3 changes: 2 additions & 1 deletion projects/magento/magento.config.cjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// @ts-check
const { devices } = require("@playwright/test");

const dotenv = require('dotenv');
const VIEWPORT_WIDTH = 1600;
const VIEWPORT_HEIGHT = 900;

dotenv.config();
/**
* @see https://playwright.dev/docs/test-configuration
* @type {import('@playwright/test').PlaywrightTestConfig}
Expand Down
34 changes: 22 additions & 12 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,33 @@ This will run the `CreditCardPayment.spec.js` test only with **one worker** in a

Check `package.json` to see all available scripts.

```bash
npm run test:adyenlocal:magento
```
* Runs all Magento tests on headed Chrome browser with a single worker.

Runs all Magento tests on headed Chrome browser with a single worker.
```bash
npm run test:adyenlocal:magento
```

**Optional step:**

You can add your local environment from `.env` file, just copy it from `.env_example` and fill it with your secrets

```bash
npm run test:adyenlocal:magento:headless
```
```
cp .env_example .env
## Fill .env with your prefered env values
```

Runs all Magento tests on headless Chrome browser with a single worker.

```bash
npm run test:adyenlocal:magento:parallel
```
* Runs all Magento tests on headless Chrome browser with a single worker.

```bash
npm run test:adyenlocal:magento:headless
```

Runs all Magento tests on headed Chrome browser parallelly with multiple workers.
* Runs all Magento tests on headed Chrome browser parallelly with multiple workers.

```bash
npm run test:adyenlocal:magento:parallel
```

## Contributing

Expand Down

0 comments on commit c976adf

Please sign in to comment.