-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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 #374 from magento-qmt/PR
[Mavericks] Update PHPUnit for Functional tests and extend tests - MTA-3311 Upgrade PHPUnit to the Latest Version - MTA-3225 Bundle: Extend existing functional automated tests - MTA-3484 Resolve an issue with upgrade to the latest Selenium and FF
- Loading branch information
Showing
17 changed files
with
551 additions
and
54 deletions.
There are no files selected for viewing
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
57 changes: 57 additions & 0 deletions
57
dev/tests/functional/lib/Magento/Mtf/Client/Element/RadiobuttonElement.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,57 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Mtf\Client\Element; | ||
|
||
use Magento\Mtf\Client\Locator; | ||
|
||
/** | ||
* Class provides ability to work with page element radio button. | ||
*/ | ||
class RadiobuttonElement extends SimpleElement | ||
{ | ||
/** | ||
* Label for radio button selector. | ||
* | ||
* @var string | ||
*/ | ||
protected $labelSelector = './..//label[contains(., "%s")]'; | ||
|
||
/** | ||
* Selector for selected label. | ||
* | ||
* @var string | ||
*/ | ||
protected $selectedLabelSelector = 'input[type=radio]:checked + label'; | ||
|
||
/** | ||
* Get value of the required element. | ||
* | ||
* @return string | ||
*/ | ||
public function getValue() | ||
{ | ||
$this->eventManager->dispatchEvent(['get_value'], [$this->getAbsoluteSelector()]); | ||
|
||
return $this->find($this->selectedLabelSelector)->getText(); | ||
} | ||
|
||
/** | ||
* Select radio button based on label value. | ||
* | ||
* @param string $value | ||
* @return void | ||
*/ | ||
public function setValue($value) | ||
{ | ||
$this->eventManager->dispatchEvent(['set_value'], [__METHOD__, $this->getAbsoluteSelector()]); | ||
|
||
$radioButtonLabel = $this->find(sprintf($this->labelSelector, $value), Locator::SELECTOR_XPATH); | ||
if (!$this->isSelected()) { | ||
$radioButtonLabel->click(); | ||
} | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
dev/tests/functional/tests/app/Magento/Bundle/Test/Constraint/AssertBundleProductInCart.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,44 @@ | ||
<?php | ||
/** | ||
* Copyright © 2016 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Bundle\Test\Constraint; | ||
|
||
use Magento\Catalog\Test\Constraint\AssertProductInCart; | ||
use Magento\Checkout\Test\Page\CheckoutCart; | ||
use Magento\Mtf\Fixture\FixtureInterface; | ||
|
||
/** | ||
* Assertion that bundle product is correctly displayed in cart. | ||
*/ | ||
class AssertBundleProductInCart extends AssertProductInCart | ||
{ | ||
/** | ||
* Count prices. | ||
* | ||
* @param FixtureInterface $product | ||
* @param CheckoutCart $checkoutCart | ||
* @return void | ||
*/ | ||
protected function countPrices(FixtureInterface $product, CheckoutCart $checkoutCart) | ||
{ | ||
parent::countPrices($product, $checkoutCart); | ||
$this->countSubItemPrice($product); | ||
} | ||
|
||
/** | ||
* Count subItem price. | ||
* | ||
* @param FixtureInterface $product | ||
* @return void | ||
*/ | ||
private function countSubItemPrice(FixtureInterface $product) | ||
{ | ||
$checkoutData = $product->getCheckoutData(); | ||
if (isset($checkoutData['cartItem']['subItemPrice'])) { | ||
$this->fixtureActualPrice += $checkoutData["cartItem"]["subItemPrice"]; | ||
} | ||
} | ||
} |
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
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.