Skip to content

Commit

Permalink
Merge pull request #451 from magento-qmt/develop
Browse files Browse the repository at this point in the history
[Mavericks] Move all test data to repositories
  • Loading branch information
vpelipenko committed Jul 14, 2015
2 parents 375077a + 3a7ec70 commit 1ea9173
Show file tree
Hide file tree
Showing 452 changed files with 7,385 additions and 12,257 deletions.
2 changes: 1 addition & 1 deletion dev/tests/functional/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": {
"magento/mtf": "1.0.0-rc27",
"magento/mtf": "1.0.0-rc28",
"php": "~5.5.0|~5.6.0",
"phpunit/phpunit": "4.1.0",
"phpunit/phpunit-selenium": ">=1.2",
Expand Down
62 changes: 0 additions & 62 deletions dev/tests/functional/lib/Magento/Mtf/Fixture/DataSource.php

This file was deleted.

4 changes: 2 additions & 2 deletions dev/tests/functional/phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
</listeners>

<php>
<env name="app_frontend_url" value="http://localhost/index.php/" />
<env name="app_backend_url" value="http://localhost/index.php/backend/" />
<env name="app_frontend_url" value="http://localhost/" />
<env name="app_backend_url" value="http://localhost/backend/" />
<env name="testsuite_rule" value="basic" />
<env name="testsuite_rule_path" value="Magento/Mtf/TestSuite/InjectableTests" />
<env name="log_directory" value="var/log" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
<data name="description" xsi:type="string">MAGETWO-12832 - Check Out as a Guest with Authorize.Net and Offline Shipping method</data>
<data name="products" xsi:type="string">catalogProductSimple::product_10_dollar, configurableProduct::with_one_option, bundleProduct::bundle_fixed_100_dollar_product</data>
<data name="taxRule" xsi:type="string">us_ca_ny_rule</data>
<data name="customer/dataSet" xsi:type="string">default</data>
<data name="billingAddress/dataSet" xsi:type="string">US_address_1</data>
<data name="customer/dataset" xsi:type="string">default</data>
<data name="billingAddress/dataset" xsi:type="string">US_address_1</data>
<data name="checkoutMethod" xsi:type="string">guest</data>
<data name="shipping/shipping_service" xsi:type="string">Flat Rate</data>
<data name="shipping/shipping_method" xsi:type="string">Fixed</data>
<data name="prices" xsi:type="array">
<item name="grandTotal" xsi:type="string">156.81</item>
</data>
<data name="payment/method" xsi:type="string">authorizenet</data>
<data name="creditCard/dataSet" xsi:type="string">visa_default</data>
<data name="creditCard/dataset" xsi:type="string">visa_default</data>
<data name="configData" xsi:type="string">authorizenet</data>
<data name="tag" xsi:type="string">test_type:3rd_party_test</data>
<constraint name="Magento\Checkout\Test\Constraint\AssertOrderSuccessPlacedMessage"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ abstract class Grid extends Block
*
* @var string
*/
protected $rowPattern = '//tr[%s]';
protected $rowPattern = '//tbody/tr[%s]';

/**
* Get backend abstract block
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd">
<fixture name="globalSearch" module="Magento_Backend" class="Magento\Backend\Test\Fixture\GlobalSearch">
<dataset name="default">
<field name="query" xsi:type="string">catalogProductSimple::default::name</field>
</dataset>
<field name="query" source="Magento\Backend\Test\Fixture\GlobalSearch\Query"/>
</fixture>
<fixture name="globalSearch"
module="Magento_Backend"
class="Magento\Backend\Test\Fixture\GlobalSearch">
<field name="query" source="Magento\Backend\Test\Fixture\GlobalSearch\Query" />
</fixture>
</config>
Original file line number Diff line number Diff line change
Expand Up @@ -6,40 +6,23 @@

namespace Magento\Backend\Test\Fixture\GlobalSearch;

use Magento\Mtf\Fixture\DataSource;
use Magento\Mtf\Fixture\FixtureFactory;
use Magento\Mtf\Fixture\FixtureInterface;
use Magento\Mtf\Fixture\InjectableFixture;

/**
* Class Query
* Global Search query data provider
* Global Search query data provider.
*/
class Query implements FixtureInterface
class Query extends DataSource
{
/**
* Prepared dataSet data
*
* @var array
*/
protected $data;

/**
* Data set configuration settings
*
* @var array
*/
protected $params;

/**
* Data source entity
* Data source entity.
*
* @var InjectableFixture
*/
protected $entity = null;

/**
* Constructor
*
* @constructor
* @param FixtureFactory $fixtureFactory
* @param string $data
Expand All @@ -54,17 +37,17 @@ public function __construct(FixtureFactory $fixtureFactory, $data, array $params
$this->data = $explodedData[0];
break;
case 3:
list($fixture, $dataSet, $field) = $explodedData;
$entity = $fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]);
list($fixture, $dataset, $field) = $explodedData;
$entity = $fixtureFactory->createByCode($fixture, ['dataset' => $dataset]);
if (!$entity->hasData('id')) {
$entity->persist();
}
$this->data = $entity->getData($field);
$this->entity = $entity;
break;
case 4:
list($fixture, $dataSet, $source, $field) = $explodedData;
$entity = $fixtureFactory->createByCode($fixture, ['dataSet' => $dataSet]);
list($fixture, $dataset, $source, $field) = $explodedData;
$entity = $fixtureFactory->createByCode($fixture, ['dataset' => $dataset]);
if (!$entity->hasData('id')) {
$entity->persist();
}
Expand All @@ -76,45 +59,12 @@ public function __construct(FixtureFactory $fixtureFactory, $data, array $params
}

/**
* Persist order products
*
* @return void
*/
public function persist()
{
//
}

/**
* Return prepared data set
*
* @param string $key [optional]
* @return mixed
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function getData($key = null)
{
return $this->data;
}

/**
* Get entity for global search
* Get entity for global search.
*
* @return InjectableFixture
*/
public function getEntity()
{
return $this->entity;
}

/**
* Return data set configuration settings
*
* @return string
*/
public function getDataConfig()
{
return $this->params;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,18 @@

namespace Magento\Backend\Test\Fixture\Source;

use Magento\Mtf\Fixture\FixtureInterface;
use Magento\Mtf\Fixture\DataSource;

/**
* Class Date
* Class Date.
*
* Data keys:
* - pattern (Format a local time/date with delta, e.g. 'm-d-Y -3 days' = current day - 3 days)
*/
class Date implements FixtureInterface
class Date extends DataSource
{
/**
* Date for fill on form
*
* @var string
*/
protected $data;

/**
* @constructor
* @param array $params
* @param array $data
* @throws \Exception
Expand All @@ -48,37 +42,4 @@ public function __construct(array $params, array $data = [])
$this->data = $date;
}
}

/**
* Persists prepared data into application
*
* @return void
*/
public function persist()
{
//
}

/**
* Return prepared data set
*
* @param $key [optional]
* @return mixed
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function getData($key = null)
{
return $this->data;
}

/**
* Return data set configuration settings
*
* @return string
*/
public function getDataConfig()
{
return $this->params;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Steps:
* 1. Login to backend
* 2. Click on Search button on the top of page
* 3. Fill in data according dataSet
* 3. Fill in data according dataset
* 4. Perform assertions
*
* @group Search_Core_(MX)
Expand Down Expand Up @@ -58,7 +58,7 @@ public function __inject(Dashboard $dashboard)
*/
public function test(GlobalSearch $search)
{
//Steps:
// Steps:
$this->dashboard->open();
$this->dashboard->getAdminPanelHeader()->search($search->getQuery());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class AssertBundleInCategory extends AssertProductInCategory
protected function assertPrice(FixtureInterface $bundle, CatalogCategoryView $catalogCategoryView)
{
/** @var BundleProduct $bundle */
$priceData = $bundle->getDataFieldConfig('price')['source']->getPreset();
$priceData = $bundle->getDataFieldConfig('price')['source']->getPriceData();
//Price from/to verification
$priceBlock = $catalogCategoryView->getListProductBlock()->getProductItem($bundle)->getPriceBlock();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
use Magento\Mtf\Constraint\AbstractAssertForm;

/**
* Class AssertBundleItemsOnProductPage
* Assert that displayed product bundle items data on product page equals passed from fixture preset
* Assert that displayed product bundle items data on product page equals passed from fixture
*/
class AssertBundleItemsOnProductPage extends AbstractAssertForm
{
/**
* Assert that displayed product bundle items data on product page equals passed from fixture preset
* Assert that displayed product bundle items data on product page equals passed from fixture.
*
* @param CatalogProductView $catalogProductView
* @param BundleProduct $product
Expand Down Expand Up @@ -48,7 +47,7 @@ public function processAssert(
}

/**
* Prepare bundle options
* Prepare bundle options.
*
* @param BundleProduct $product
* @return array
Expand Down Expand Up @@ -89,12 +88,12 @@ protected function prepareBundleOptions(BundleProduct $product)
}

/**
* Return Text if displayed on frontend equals with fixture
* Return Text if displayed on frontend equals with fixture.
*
* @return string
*/
public function toString()
{
return 'Bundle options data on product page equals to passed from fixture preset.';
return 'Bundle options data on product page equals to passed from fixture dataset.';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ protected function assertPrice(
'Bundle item ' . ($index + 1) . ' options on frontend don\'t equal to fixture.'
);
}
$sumOptionsPrice = $product->getDataFieldConfig('price')['source']->getPreset()['cart_price'];
$sumOptionsPrice = $product->getDataFieldConfig('price')['source']->getPriceData()['cart_price'];

$subTotal = number_format($cartItem->getPrice(), 2);
\PHPUnit_Framework_Assert::assertEquals(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function processAssert(
*/
protected function assertPrice(BundleProduct $product, CatalogProductView $catalogProductView)
{
$priceData = $product->getDataFieldConfig('price')['source']->getPreset();
$priceData = $product->getDataFieldConfig('price')['source']->getPriceData();
$priceView = $product->getPriceView();
$priceBlock = $catalogProductView->getViewBlock()->getPriceBlock();

Expand Down
Loading

0 comments on commit 1ea9173

Please sign in to comment.