-
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 genuineq/master
!! Upgraded js SDK version to 10.js + fix configure order status after payment + Migrate tests to Cypress
- Loading branch information
Showing
46 changed files
with
4,984 additions
and
5,490 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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# to use orbs, must use version >= 2.1 | ||
version: 2.1 | ||
orbs: | ||
# import Cypress orb by specifying an exact version x.y.z | ||
# or the latest version 1.x.x using "@1" syntax | ||
cypress: cypress-io/cypress@1 | ||
workflows: | ||
build: | ||
jobs: | ||
# "cypress" is the name of the imported orb | ||
# "run" is the name of the job defined in Cypress orb | ||
- cypress/run: | ||
name: Run_QUICK_tests | ||
context: | ||
- paylike | ||
spec: cypress/integration/quick_test.js | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
- cypress/run: | ||
name: Run_FULL_tests | ||
requires: | ||
- Run_QUICK_tests | ||
context: | ||
- paylike | ||
spec: cypress/integration/full_test.js | ||
filters: | ||
branches: | ||
only: | ||
- master | ||
# the following must run after all test passed | ||
# to show latest supported version in repository readme.md file | ||
- cypress/run: | ||
name: Run_LOG_VERSION_remotely | ||
requires: | ||
- Run_FULL_tests | ||
context: | ||
- paylike | ||
spec: cypress/integration/log_version.js | ||
filters: | ||
branches: | ||
only: | ||
- master |
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 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 |
---|---|---|
|
@@ -30,4 +30,6 @@ php_version: | |
- 5.6 | ||
- 7.0 | ||
- 7.1 | ||
- 7.2 | ||
- 7.2 | ||
- 7.3 | ||
- 7.4 |
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 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,51 @@ | ||
#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 thirtybees installation is required, in which you need to have the sample theme installed. | ||
* 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 | ||
* A framework/shop installation is required, in which you need to have the sample theme installed and products displayed on the homepage. | ||
* 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 | ||
* *For testing purpose, product stock management and sending order emails need to be disabled.* | ||
|
||
## 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="https://thirtybees.url" | ||
ENVIRONMENT_USER="username" | ||
ENVIRONMENT_PASS="yourpassword" | ||
ENVIRONMENT_CLIENT_USER="client_email" | ||
ENVIRONMENT_CLIENT_PASS="client_pass" | ||
ADMIN_PREFIX="admin251j3cm2b" | ||
` | ||
|
||
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="thirtybees_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 plugin folder (as 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, // 'true' if you have HTTP auth when accessing website | ||
"ENV_HTTP_USER": "", // if you have HTTP auth when accessing website | ||
"ENV_HTTP_PASS": "", | ||
"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 framework/shop & paylike module versions | ||
"ENV_CURRENCY_TO_CHANGE_WITH": "USD", | ||
"ENV_CURRENCIES_TO_TEST": ["USD", "EUR"], // currencies used to make payments with in Full test | ||
"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.
Oops, something went wrong.