|
| 1 | +#Testing with Cypress |
| 2 | + |
| 3 | +As you can see the plugin is bundled with Cypress testing on this repository. You can use the tests, if you have some experience with testing. |
| 4 | + |
| 5 | +***DO NOT USE IN PRODUCTION, THE TESTS MODIFY SETTINGS AND CREATE ORDERS*** |
| 6 | + |
| 7 | +## Requirements |
| 8 | + |
| 9 | +* A framework/shop installation is required, in which you need to have the sample theme installed and products displayed on the homepage. |
| 10 | +* You need to have Paylike module installed and configured (**test keys** required) |
| 11 | +* You need to have some other currencies configured in store, then set them in `cypress.env.json` file (these will be used to make payments with every currency specified) |
| 12 | +* You also need to have an account with previous purchases for which you set the credentials in the `cypress.env.json` file |
| 13 | +* *For testing purpose, product stock management and sending order emails need to be disabled (if applicable).* |
| 14 | + |
| 15 | +## Getting started |
| 16 | + |
| 17 | +1. Run following commands into plugin folder (as in this repo) |
| 18 | + |
| 19 | + ```bash |
| 20 | + npm install cypress --save-dev |
| 21 | + ``` |
| 22 | + |
| 23 | +2. Copy and rename `cypress.env.json.example` file in the root folder and fill the data as explained bellow: |
| 24 | +```json |
| 25 | +{ |
| 26 | + "ENV_HTTP_AUTH_ENABLED": false, // 'true' if you have HTTP auth when accessing website |
| 27 | + "ENV_HTTP_USER": "", // if you have HTTP auth when accessing website |
| 28 | + "ENV_HTTP_PASS": "", |
| 29 | + "ENV_ADMIN_URL": "", // like http(s)://baseUrl/administrator |
| 30 | + "ENV_PHOENIX_ADMIN_URL": "", |
| 31 | + "ENV_CLIENT_USER": "", // frontend user |
| 32 | + "ENV_CLIENT_PASS": "", |
| 33 | + "ENV_ADMIN_USER": "", // admin user |
| 34 | + "ENV_ADMIN_PASS": "", |
| 35 | + "REMOTE_LOG_URL": "", // if you want to send log information about framework/shop & paylike module versions |
| 36 | + "ENV_CURRENCY_TO_CHANGE_WITH": "USD", |
| 37 | + "ENV_CURRENCIES_TO_TEST": ["USD", "EUR"], // currencies used to make payments with in Full test |
| 38 | + "ENV_CARD_NUMBER": 4100000000000000, |
| 39 | + "ENV_CARD_EXPIRY": 1226, |
| 40 | + "ENV_CARD_CVV": 654 |
| 41 | +} |
| 42 | +``` |
| 43 | +
|
| 44 | +3. Start the Cypress testing server. |
| 45 | + ```bash |
| 46 | + npx cypress open |
| 47 | + ``` |
| 48 | +4. In the interface, we can choose which test to run |
| 49 | +
|
| 50 | +## Getting Problems? |
| 51 | +
|
| 52 | +Since this is a frontend test, its not always consistent, due to delays or some glitches regarding overlapping elements. If you can't get over an issue please open an issue and we'll take a look. |
0 commit comments