You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 19, 2019. It is now read-only.
Copy file name to clipboardExpand all lines: dev/tests/acceptance/README.md
+80-62Lines changed: 80 additions & 62 deletions
Original file line number
Diff line number
Diff line change
@@ -8,21 +8,39 @@
8
8
----
9
9
10
10
# Prerequisites
11
+
***IMPORTANT**: Configure your Magento Store for [Automated Testing](http://devdocs.magento.com/guides/v2.0/mtf/mtf_quickstart/mtf_quickstart_magento.html)
* Configure Magento for [Automated Testing](http://devdocs.magento.com/guides/v2.0/mtf/mtf_quickstart/mtf_quickstart_magento.html)
22
19
23
20
### Recommendations
24
21
* We recommend using [PHPStorm 2017](https://www.jetbrains.com/phpstorm/) for your IDE. They recently added support for [Codeception Test execution](https://blog.jetbrains.com/phpstorm/2017/03/codeception-support-comes-to-phpstorm-2017-1/) which is helpful when debugging.
25
-
* We also recommend updating your [$PATH to include](https://stackoverflow.com/questions/7703041/editing-path-variable-on-mac)`vendor/bin` so you can easily execute the necessary `robo` and `codecept` commands instead of `vendor/bin/robo` or `vendor/bin/codecept`.
22
+
* We also recommend updating your [$PATH to include](https://stackoverflow.com/questions/7703041/editing-path-variable-on-mac)`./vendor/bin` so you can easily execute the necessary `robo` and `codecept` commands instead of `./vendor/bin/robo` or `./vendor/bin/codecept`.
23
+
24
+
----
25
+
26
+
# TEMPORARY INSTALLATION INSTRUCTIONS
27
+
Due to the current setup of the Framework you will need to do the following:
28
+
29
+
*`mkdir [DIRECTORY_NAME]`
30
+
*`cd [DIRECTORY_NAME]`
31
+
* Pull down - [EE](https://github.com/magento-pangolin/magento2ee)
32
+
* Pull down - [CE](https://github.com/magento-pangolin/magento2ce)
You can see a list of all available Robo commands by calling `robo` directly in the Terminal.
74
+
You can see a list of all available Robo commands by calling `./vendor/bin/robo` in the Terminal.
57
75
58
76
##### Codeception Robo Commands
59
-
*`robo`
77
+
*`./vendor/bin/robo`
60
78
* Lists all available Robo commands.
61
-
*`robo clone:files`
79
+
*`./vendor/bin/robo clone:files`
62
80
* Duplicate the Example configuration files used to customize the Project
63
-
*`robo build:project`
81
+
*`./vendor/bin/robo build:project`
64
82
* Build the Codeception project
65
-
*`robo generate:pages`
83
+
*`./vendor/bin/robo generate:pages`
66
84
* Generate all Page Objects
67
-
*`robo generate:tests`
85
+
*`./vendor/bin/robo generate:tests`
68
86
* Generate all Tests in PHP
69
-
*`robo example`
87
+
*`./vendor/bin/robo example`
70
88
* Run all Tests marked with the @group tag 'example', using the Chrome environment
71
-
*`robo chrome`
72
-
* Run all Acceptance tests using the Chrome environment
73
-
*`robo firefox`
74
-
* Run all Acceptance tests using the FireFox environment
75
-
*`robo phantomjs`
76
-
* Run all Acceptance tests using the PhantomJS environment
77
-
*`robo folder ______`
78
-
* Run all Acceptance tests located under the Directory Path provided using the Chrome environment
79
-
*`robo group ______`
89
+
*`./vendor/bin/robo chrome`
90
+
* Run all Functional tests using the Chrome environment
91
+
*`./vendor/bin/robo firefox`
92
+
* Run all Functional tests using the FireFox environment
93
+
*`./vendor/bin/robo phantomjs`
94
+
* Run all Functional tests using the PhantomJS environment
95
+
*`./vendor/bin/robo folder ______`
96
+
* Run all Functional tests located under the Directory Path provided using the Chrome environment
97
+
*`./vendor/bin/robo group ______`
80
98
* Run all Tests with the specified @group tag, excluding @group 'skip', using the Chrome environment
81
99
82
100
##### Allure Robo Commands
83
101
To determine which version of the Allure command you need to use please run `allure --version`.
84
102
85
-
*`robo allure1:generate`
103
+
*`./vendor/bin/robo allure1:generate`
86
104
* Allure v1.x.x - Generate the HTML for the Allure report based on the Test XML output
87
-
*`robo allure1:open`
105
+
*`./vendor/bin/robo allure1:open`
88
106
* Allure v1.x.x - Open the HTML Allure report
89
-
*`robo allure1:report`
107
+
*`./vendor/bin/robo allure1:report`
90
108
* Allure v1.x.x - Generate and open the HTML Allure report
91
-
*`robo allure2:generate`
109
+
*`./vendor/bin/robo allure2:generate`
92
110
* Allure v2.x.x - Generate the HTML for the Allure report based on the Test XML output
93
-
*`robo allure2:open`
111
+
*`./vendor/bin/robo allure2:open`
94
112
* Allure v2.x.x - Open the HTML Allure report
95
-
*`robo allure2:report`
113
+
*`./vendor/bin/robo allure2:report`
96
114
* Allure v2.x.x - Generate and open the HTML Allure report
97
115
98
116
----
99
117
100
118
# Building The Framework
101
-
After installing the dependencies you will want to build the Codeception project in the [Acceptance Test Framework](https://github.com/magento-pangolin/magento2-acceptance-test-framework), which is a dependency of the CE or EE Tests repo. Run `robo build:project` to complete this task.
119
+
After installing the dependencies you will want to build the Codeception project in the [Magento 2 Functional Testing Framework](https://github.com/magento-pangolin/magento2-functional-testing-framework), which is a dependency of the CE or EE Tests repo. Run `./vendor/bin/robo build:project` to complete this task.
102
120
103
-
`robo build:project`
121
+
`./vendor/bin/robo build:project`
104
122
105
123
----
106
124
107
125
# Configure the Framework
108
-
Before you can generate or run the Tests you will need to clone the Example Configuration files and edit them for your specific Store settings. You can edit these files with out the fear of accidentally committing your credentials or other sensitive information as these files are listed in the *.gitignore* file.
109
-
Run the following command to generate these files:
126
+
Before you can generate or run the Tests you will need to edit the Configuration files and configure them for your specific Store settings. You can edit these files with out the fear of accidentally committing your credentials or other sensitive information as these files are listed in the *.gitignore* file.
110
127
111
-
`robo setup`
128
+
In the `.env` file you will find key pieces of information that are unique to your local Magento setup that will need to be edited before you can generate tests:
129
+
***MAGENTO_BASE_URL**
130
+
***MAGENTO_BACKEND_NAME**
131
+
***MAGENTO_ADMIN_USERNAME**
132
+
***MAGENTO_ADMIN_PASSWORD**
112
133
113
-
In these files you will find key pieces of information that are unique to your local Magento setup that will need to be edited (ex **MAGENTO_BASE_URL**, **MAGENTO_BACKEND_NAME**, **MAGENTO_ADMIN_USERNAME**, **MAGENTO_ADMIN_PASSWORD**, etc...).
114
-
***tests/acceptance.suite.yml**
134
+
##### Additional Codeception settings can be found in the following files:
135
+
***tests/functional.suite.yml**
115
136
***codeception.dist.yml**
116
-
***.env**
117
137
118
138
----
119
139
120
140
# Generate PHP files for Tests
121
-
All Tests in the Framework are written in XML and need to have the PHP generated for Codeception to run. Run the following command to generate the PHP files into the following directory: `tests/acceptance/Magento/AcceptanceTest/_generated`
141
+
All Tests in the Framework are written in XML and need to have the PHP generated for Codeception to run. Run the following command to generate the PHP files in the following directory (If this directory does not exist it will be created): `dev/tests/acceptance/tests/functional/Magento/FunctionalTest/_generated`
122
142
123
-
If this directory doesn't exist it will be created.
124
-
125
-
`robo generate:tests`
143
+
`./vendor/bin/robo generate:tests`
126
144
127
145
----
128
146
129
147
# Running Tests
130
148
## Start the Selenium Server
131
-
PLEASE NOTE: You will need to have an instance of the Selenium Server running on your machine before you can execute the Tests.
149
+
**PLEASE NOTE**: You will need to have an instance of the Selenium Server running on your machine before you can execute the Tests.
132
150
133
151
```
134
152
cd [LOCATION_OF_SELENIUM_JAR]
135
153
java -jar selenium-server-standalone-X.X.X.jar
136
154
```
137
155
138
156
## Run Tests Manually
139
-
You can run the Codeception tests directly without using Robo if you'd like. To do so please run `codecept run acceptance` to execute all Acceptance tests that DO NOT include @env tags. IF a Test includes an [@env tag](http://codeception.com/docs/07-AdvancedUsage#Environments) you MUST include the `--env ENV_NAME` flag.
157
+
You can run the Codeception tests directly without using Robo if you'd like. To do so please run `./vendor/bin/codecept run functional` to execute all Functional tests that DO NOT include @env tags. IF a Test includes an [@env tag](http://codeception.com/docs/07-AdvancedUsage#Environments) you MUST include the `--env ENV_NAME` flag.
140
158
141
159
#### Common Codeception Flags:
142
160
@@ -150,17 +168,17 @@ You can run the Codeception tests directly without using Robo if you'd like. To
150
168
151
169
#### Examples
152
170
153
-
* Run ALL Acceptance Tests without an @env tag: `codecept run acceptance`
154
-
* Run ALL Acceptance Tests without the "skip" @group: `codecept run acceptance --skip-group skip`
155
-
* Run ALL Acceptance Tests with the @group tag "example" without the "skip" @group tests: `codecept run acceptance --group example --skip-group skip`
171
+
* Run ALL Functional Tests without an @env tag: `./vendor/bin/codecept run functional`
172
+
* Run ALL Functional Tests without the "skip" @group: `./vendor/bin/codecept run functional --skip-group skip`
173
+
* Run ALL Functional Tests with the @group tag "example" without the "skip" @group tests: `./vendor/bin/codecept run functional --group example --skip-group skip`
156
174
157
175
## Run Tests using Robo
158
-
* Run all Acceptance Tests using the @env tag "chrome": `robo chrome`
159
-
* Run all Acceptance Tests using the @env tag "firefox": `robo firefox`
160
-
* Run all Acceptance Tests using the @env tag "phantomjs": `robo phantomjs`
161
-
* Run all Acceptance Tests using the @group tag "example": `robo example`
162
-
* Run all Acceptance Tests using the provided @group tag: `robo group GROUP_NAME`
163
-
* Run all Acceptance Tests listed under the provided Folder Path: `robo folder tests/acceptance/Magento/AcceptanceTest/MODULE_NAME`
176
+
* Run all Functional Tests using the @env tag "chrome": `./vendor/bin/robo chrome`
177
+
* Run all Functional Tests using the @env tag "firefox": `./vendor/bin/robo firefox`
178
+
* Run all Functional Tests using the @env tag "phantomjs": `./vendor/bin/robo phantomjs`
179
+
* Run all Functional Tests using the @group tag "example": `./vendor/bin/robo example`
180
+
* Run all Functional Tests using the provided @group tag: `./vendor/bin/robo group GROUP_NAME`
181
+
* Run all Functional Tests listed under the provided Folder Path: `./vendor/bin/robo folder dev/tests/acceptance/tests/functional/Magento/FunctionalTest/MODULE_NAME`
164
182
165
183
----
166
184
@@ -180,14 +198,14 @@ You can run the following commands in the Terminal to generate and open an Allur
180
198
You can run the following Robo commands in the Terminal to generate and open an Allure report (Run the following terminal command for the Allure version: `allure --version`):
181
199
182
200
##### Allure v1.x.x
183
-
* Build the Report: `robo allure1:generate`
184
-
* Open the Report: `robo allure1:open`
185
-
* Build/Open the Report: `robo allure1:report`
201
+
* Build the Report: `./vendor/bin/robo allure1:generate`
202
+
* Open the Report: `./vendor/bin/robo allure1:open`
203
+
* Build/Open the Report: `./vendor/bin/robo allure1:report`
186
204
187
205
##### Allure v2.x.x
188
-
* Build the Report: `robo allure2:generate`
189
-
* Open the Report: `robo allure2:open`
190
-
* Build/Open the Report: `robo allure2:report`
206
+
* Build the Report: `./vendor/bin/robo allure2:generate`
207
+
* Open the Report: `./vendor/bin/robo allure2:open`
208
+
* Build/Open the Report: `./vendor/bin/robo allure2:report`
191
209
192
210
----
193
211
@@ -199,9 +217,9 @@ Due to the interdependent nature of the 2 repos it is recommended to Symlink the
* TimeZone List - http://php.net/manual/en/timezones.america.php
202
-
* System PATH - Make sure you have `vendor/bin/` and `vendor/` listed in your system path so you can run the `codecept` and `robo` commands directly:
220
+
* System PATH - Make sure you have `./vendor/bin/`, `vendor/bin/` and `vendor/` listed in your system path so you can run the `codecept` and `robo` commands directly:
* Allure `@env error` - Allure recently changed their Codeception Adapter that breaks Codeception when tests include the `@env` tag. A workaround for this error is to revert the changes they made to a function.
@@ -225,4 +243,4 @@ public function _initialize(array $ignoredAnnotations = [])
Copy file name to clipboardExpand all lines: dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminCategoryBasicFieldSection.xml
Copy file name to clipboardExpand all lines: dev/tests/acceptance/tests/functional/Magento/FunctionalTest/Catalog/Section/AdminCategoryMainActionsSection.xml
0 commit comments