|
1 | 1 | # Welcome to the example of Codeception + Robo + Allure!
|
| 2 | + |
2 | 3 | ### Prerequisites
|
3 | 4 | * **Codeception**, **Allure** and **Robo** are PHP based applications installed via **Composer**, so you will need to have **Composer** installed in order to run the following. Please visit the [Composer](https://getcomposer.org/) homepage for installation instructions.
|
4 | 5 | * Some settings need to be adjusted to meet the build environment settings in the appropriate `XXX.suite.yml` file in the `[PROJECT_ROOT]/tests/` directory: `[PROJECT_ROOT]/tests/XXXXXXX.suite.yml`
|
5 |
| -### Configuration |
6 |
| -* Create .env file by copying existing .env.example file at project root directory. |
7 | 6 |
|
| 7 | +### Installation |
| 8 | +* Open a Terminal Window. CD to the Project Directory. Run the following command to install the project dependencies: |
| 9 | + ``` |
| 10 | + cd [LOCATION_OF_GITHUB_REPO] |
| 11 | + composer install |
| 12 | + ``` |
| 13 | +
|
| 14 | +### Configuration |
| 15 | +* In order to adjust the settings for the Framework you will need to copy the `.dist.` settings files and make your adjustments based on your unique Setup. These files are listed in the `.gitignore` file so they will only effect your Setup. You can run the following Robo command to copy the necassary files or follow the [Optional] instructions listed below. |
8 | 16 | ```
|
9 |
| - cp .env.example .env |
| 17 | + robo clone:files |
10 | 18 | ```
|
11 |
| -* Configure the following environment variables according to Magento application being tested. |
| 19 | +
|
| 20 | +* Configure the following `.env` variables according to the Magento application being tested. |
12 | 21 | ```
|
13 | 22 | MAGENTO_BASE_URL=http://magento.loc/index.php
|
14 | 23 |
|
|
20 | 29 | DB_USERNAME=''
|
21 | 30 | DB_PASSWORD=''
|
22 | 31 | ```
|
23 |
| -* **[Optional]** If you wish to customize entire test suite locally, you can create codeception.yml by copying existing codeception.dist.yml, and make change in codeception.yml. |
24 |
| - ``` |
25 |
| - cp codeception.dist.yml codeception.yml |
26 |
| - ``` |
27 |
| -* **[Optional]** If you wish to customize acceptance test suite locally, you can create acceptance.suite.yml by copying existing acceptance.suite.dist.yml, and make change in acceptance.suite.yml. |
28 |
| - ``` |
29 |
| - cp acceptance.suite.dist.yml acceptance.suite.yml |
30 |
| - ``` |
| 32 | +
|
| 33 | + * **[Optional]** Create .env file by copying existing .env.example file at project root directory. |
| 34 | +
|
| 35 | + ``` |
| 36 | + cp .env.example .env |
| 37 | + ``` |
| 38 | +
|
| 39 | + * **[Optional]** If you wish to customize entire test suite locally, you can create codeception.yml by copying existing codeception.dist.yml, and make change in codeception.yml. |
| 40 | + ``` |
| 41 | + cp codeception.dist.yml codeception.yml |
| 42 | + ``` |
| 43 | +
|
| 44 | + * **[Optional]** If you wish to customize acceptance test suite locally, you can create acceptance.suite.yml by copying existing acceptance.suite.dist.yml, and make change in acceptance.suite.yml. |
| 45 | + ``` |
| 46 | + cp acceptance.suite.dist.yml acceptance.suite.yml |
| 47 | + ``` |
| 48 | +
|
31 | 49 | ### Running the Tests
|
32 |
| -* Open a Terminal Window. CD to the Project Directory. Run the following command to install the project dependencies: |
33 |
| - ``` |
34 |
| - cd [LOCATION_OF_GITHUB_REPO] |
35 |
| - composer install |
36 |
| - ``` |
37 | 50 | * Build the project:
|
38 | 51 | ```
|
39 | 52 | vendor/bin/codecept build
|
40 | 53 | ```
|
| 54 | +
|
41 | 55 | * **You will need to install Allure's CLI tool to generate the reports, please visit this page for instructions**: http://wiki.qatools.ru/display/AL/Allure+Commandline.
|
42 | 56 |
|
43 | 57 | * Next you will need to start a Selenium server so we can run the tests (This will vary based on your local setup).
|
|
49 | 63 | ```
|
50 | 64 | robo test
|
51 | 65 | ```
|
| 66 | +
|
52 | 67 | * To kick off some example tests with 2 test cases run the following command:
|
53 | 68 |
|
54 | 69 | ```
|
55 | 70 | robo example
|
56 | 71 | ```
|
| 72 | +
|
57 | 73 | ### Testing using Robo
|
58 | 74 |
|
59 | 75 | * You can run the following test suites using robo:
|
|
69 | 85 | * Generate a report and open it: `robo allure:report`
|
70 | 86 |
|
71 | 87 | ### Testing Environments
|
72 |
| -
|
73 | 88 | * You can run a subset of Tests by editing a command in the file `RoboFile.php` or by running `codecept` directly:
|
74 | 89 |
|
75 | 90 | ```codecept run --env chrome```
|
|
79 | 94 | ```codecept run --env phantomjs```
|
80 | 95 |
|
81 | 96 | ```codecept run --env chrome --group slow```
|
| 97 | +
|
| 98 | +### Testing Groups |
| 99 | +* You can run or exclude subsets of Tests using the `--group` and `--skip-group` codeception flags in the Terminal (IF you add the `@env` tag to a Test you HAVE to include the `--env ZZZZ` flag in your `codecept` command): |
| 100 | + * ```codecept run acceptance --env ZZZZ --group XXXX --skip-group YYYY``` |
| 101 | + * *skip* |
| 102 | + * *slow* |
| 103 | + * *example* |
| 104 | + * *sample* |
| 105 | + * *admin-direct-access* |
| 106 | + * *nav-menu-access* |
| 107 | + * *sampleData* |
| 108 | + * *nav-menu* |
| 109 | + * *add* |
| 110 | + * *fields* |
| 111 | + * *catalog* |
| 112 | + * *configurable* |
| 113 | + * *customer* |
| 114 | + * *sales* |
| 115 | + * *orders* |
| 116 | +
|
82 | 117 | ### RoboFile.php
|
83 | 118 |
|
84 | 119 | * Edit the following command to change the Tests that the command `robo test` executes:
|
85 | 120 |
|
86 | 121 | ```
|
87 | 122 | $this->_exec('codecept run --env chrome');
|
88 | 123 | ```
|
| 124 | +
|
89 | 125 | ### TROUBLESHOOTING
|
90 | 126 | * TimeZone Error - http://stackoverflow.com/questions/18768276/codeception-datetime-error
|
91 | 127 | * TimeZone List - http://php.net/manual/en/timezones.america.php
|
|
0 commit comments