-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #455 from magento-qmt/PR
[Mavericks] Extend functional tests
- Loading branch information
Showing
40 changed files
with
904 additions
and
174 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
dev/tests/functional/lib/Magento/Mtf/Util/Command/Cli/Setup.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Mtf\Util\Command\Cli; | ||
|
||
use Magento\Mtf\Util\Command\Cli; | ||
|
||
/** | ||
* Setup Magento for tests executions. | ||
*/ | ||
class Setup extends Cli | ||
{ | ||
/** | ||
* Parameter for uninstall Magento command. | ||
*/ | ||
const PARAM_SETUP_UNINSTALL = 'setup:uninstall'; | ||
|
||
/** | ||
* Options for uninstall Magento command. | ||
* | ||
* @var array | ||
*/ | ||
private $options = ['-n']; | ||
|
||
/** | ||
* Uninstall Magento. | ||
* | ||
* @return void | ||
*/ | ||
public function uninstall() | ||
{ | ||
parent::execute(Setup::PARAM_SETUP_UNINSTALL, $this->options); | ||
} | ||
} |
38 changes: 0 additions & 38 deletions
38
...nctional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.php
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
...nctional/tests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Attribute.xml
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
...s/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/Tab/UpdateAttributeTab.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Action\Tab; | ||
|
||
use Magento\Mtf\Client\Element\SimpleElement; | ||
use Magento\Mtf\Client\Locator; | ||
use Magento\Backend\Test\Block\Widget\Tab; | ||
|
||
/** | ||
* Tab on Product update attributes Form. | ||
*/ | ||
class UpdateAttributeTab extends Tab | ||
{ | ||
/** | ||
* Change checkbox. | ||
* | ||
* @var string | ||
*/ | ||
private $changeCheckbox = [ | ||
'selector' => './/./ancestor::div[contains(@class,"control")]' | ||
. '//input[@data-role="toggle-editability-all" or contains(@id, "toggle_")]', | ||
'strategy' => Locator::SELECTOR_XPATH, | ||
'input' => 'checkbox', | ||
'value' => 'Yes', | ||
]; | ||
|
||
/** | ||
* Fill data into fields in the container. | ||
* | ||
* @param array $fields | ||
* @param SimpleElement|null $contextElement | ||
* @return $this | ||
*/ | ||
public function setFieldsData(array $fields, SimpleElement $contextElement = null) | ||
{ | ||
$context = ($contextElement === null) ? $this->_rootElement : $contextElement; | ||
$mapping = $this->dataMapping($fields); | ||
foreach ($mapping as $field) { | ||
$this->_fill([$this->changeCheckbox], $context->find($field['selector'], $field['strategy'])); | ||
$this->_fill([$field], $context); | ||
} | ||
|
||
return $this; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
...ests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/UpdateAttributeForm.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Action; | ||
|
||
use Magento\Backend\Test\Block\Widget\FormTabs; | ||
|
||
/** | ||
* Product update Attributes Form. | ||
*/ | ||
class UpdateAttributeForm extends FormTabs | ||
{ | ||
// | ||
} |
28 changes: 28 additions & 0 deletions
28
...ests/app/Magento/Catalog/Test/Block/Adminhtml/Product/Edit/Action/UpdateAttributeForm.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" ?> | ||
<!-- | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<tabs> | ||
<product-details> | ||
<class>Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Action\Tab\UpdateAttributeTab</class> | ||
<selector>#attributes_update_tabs_attributes</selector> | ||
<fields> | ||
<price> | ||
<selector>#price</selector> | ||
</price> | ||
</fields> | ||
</product-details> | ||
<advanced-inventory> | ||
<class>Magento\Catalog\Test\Block\Adminhtml\Product\Edit\Action\Tab\UpdateAttributeTab</class> | ||
<selector>#attributes_update_tabs_inventory</selector> | ||
<fields> | ||
<stock_data> | ||
<selector>#inventory_stock_availability</selector> | ||
<input>select</input> | ||
</stock_data> | ||
</fields> | ||
</advanced-inventory> | ||
</tabs> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
dev/tests/functional/tests/app/Magento/Catalog/Test/Constraint/AssertProductsInStock.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Catalog\Test\Constraint; | ||
|
||
use Magento\Catalog\Test\Page\Product\CatalogProductView; | ||
use Magento\Mtf\Client\BrowserInterface; | ||
use Magento\Mtf\Constraint\AbstractConstraint; | ||
|
||
/** | ||
* Assert that all products are in stock. | ||
*/ | ||
class AssertProductsInStock extends AbstractConstraint | ||
{ | ||
/** | ||
* Assert that In Stock status is displayed for products. | ||
* | ||
* @param CatalogProductView $catalogProductView | ||
* @param BrowserInterface $browser | ||
* @param AssertProductInStock $assertProductInStock | ||
* @param array $products | ||
* @return void | ||
*/ | ||
public function processAssert( | ||
CatalogProductView $catalogProductView, | ||
BrowserInterface $browser, | ||
AssertProductInStock $assertProductInStock, | ||
array $products | ||
) { | ||
foreach ($products as $product) { | ||
$assertProductInStock->processAssert($catalogProductView, $browser, $product); | ||
} | ||
} | ||
|
||
/** | ||
* Returns a string representation of the object. | ||
* | ||
* @return string | ||
*/ | ||
public function toString() | ||
{ | ||
return 'In stock control is visible for each product.'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.