-
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 #389 from magento-south/BUGS
[SOUTH] Bugs
- Loading branch information
Showing
15 changed files
with
239 additions
and
130 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
66 changes: 66 additions & 0 deletions
66
dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Cart/GiftOptions.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,66 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\GiftMessage\Test\Block\Cart; | ||
|
||
use Magento\GiftMessage\Test\Fixture\GiftMessage; | ||
use Magento\Mtf\Block\Form; | ||
|
||
/** | ||
* Class GiftOptions | ||
* Add gift options on checkout cart order level | ||
*/ | ||
class GiftOptions extends Form | ||
{ | ||
/** | ||
* Selector for gift message on order form | ||
* | ||
* @var string | ||
*/ | ||
protected $giftMessageOrderForm = ".gift-message fieldset"; | ||
|
||
/** | ||
* Allow gift message on order level | ||
* | ||
* @var string | ||
*/ | ||
protected $allowGiftOptions = '.title'; | ||
|
||
/** | ||
* Selector for apply Gift Message button on item | ||
* | ||
* @var string | ||
*/ | ||
protected $giftMessageOrderButton = ".action-update"; | ||
|
||
/** | ||
* Selector for Gift Message Summary | ||
* | ||
* @var string | ||
*/ | ||
protected $giftMessageSummary = ".gift-message-summary"; | ||
|
||
/** | ||
* Fill gift message form on order level | ||
* | ||
* @param GiftMessage $giftMessage | ||
* @return void | ||
*/ | ||
public function fillGiftMessageOrder(GiftMessage $giftMessage) | ||
{ | ||
/** @var \Magento\GiftMessage\Test\Block\Cart\GiftOptions\GiftMessageForm $giftMessageForm */ | ||
if ($giftMessage->getAllowGiftMessagesForOrder() === 'Yes') { | ||
$this->_rootElement->find($this->allowGiftOptions)->click(); | ||
$giftMessageForm = $this->blockFactory->create( | ||
'Magento\GiftMessage\Test\Block\Cart\GiftOptions\GiftMessageForm', | ||
['element' => $this->_rootElement->find($this->giftMessageOrderForm)] | ||
); | ||
$giftMessageForm->fill($giftMessage); | ||
$this->_rootElement->find($this->giftMessageOrderButton)->click(); | ||
$this->waitForElementVisible($this->giftMessageSummary); | ||
} | ||
} | ||
} |
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
82 changes: 82 additions & 0 deletions
82
dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Cart/Item/GiftOptions.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,82 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\GiftMessage\Test\Block\Cart\Item; | ||
|
||
use Magento\GiftMessage\Test\Fixture\GiftMessage; | ||
use Magento\Mtf\Block\Form; | ||
use Magento\Mtf\Client\Locator; | ||
|
||
/** | ||
* Add gift options on checkout cart item level | ||
*/ | ||
class GiftOptions extends Form | ||
{ | ||
/** | ||
* Selector for gift message on item form | ||
* | ||
* @var string | ||
*/ | ||
protected $giftMessageItemForm = '//div[@class="gift-message"]//fieldset[ancestor::tbody[contains(.,"%s")]]'; | ||
|
||
/** | ||
* Allow Gift Options for items | ||
* | ||
* @var string | ||
*/ | ||
protected $allowGiftOptions = '//a[contains(@class,"action-gift")][ancestor::tbody[contains(.,"%s")]]'; | ||
|
||
/** | ||
* Selector for apply Gift Message button on order | ||
* | ||
* @var string | ||
*/ | ||
protected $giftMessageItemButton = ".action-update"; | ||
|
||
/** | ||
* Selector for Gift Message Summary | ||
* | ||
* @var string | ||
*/ | ||
protected $giftMessageSummary = '//div[@class="gift-message-summary"][ancestor::tbody[contains(.,"%s")]]'; | ||
|
||
/** | ||
* Fill gift message form on item level | ||
* | ||
* @param GiftMessage $giftMessage | ||
* @param array $products | ||
* @return void | ||
*/ | ||
public function fillGiftMessageItem(GiftMessage $giftMessage, $products = []) | ||
{ | ||
/** @var \Magento\GiftMessage\Test\Block\Cart\GiftOptions\GiftMessageForm $giftMessageForm */ | ||
if ($giftMessage->getAllowGiftOptionsForItems() === 'Yes') { | ||
foreach ($products as $product) { | ||
if ($product->getIsVirtual() !== 'Yes') { | ||
$this->_rootElement->find( | ||
sprintf($this->allowGiftOptions, $product->getName()), | ||
Locator::SELECTOR_XPATH | ||
)->click(); | ||
$giftMessageForm = $this->blockFactory->create( | ||
'Magento\GiftMessage\Test\Block\Cart\GiftOptions\GiftMessageForm', | ||
[ | ||
'element' => $this->_rootElement->find( | ||
sprintf($this->giftMessageItemForm, $product->getName()), | ||
Locator::SELECTOR_XPATH | ||
) | ||
] | ||
); | ||
$giftMessageForm->fill($giftMessage); | ||
$this->_rootElement->find($this->giftMessageItemButton)->click(); | ||
$this->waitForElementVisible( | ||
sprintf($this->giftMessageSummary, $product->getName()), | ||
Locator::SELECTOR_XPATH | ||
); | ||
} | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
87 changes: 0 additions & 87 deletions
87
dev/tests/functional/tests/app/Magento/GiftMessage/Test/Block/Message/Inline.php
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.