-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from ionutcalara/update-tests
Update tests
- Loading branch information
Showing
17 changed files
with
65 additions
and
3,273 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,60 @@ | ||
#Testing | ||
#Testing with Cypress | ||
|
||
As you can see the plugin is bundled with selenium testing on this repository. You can use the tests, if you have some experience with testing it could be helpful. | ||
*DO NOT USE IN PRODUCTION, THE TESTS MODIFY SETTINGS AND CREATE ORDERS* | ||
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. | ||
|
||
***DO NOT USE IN PRODUCTION, THE TESTS MODIFY SETTINGS AND CREATE ORDERS*** | ||
|
||
## Requirements | ||
|
||
* A hikashop installation is required, in which you need to have the sample theme installed and products displayed on the homepage. | ||
* You also need to have a test client account with previous purchases and an admin account for which you set the credentials in the .env file | ||
* Lastly you need to have the currency selector available on the frontend and the cart module | ||
* You need to have Paylike module installed and configured (**test keys** required) | ||
* 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) | ||
* You also need to have a test client account with previous purchases and an admin account for which you set the credentials in the `cypress.env.json` file | ||
* Lastly you need to have the some modules available on frontend | ||
- login form | ||
- hikashop currency switcher | ||
- hikashop cart | ||
|
||
## Getting started | ||
|
||
1. Follow 1 and 2 from the [Steward readme page](https://github.com/lmc-eu/steward#getting-started) | ||
2. Create an env file in the root folder and add the following: | ||
` | ||
ENVIRONMENT_URL="http://joomla.box/hikashop" | ||
ADMIN_PREFIX="administrator" | ||
ENVIRONMENT_CLIENT_USER = client | ||
ENVIRONMENT_CLIENT_PASS = "admin#522" | ||
ENVIRONMENT_USER = "admin" | ||
ENVIRONMENT_PASS = "admin" | ||
` | ||
|
||
3. Start the testing server. See | ||
[Steward readme page](https://github.com/lmc-eu/steward#4-run-your-tests) | ||
4. Run ./vendor/bin/steward run staging chrome --group="hikashop_quick_test" -vv for the short test | ||
5. Run ./vendor/bin/steward run staging chrome -vv to go trough all the available tests. | ||
|
||
## Problems | ||
|
||
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 I'll take a look. | ||
1. Run following commands into hikashop plugin folder (as is in this repo) | ||
|
||
```bash | ||
npm install cypress --save-dev | ||
``` | ||
|
||
2. Copy and rename `cypress.env.json.example` file in the root folder and fill the data as explained bellow: | ||
```json | ||
{ | ||
"ENV_HTTP_AUTH_ENABLED": false, // if you have HTTP auth when accessing website | ||
"ENV_HTTP_USER": "", // if you have HTTP auth when accessing website | ||
"ENV_HTTP_PASS": "", | ||
"ENV_COOKIE_HASH": "", // name of the cookie (in Joomla it is a hash - it changes after each Joomla/Hikashop setup) | ||
"ENV_STORE_URL": "", // http(s)://baseUrl | ||
"ENV_ADMIN_URL": "", // like http(s)://baseUrl/administrator | ||
"ENV_CLIENT_USER": "", // frontend user | ||
"ENV_CLIENT_PASS": "", | ||
"ENV_ADMIN_USER": "", // admin user | ||
"ENV_ADMIN_PASS": "", | ||
"REMOTE_LOG_URL": "", // if you want to send log information about hikashop/paylike versions | ||
"ENV_CURRENCY_TO_CHANGE_WITH": "USD", | ||
"ENV_CURRENCIES_TO_TEST": ["USD", "EUR"], // currencies used to make payments with in Full test | ||
"ENV_CAPTURE_MODE": "Delayed", // Instant/Delayed (write with capital first letter ) | ||
"ENV_STOP_EMAIL": false, // if true => deactivate sending email on order creation / status change | ||
"ENV_LOG_VERSION": false, // if true => send hikashop / paylike modules versions remotely | ||
"ENV_SETTINGS_CHECK": false, // if true => change paylike capture mode as is specified in ENV_CAPTURE_MODE variable | ||
"ENV_CARD_NUMBER": 4100000000000000, | ||
"ENV_CARD_EXPIRY": 1226, | ||
"ENV_CARD_CVV": 654 | ||
} | ||
``` | ||
3. Start the Cypress testing server. | ||
```bash | ||
npx cypress open | ||
``` | ||
4. In the interface, we can choose which test to run | ||
## Getting Problems? | ||
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. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.