Skip to content

Commit 0b22d74

Browse files
author
Michael Logvin
committed
Merge pull request #78 from magento-firedrakes/MAGETWO-31478
[Firedrakes] Library Component for the Unified File Format in MTF
2 parents fd9337c + c43555d commit 0b22d74

File tree

295 files changed

+6944
-902
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

295 files changed

+6944
-902
lines changed

dev/tests/functional/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"magento/mtf": "1.0.0-rc15",
3+
"magento/mtf": "1.0.0-rc16",
44
"php": "~5.5.0|~5.6.0",
55
"phpunit/phpunit": "4.1.0",
66
"phpunit/phpunit-selenium": ">=1.2",

dev/tests/functional/config/application.yml.dist

Lines changed: 0 additions & 7 deletions
This file was deleted.

dev/tests/functional/config/handler.yml.dist

Lines changed: 0 additions & 5 deletions
This file was deleted.

dev/tests/functional/config/install_data.yml.dist

Lines changed: 0 additions & 10 deletions
This file was deleted.

dev/tests/functional/config/isolation.yml.dist

Lines changed: 0 additions & 6 deletions
This file was deleted.

dev/tests/functional/config/server.yml.dist

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © 2015 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="config.xsd">
9+
<application>
10+
<reopenBrowser>testCase</reopenBrowser>
11+
<backendLogin>admin</backendLogin>
12+
<backendPassword>123123q</backendPassword>
13+
<appBackendUrl>http://magento.dev/backend/</appBackendUrl>
14+
<backendLoginUrl>admin</backendLoginUrl>
15+
</application>
16+
<install>
17+
<host>127.0.0.1</host>
18+
<user>root</user>
19+
<password>123123q</password>
20+
<dbName>default</dbName>
21+
<baseUrl>http://127.0.0.1/magento2/</baseUrl>
22+
<backendName>backend</backendName>
23+
</install>
24+
</config>
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © 2015 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
9+
<xs:element name="config">
10+
<xs:complexType>
11+
<xs:all>
12+
<xs:element name="application" maxOccurs="1" minOccurs="0">
13+
<xs:complexType>
14+
<xs:sequence>
15+
<xs:choice maxOccurs="unbounded">
16+
<xs:element name="reopenBrowser" type="reopenBrowserType"/>
17+
<xs:element name="backendLogin" type="backendLoginType" />
18+
<xs:element name="backendPassword" type="backendPasswordType" />
19+
<xs:element name="backendLoginUrl" type="backendLoginUrlType" />
20+
<xs:element name="appBackendUrl" type="appBackendUrlType" />
21+
</xs:choice>
22+
</xs:sequence>
23+
</xs:complexType>
24+
</xs:element>
25+
<xs:element name="isolation" maxOccurs="1" minOccurs="0">
26+
<xs:complexType>
27+
<xs:sequence>
28+
<xs:choice maxOccurs="unbounded">
29+
<xs:element name="resetUrlPath" type="notEmptyType"/>
30+
<xs:element name="testSuite" type="isolationModeType" />
31+
<xs:element name="testCase" type="isolationModeType" />
32+
<xs:element name="test" type="isolationModeType" />
33+
</xs:choice>
34+
</xs:sequence>
35+
</xs:complexType>
36+
</xs:element>
37+
<xs:element name="server" minOccurs="0">
38+
<xs:complexType>
39+
<xs:sequence>
40+
<xs:choice maxOccurs="unbounded" minOccurs="1">
41+
<xs:element name="item" type="serverItemType"/>
42+
</xs:choice>
43+
</xs:sequence>
44+
</xs:complexType>
45+
</xs:element>
46+
<xs:element name="install" minOccurs="0" maxOccurs="1">
47+
<xs:complexType>
48+
<xs:sequence>
49+
<xs:choice maxOccurs="unbounded">
50+
<xs:element name="host" type="notEmptyType"/>
51+
<xs:element name="user" type="notEmptyType" />
52+
<xs:element name="password" type="notEmptyType" />
53+
<xs:element name="dbName" type="notEmptyType" />
54+
<xs:element name="baseUrl" type="notEmptyType" />
55+
<xs:element name="backendName" type="notEmptyType" />
56+
</xs:choice>
57+
</xs:sequence>
58+
</xs:complexType>
59+
</xs:element>
60+
</xs:all>
61+
</xs:complexType>
62+
</xs:element>
63+
<xs:simpleType name="reopenBrowserType">
64+
<xs:restriction base="xs:string">
65+
<xs:pattern value="testCase|test"/>
66+
</xs:restriction>
67+
</xs:simpleType>
68+
<xs:simpleType name="backendLoginType">
69+
<xs:restriction base="xs:string">
70+
<xs:minLength value="1"/>
71+
</xs:restriction>
72+
</xs:simpleType>
73+
<xs:simpleType name="backendLoginUrlType">
74+
<xs:restriction base="xs:string">
75+
<xs:minLength value="1"/>
76+
</xs:restriction>
77+
</xs:simpleType>
78+
<xs:simpleType name="appBackendUrlType">
79+
<xs:restriction base="xs:string">
80+
<xs:minLength value="1"/>
81+
</xs:restriction>
82+
</xs:simpleType>
83+
<xs:simpleType name="backendPasswordType">
84+
<xs:restriction base="xs:string">
85+
<xs:minLength value="1"/>
86+
</xs:restriction>
87+
</xs:simpleType>
88+
<xs:simpleType name="notEmptyType">
89+
<xs:restriction base="xs:string">
90+
<xs:minLength value="1"/>
91+
</xs:restriction>
92+
</xs:simpleType>
93+
<xs:simpleType name="isolationModeType">
94+
<xs:restriction base="xs:string">
95+
<xs:pattern value="none|before|after|both"/>
96+
</xs:restriction>
97+
</xs:simpleType>
98+
<xs:simpleType name="serverTypeType">
99+
<xs:restriction base="xs:string">
100+
<xs:pattern value="default"/>
101+
</xs:restriction>
102+
</xs:simpleType>
103+
<xs:simpleType name="portType">
104+
<xs:restriction base="xs:int"/>
105+
</xs:simpleType>
106+
<xs:simpleType name="timeoutType">
107+
<xs:restriction base="xs:int">
108+
</xs:restriction>
109+
</xs:simpleType>
110+
<xs:complexType name="serverItemType">
111+
<xs:choice>
112+
<xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
113+
</xs:choice>
114+
<xs:attribute name="type" type="serverTypeType" use="optional"/>
115+
<xs:attribute name="name" type="xs:string" use="required"/>
116+
<xs:attribute name="browser" type="notEmptyType"/>
117+
<xs:attribute name="browserName" type="notEmptyType"/>
118+
<xs:attribute name="host" type="notEmptyType"/>
119+
<xs:attribute name="port" type="portType"/>
120+
<xs:attribute name="seleniumServerRequestsTimeout" type="timeoutType" use="optional"/>
121+
<xs:attribute name="sessionStrategy" type="notEmptyType" use="optional"/>
122+
</xs:complexType>
123+
<xs:simpleType name="enableDisableType">
124+
<xs:restriction base="xs:string">
125+
<xs:pattern value="false|true"/>
126+
</xs:restriction>
127+
</xs:simpleType>
128+
<xs:complexType name="specificModuleType">
129+
<xs:sequence>
130+
<xs:choice>
131+
<xs:element name="module" type="notEmptyType" maxOccurs="unbounded"/>
132+
</xs:choice>
133+
</xs:sequence>
134+
<xs:attribute name="enabled" type="enableDisableType"/>
135+
</xs:complexType>
136+
</xs:schema>

dev/tests/functional/etc/global/di.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,9 @@
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
99
<preference for="Magento\Mtf\Util\Generate\Fixture\FieldsProviderInterface" type="Magento\Mtf\Util\Generate\Fixture\FieldsProvider" />
1010
<preference for="Magento\Mtf\Util\Generate\Repository\CollectionProviderInterface" type="Magento\Mtf\Util\Generate\Repository\CollectionProvider" />
11+
<virtualType name="Magento\Mtf\Config\SchemaLocator\Config" type="Magento\Mtf\Config\SchemaLocator">
12+
<arguments>
13+
<argument name="schemaPath" xsi:type="string">etc/global/config.xsd</argument>
14+
</arguments>
15+
</virtualType>
1116
</config>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © 2015 Magento. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
9+
<xs:element name="config">
10+
<xs:annotation>
11+
<xs:documentation>
12+
The root element for configuration data.
13+
</xs:documentation>
14+
</xs:annotation>
15+
<xs:complexType>
16+
<xs:sequence>
17+
<xs:element ref="testCase" maxOccurs="unbounded" minOccurs="1">
18+
<xs:annotation>
19+
<xs:documentation>
20+
An element that contains configuration data of a test case.
21+
</xs:documentation>
22+
</xs:annotation>
23+
</xs:element>
24+
</xs:sequence>
25+
</xs:complexType>
26+
</xs:element>
27+
28+
<xs:element name="testCase">
29+
<xs:complexType>
30+
<xs:sequence>
31+
<xs:element ref="variation" maxOccurs="unbounded" minOccurs="1">
32+
<xs:annotation>
33+
<xs:documentation>
34+
An element that contains configuration data of a test case variation.
35+
</xs:documentation>
36+
</xs:annotation>
37+
</xs:element>
38+
</xs:sequence>
39+
<xs:attribute type="xs:string" name="name" use="required"/>
40+
</xs:complexType>
41+
</xs:element>
42+
43+
<xs:element name="variation">
44+
<xs:complexType>
45+
<xs:sequence>
46+
<xs:element ref="data" maxOccurs="unbounded" minOccurs="1">
47+
<xs:annotation>
48+
<xs:documentation>
49+
An element that contains a single configuration data set of a test case variation.
50+
</xs:documentation>
51+
</xs:annotation>
52+
</xs:element>
53+
</xs:sequence>
54+
<xs:attribute type="xs:string" name="name" use="required"/>
55+
</xs:complexType>
56+
</xs:element>
57+
58+
<xs:element name="data">
59+
<xs:complexType>
60+
<xs:simpleContent>
61+
<xs:extension base="xs:string">
62+
<xs:attribute type="xs:string" name="name" use="required"/>
63+
</xs:extension>
64+
</xs:simpleContent>
65+
</xs:complexType>
66+
</xs:element>
67+
</xs:schema>

dev/tests/functional/lib/Magento/Mtf/ObjectManagerFactory.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -64,26 +64,6 @@ public function create(array $sharedInstances = [])
6464
return $objectManager;
6565
}
6666

67-
/**
68-
* Create instance of application deployment config
69-
*
70-
* @param \Magento\Framework\App\Filesystem\DirectoryList $directoryList
71-
* @param array $arguments
72-
* @return \Magento\Framework\App\DeploymentConfig
73-
*/
74-
protected function createDeploymentConfig(
75-
\Magento\Framework\App\Filesystem\DirectoryList $directoryList,
76-
array $arguments
77-
) {
78-
$data = isset($arguments[\Magento\Framework\App\Arguments\Loader::PARAM_CUSTOM_FILE])
79-
? $arguments[\Magento\Framework\App\Arguments\Loader::PARAM_CUSTOM_FILE]
80-
: null;
81-
return new \Magento\Framework\App\DeploymentConfig(
82-
new \Magento\Framework\App\DeploymentConfig\Reader($directoryList),
83-
$data
84-
);
85-
}
86-
8767
/**
8868
* Return newly created instance on an argument interpreter, suitable for processing DI arguments
8969
*

dev/tests/functional/lib/Magento/Mtf/Util/Generate/Factory/AbstractFactory.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,11 @@ protected function collectItems($type)
171171
);
172172
foreach ($dirIterator as $info) {
173173
/** @var $info \SplFileInfo */
174-
$this->_processItem($items, $rewrites, $info->getRealPath(), $location, $path);
174+
$realPath = $info->getPathname();
175+
if (is_link($realPath)) {
176+
$realPath = readlink($realPath);
177+
}
178+
$this->_processItem($items, $rewrites, $realPath, $location, $path);
175179
}
176180
}
177181
}

dev/tests/functional/lib/Magento/Mtf/Util/Generate/Repository/CollectionProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class CollectionProvider implements CollectionProviderInterface
2020
protected $objectManager;
2121

2222
/**
23-
* Magetno resource instance.
23+
* Magento resource instance.
2424
*
2525
* @var \Magento\Framework\App\Resource
2626
*/

dev/tests/functional/lib/Magento/Mtf/Util/Protocol/CurlTransport/BackendDecorator.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
namespace Magento\Mtf\Util\Protocol\CurlTransport;
88

9-
use Magento\Mtf\System\Config;
9+
use Magento\Mtf\Config;
1010
use Magento\Mtf\Util\Protocol\CurlInterface;
1111
use Magento\Mtf\Util\Protocol\CurlTransport;
1212

@@ -65,16 +65,18 @@ public function __construct(CurlTransport $transport, Config $configuration)
6565
*/
6666
protected function authorize()
6767
{
68-
$credentials = $this->configuration->getConfigParam('application/backend_user_credentials');
69-
$url = $_ENV['app_backend_url'] . $this->configuration->getConfigParam('application/backend_login_url');
68+
$url = $_ENV['app_backend_url'] .
69+
$this->configuration->getParameter('application/backendLoginUrl');
7070
$data = [
71-
'login[username]' => $credentials['login'],
72-
'login[password]' => $credentials['password'],
71+
'login[username]' => $this->configuration->getParameter('application/backendLogin'),
72+
'login[password]' => $this->configuration->getParameter('application/backendPassword'),
7373
];
7474
$this->transport->write(CurlInterface::POST, $url, '1.0', [], $data);
7575
$response = $this->read();
7676
if (strpos($response, 'page-login')) {
77-
throw new \Exception('Admin user cannot be logged in by curl handler!');
77+
throw new \Exception(
78+
'Admin user cannot be logged in by curl handler!'
79+
);
7880
}
7981
}
8082

@@ -107,7 +109,7 @@ public function write($method, $url, $httpVer = '1.1', $headers = [], $params =
107109
if ($this->formKey) {
108110
$params['form_key'] = $this->formKey;
109111
} else {
110-
throw new \Exception('Form key is absent! Response: ' . $this->response);
112+
throw new \Exception(sprintf('Form key is absent! Url: "%s" Response: "%s"', $url, $this->response));
111113
}
112114
$this->transport->write($method, $url, $httpVer, $headers, http_build_query($params));
113115
}

dev/tests/functional/phpunit.xml.dist

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@
3232
<php>
3333
<env name="app_frontend_url" value="http://localhost/index.php/" />
3434
<env name="app_backend_url" value="http://localhost/index.php/backend/" />
35-
<env name="app_config_path" value="config/application.yml.dist" />
36-
<env name="server_config_path" value="config/server.yml.dist" />
37-
<env name="isolation_config_path" value="config/isolation.yml.dist" />
38-
<env name="handlers_config_path" value="config/handler.yml.dist" />
39-
<env name="install_config_path" value="config/install_data.yml.dist" />
4035
<env name="testsuite_rule" value="basic" />
4136
<env name="testsuite_rule_path" value="Magento/Mtf/TestSuite/InjectableTests" />
4237
<env name="log_directory" value="var/log" />

0 commit comments

Comments
 (0)