Skip to content

Commit d8d9fca

Browse files
ivy00johnstomreece
authored andcommitted
MQE-402: Workshop Feedback
- Updating the README, adding instructions that we missed that were pointed out in the Workshop sessions. - Adding an additional work around for the Allure @env error.
1 parent 738aa48 commit d8d9fca

File tree

1 file changed

+63
-30
lines changed

1 file changed

+63
-30
lines changed

dev/tests/acceptance/README.md

Lines changed: 63 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,20 @@
88
----
99

1010
# Prerequisites
11-
* **IMPORTANT**: Configure your Magento Store for [Automated Testing](http://devdocs.magento.com/guides/v2.0/mtf/mtf_quickstart/mtf_quickstart_magento.html)
11+
* **IMPORTANT**
12+
* You will need to have a running instance of Magento that you can access.
13+
* You will need to configure your instance of Magento for [Automated Testing](http://devdocs.magento.com/guides/v2.0/mtf/mtf_quickstart/mtf_quickstart_magento.html).
1214
* [PHP v7.x](http://php.net/manual/en/install.php)
1315
* [Composer v1.4.x](https://getcomposer.org/download/)
14-
* [Java](https://www.java.com/en/download/)
16+
* [Java v1.8.x](https://www.java.com/en/download/)
1517
* [Selenium Server](http://www.seleniumhq.org/download/) - [v2.53.x](http://selenium-release.storage.googleapis.com/index.html?path=2.53/)
16-
* [ChromeDriver](https://sites.google.com/a/chromium.org/chromedriver/downloads)
17-
* [Allure CLI](https://docs.qameta.io/allure/latest/#_installing_a_commandline)
18+
* [ChromeDriver v2.32.x](https://sites.google.com/a/chromium.org/chromedriver/downloads)
19+
* [Allure CLI v2.3.x](https://docs.qameta.io/allure/latest/#_installing_a_commandline)
1820
* [GitHub](https://desktop.github.com/)
1921

2022
### Recommendations
2123
* 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.
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`.
24+
* 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 using `./vendor/bin/robo` or `./vendor/bin/codecept`.
2325

2426
----
2527

@@ -32,15 +34,34 @@ Due to the current setup of the Framework you will need to do the following:
3234
* Pull down - [CE](https://github.com/magento-pangolin/magento2ce)
3335
* `cd magento2ee`
3436
* `php -f dev/tools/build-ee.php -- --command=link --exclude=true`
35-
* Generate a `github-oauth` token: [Instructions](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/#creating-a-token)
37+
* `cd ..`
38+
* Generate a `github-oauth` token:
39+
* [How to setup an auth.json file for the Composer?](https://mage2.pro/t/topic/743)
40+
* [Creating a personal access token for the command line.](https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/#creating-a-token)
3641
* `touch magento2ce/dev/tests/acceptance/auth.json`
3742
* `nano magento2ce/dev/tests/acceptance/auth.json`
43+
* Copy/Paste the following:
44+
```
45+
{
46+
"github-oauth": {
47+
"github.com": "<personal access token>"
48+
}
49+
}
50+
```
3851
* Replace `<personal access token>` with the token you generated in GitHub.
3952
* Save your work.
4053
* `cd ../magento2ce`
4154
* `cd dev/tests/acceptance`
55+
* Open the `composer.json` file.
56+
* Make the following edits:
57+
* `url`:
58+
1. ORIGINAL: `"url": "git@github.com:magento/magento2-functional-testing-framework.git"`
59+
1. UPDATED: `"url": "git@github.com:magento-pangolin/magento2-functional-testing-framework.git"`
60+
* `magento/magento2-functional-testing-framework`:
61+
1. ORIGINAL: `"magento/magento2-functional-testing-framework": "dev-develop"`
62+
1. UPDATED: `"magento/magento2-functional-testing-framework": "dev-sprint-develop"`
4263
* `composer install`
43-
* **PLEASE IGNORE THE "Installation" SECTION THAT FOLLOWS, START WITH THE "Building The Framework" SECTION INSTEAD.**
64+
* **PLEASE IGNORE THE "Installation" SECTION THAT FOLLOWS, START WITH THE "Building The Framework" SECTION INSTEAD.**
4465
4566
----
4667
@@ -116,7 +137,7 @@ To determine which version of the Allure command you need to use please run `all
116137
----
117138
118139
# Building The Framework
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.
140+
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 the following to complete this task:
120141
121142
`./vendor/bin/robo build:project`
122143
@@ -127,9 +148,15 @@ Before you can generate or run the Tests you will need to edit the Configuration
127148
128149
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:
129150
* **MAGENTO_BASE_URL**
151+
* Example: `MAGENTO_BASE_URL=http://127.0.0.1:32772/`
152+
* Note: Please end the URL with a `/`.
130153
* **MAGENTO_BACKEND_NAME**
154+
* Example: `MAGENTO_BACKEND_NAME=admin`
155+
* Note: Set this variable to `admin`.
131156
* **MAGENTO_ADMIN_USERNAME**
157+
* Example: `MAGENTO_ADMIN_USERNAME=admin`
132158
* **MAGENTO_ADMIN_PASSWORD**
159+
* Example: `MAGENTO_ADMIN_PASSWORD=123123`
133160
134161
##### Additional Codeception settings can be found in the following files:
135162
* **tests/functional.suite.yml**
@@ -222,25 +249,31 @@ Due to the interdependent nature of the 2 repos it is recommended to Symlink the
222249
`sudo nano /etc/paths`
223250
224251
* StackOverflow Help: https://stackoverflow.com/questions/7703041/editing-path-variable-on-mac
225-
* 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.
226-
* Locate the `AllureAdapter.php` file here: `vendor/allure-framework/allure-codeception/src/Yandex/Allure/Adapter/AllureAdapter.php`
227-
* Edit the `_initialize()` function found on line 77 and replace it with the following:
228-
```
229-
public function _initialize(array $ignoredAnnotations = [])
230-
{
231-
parent::_initialize();
232-
Annotation\AnnotationProvider::registerAnnotationNamespaces();
233-
// Add standard PHPUnit annotations
234-
Annotation\AnnotationProvider::addIgnoredAnnotations($this->ignoredAnnotations);
235-
// Add custom ignored annotations
236-
$ignoredAnnotations = $this->tryGetOption('ignoredAnnotations', []);
237-
Annotation\AnnotationProvider::addIgnoredAnnotations($ignoredAnnotations);
238-
$outputDirectory = $this->getOutputDirectory();
239-
$deletePreviousResults =
240-
$this->tryGetOption(DELETE_PREVIOUS_RESULTS_PARAMETER, false);
241-
$this->prepareOutputDirectory($outputDirectory, $deletePreviousResults);
242-
if (is_null(Model\Provider::getOutputDirectory())) {
243-
Model\Provider::setOutputDirectory($outputDirectory);
244-
}
245-
}
246-
```
252+
* Allure `@env error` - Allure recently changed their Codeception Adapter that breaks Codeception when tests include the `@env` tag. There are 2 workarounds for this issue currently.
253+
1. You can edit the `composer.json` and point the Allure-Codeception Adapter to a previous commit:
254+
* Edit the `composer.json` file.
255+
* Make the following change:
256+
* ORIGINAL: `“allure-framework/allure-codeception”: "dev-master"`
257+
* UPDATED: `“allure-framework/allure-codeception”: “dev-master#af40af5ae2b717618a42fe3e137d75878508c75d”`
258+
1. You can revert the changes that they made manually:
259+
* Locate the `AllureAdapter.php` file here: `vendor/allure-framework/allure-codeception/src/Yandex/Allure/Adapter/AllureAdapter.php`
260+
* Edit the `_initialize()` function found on line 77 and replace it with the following:
261+
```
262+
public function _initialize(array $ignoredAnnotations = [])
263+
{
264+
parent::_initialize();
265+
Annotation\AnnotationProvider::registerAnnotationNamespaces();
266+
// Add standard PHPUnit annotations
267+
Annotation\AnnotationProvider::addIgnoredAnnotations($this->ignoredAnnotations);
268+
// Add custom ignored annotations
269+
$ignoredAnnotations = $this->tryGetOption('ignoredAnnotations', []);
270+
Annotation\AnnotationProvider::addIgnoredAnnotations($ignoredAnnotations);
271+
$outputDirectory = $this->getOutputDirectory();
272+
$deletePreviousResults =
273+
$this->tryGetOption(DELETE_PREVIOUS_RESULTS_PARAMETER, false);
274+
$this->prepareOutputDirectory($outputDirectory, $deletePreviousResults);
275+
if (is_null(Model\Provider::getOutputDirectory())) {
276+
Model\Provider::setOutputDirectory($outputDirectory);
277+
}
278+
}
279+
```

0 commit comments

Comments
 (0)