Skip to content

Commit b2cbffb

Browse files
author
Aponasenko, Dmytro(daponasenko)
committed
Merge pull request #596 from magento-qmt/develop
[Mavericks] Add webapi handler for category and test maintenance
2 parents f072f6a + 4f62818 commit b2cbffb

File tree

141 files changed

+1288
-1417
lines changed

Some content is hidden

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

141 files changed

+1288
-1417
lines changed

dev/tests/functional/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
**/var
22
/composer.lock
3+
/etc/config.xml
34
/generated
45
/lib/Magento/Mtf/Util/Generate/testcase.xml
5-
/var
66
/vendor
77
phpunit.xml
88
credentials.xml

dev/tests/functional/bootstrap.php

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

77
defined('MTF_BOOT_FILE') || define('MTF_BOOT_FILE', __FILE__);
88
defined('MTF_BP') || define('MTF_BP', str_replace('\\', '/', (__DIR__)));
9+
defined('MTF_TESTS_PATH') || define('MTF_TESTS_PATH', MTF_BP . '/tests/app/');
10+
defined('MTF_STATES_PATH') || define('MTF_STATES_PATH', MTF_BP . '/lib/Magento/Mtf/App/State/');
11+
912
require_once __DIR__ . '/../../../app/bootstrap.php';
1013
restore_error_handler();
1114
require_once __DIR__ . '/vendor/autoload.php';

dev/tests/functional/composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"require": {
3-
"magento/mtf": "1.0.0-rc31",
3+
"magento/mtf": "1.0.0-rc32",
44
"php": "~5.5.0|~5.6.0|~7.0.0",
55
"phpunit/phpunit": "4.1.0",
6-
"phpunit/phpunit-selenium": ">=1.2",
7-
"netwing/selenium-server-standalone": ">=2.35"
6+
"phpunit/phpunit-selenium": ">=1.2"
87
},
98
"suggest": {
9+
"netwing/selenium-server-standalone": "dev-master",
1010
"facebook/webdriver": "dev-master"
1111
},
1212
"autoload": {

dev/tests/functional/composer.json.dist

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

dev/tests/functional/etc/config.xml renamed to dev/tests/functional/etc/config.xml.dist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,11 @@
2121
<baseUrl>http://magento2ce.com/</baseUrl>
2222
<backendName>backend</backendName>
2323
</install>
24+
<handler>
25+
<webapi priority="0">
26+
<token>integration_token</token>
27+
</webapi>
28+
<curl priority="1" />
29+
<ui priority="2" />
30+
</handler>
2431
</config>

dev/tests/functional/etc/config.xsd

Lines changed: 55 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<xs:complexType>
1414
<xs:sequence>
1515
<xs:choice maxOccurs="unbounded">
16-
<xs:element name="reopenBrowser" type="reopenBrowserType"/>
16+
<xs:element name="reopenBrowser" type="reopenBrowserType" />
1717
<xs:element name="backendLogin" type="backendLoginType" />
1818
<xs:element name="backendPassword" type="backendPasswordType" />
1919
<xs:element name="backendLoginUrl" type="backendLoginUrlType" />
@@ -26,7 +26,7 @@
2626
<xs:complexType>
2727
<xs:sequence>
2828
<xs:choice maxOccurs="unbounded">
29-
<xs:element name="resetUrlPath" type="notEmptyType"/>
29+
<xs:element name="resetUrlPath" type="notEmptyType" />
3030
<xs:element name="testSuite" type="isolationModeType" />
3131
<xs:element name="testCase" type="isolationModeType" />
3232
<xs:element name="test" type="isolationModeType" />
@@ -38,7 +38,7 @@
3838
<xs:complexType>
3939
<xs:sequence>
4040
<xs:choice maxOccurs="unbounded" minOccurs="1">
41-
<xs:element name="item" type="serverItemType"/>
41+
<xs:element name="item" type="serverItemType" />
4242
</xs:choice>
4343
</xs:sequence>
4444
</xs:complexType>
@@ -47,7 +47,7 @@
4747
<xs:complexType>
4848
<xs:sequence>
4949
<xs:choice maxOccurs="unbounded">
50-
<xs:element name="host" type="notEmptyType"/>
50+
<xs:element name="host" type="notEmptyType" />
5151
<xs:element name="user" type="notEmptyType" />
5252
<xs:element name="password" type="notEmptyType" />
5353
<xs:element name="dbName" type="notEmptyType" />
@@ -57,51 +57,52 @@
5757
</xs:sequence>
5858
</xs:complexType>
5959
</xs:element>
60+
<xs:element name="handler" minOccurs="1" maxOccurs="1" type="handlerTypes" />
6061
</xs:all>
6162
</xs:complexType>
6263
</xs:element>
6364
<xs:simpleType name="reopenBrowserType">
6465
<xs:restriction base="xs:string">
65-
<xs:pattern value="testCase|test"/>
66+
<xs:pattern value="testCase|test" />
6667
</xs:restriction>
6768
</xs:simpleType>
6869
<xs:simpleType name="backendLoginType">
6970
<xs:restriction base="xs:string">
70-
<xs:minLength value="1"/>
71+
<xs:minLength value="1" />
7172
</xs:restriction>
7273
</xs:simpleType>
7374
<xs:simpleType name="backendLoginUrlType">
7475
<xs:restriction base="xs:string">
75-
<xs:minLength value="1"/>
76+
<xs:minLength value="1" />
7677
</xs:restriction>
7778
</xs:simpleType>
7879
<xs:simpleType name="appBackendUrlType">
7980
<xs:restriction base="xs:string">
80-
<xs:minLength value="1"/>
81+
<xs:minLength value="1" />
8182
</xs:restriction>
8283
</xs:simpleType>
8384
<xs:simpleType name="backendPasswordType">
8485
<xs:restriction base="xs:string">
85-
<xs:minLength value="1"/>
86+
<xs:minLength value="1" />
8687
</xs:restriction>
8788
</xs:simpleType>
8889
<xs:simpleType name="notEmptyType">
8990
<xs:restriction base="xs:string">
90-
<xs:minLength value="1"/>
91+
<xs:minLength value="1" />
9192
</xs:restriction>
9293
</xs:simpleType>
9394
<xs:simpleType name="isolationModeType">
9495
<xs:restriction base="xs:string">
95-
<xs:pattern value="none|before|after|both"/>
96+
<xs:pattern value="none|before|after|both" />
9697
</xs:restriction>
9798
</xs:simpleType>
9899
<xs:simpleType name="serverTypeType">
99100
<xs:restriction base="xs:string">
100-
<xs:pattern value="default"/>
101+
<xs:pattern value="default" />
101102
</xs:restriction>
102103
</xs:simpleType>
103104
<xs:simpleType name="portType">
104-
<xs:restriction base="xs:int"/>
105+
<xs:restriction base="xs:int" />
105106
</xs:simpleType>
106107
<xs:simpleType name="timeoutType">
107108
<xs:restriction base="xs:int">
@@ -111,26 +112,56 @@
111112
<xs:choice>
112113
<xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
113114
</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"/>
115+
<xs:attribute name="type" type="serverTypeType" use="optional" />
116+
<xs:attribute name="name" type="xs:string" use="required" />
117+
<xs:attribute name="browser" type="notEmptyType" />
118+
<xs:attribute name="browserName" type="notEmptyType" />
119+
<xs:attribute name="host" type="notEmptyType" />
120+
<xs:attribute name="port" type="portType" />
121+
<xs:attribute name="seleniumServerRequestsTimeout" type="timeoutType" use="optional" />
122+
<xs:attribute name="sessionStrategy" type="notEmptyType" use="optional" />
122123
</xs:complexType>
123124
<xs:simpleType name="enableDisableType">
124125
<xs:restriction base="xs:string">
125-
<xs:pattern value="false|true"/>
126+
<xs:pattern value="false|true" />
126127
</xs:restriction>
127128
</xs:simpleType>
128129
<xs:complexType name="specificModuleType">
129130
<xs:sequence>
130131
<xs:choice>
131-
<xs:element name="module" type="notEmptyType" maxOccurs="unbounded"/>
132+
<xs:element name="module" type="notEmptyType" maxOccurs="unbounded" />
132133
</xs:choice>
133134
</xs:sequence>
134-
<xs:attribute name="enabled" type="enableDisableType"/>
135+
<xs:attribute name="enabled" type="enableDisableType" />
136+
</xs:complexType>
137+
<xs:complexType name="handlerTypes">
138+
<xs:all>
139+
<xs:element name="webapi" maxOccurs="1" minOccurs="0">
140+
<xs:complexType>
141+
<xs:sequence>
142+
<xs:element type="xs:string" name="token" maxOccurs="1" minOccurs="1"/>
143+
</xs:sequence>
144+
<xs:attribute type="xs:unsignedByte" name="priority" use="required" />
145+
</xs:complexType>
146+
</xs:element>
147+
<xs:element name="curl" maxOccurs="1" minOccurs="0">
148+
<xs:complexType>
149+
<xs:simpleContent>
150+
<xs:extension base="xs:string">
151+
<xs:attribute type="xs:unsignedByte" name="priority" use="required" />
152+
</xs:extension>
153+
</xs:simpleContent>
154+
</xs:complexType>
155+
</xs:element>
156+
<xs:element name="ui" maxOccurs="1" minOccurs="0">
157+
<xs:complexType>
158+
<xs:simpleContent>
159+
<xs:extension base="xs:string">
160+
<xs:attribute type="xs:unsignedByte" name="priority" use="required" />
161+
</xs:extension>
162+
</xs:simpleContent>
163+
</xs:complexType>
164+
</xs:element>
165+
</xs:all>
135166
</xs:complexType>
136167
</xs:schema>

dev/tests/functional/etc/di.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@
1111
<argument name="schemaPath" xsi:type="string">etc/config.xsd</argument>
1212
</arguments>
1313
</virtualType>
14+
15+
<type name="Magento\Mtf\Util\Protocol\CurlTransport\WebapiDecorator" shared="true" />
1416
</config>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
/**
3+
* Copyright © 2015 Magento. All rights reserved.
4+
* See COPYING.txt for license details.
5+
*/
6+
7+
namespace Magento\Mtf\Handler;
8+
9+
use Magento\Mtf\Config\DataInterface;
10+
use Magento\Mtf\System\Event\EventManagerInterface;
11+
use Magento\Mtf\Util\Protocol\CurlTransport\WebapiDecorator;
12+
13+
/**
14+
* Abstract class for webapi handlers.
15+
*/
16+
abstract class Webapi implements HandlerInterface
17+
{
18+
/**
19+
* Configuration parameters array.
20+
*
21+
* @var DataInterface
22+
*/
23+
protected $configuration;
24+
25+
/**
26+
* Event Manager.
27+
*
28+
* @var EventManagerInterface
29+
*/
30+
protected $eventManager;
31+
32+
/**
33+
* Curl transport for webapi.
34+
*
35+
* @var WebapiDecorator.
36+
*/
37+
protected $webapiTransport;
38+
39+
/**
40+
* @constructor
41+
* @param DataInterface $configuration
42+
* @param EventManagerInterface $eventManager
43+
* @param WebapiDecorator $webapiTransport
44+
*/
45+
public function __construct(
46+
DataInterface $configuration,
47+
EventManagerInterface $eventManager,
48+
WebapiDecorator $webapiTransport
49+
) {
50+
$this->configuration = $configuration;
51+
$this->eventManager = $eventManager;
52+
$this->webapiTransport = $webapiTransport;
53+
}
54+
}

0 commit comments

Comments
 (0)