-
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 #233 from magento-mpi/MAGETWO-45682
[MPI] Sprint 73 Functional tests and Bugfix
- Loading branch information
Showing
36 changed files
with
772 additions
and
208 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
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
20 changes: 20 additions & 0 deletions
20
dev/tests/functional/tests/app/Magento/Authorizenet/Test/Fixture/CreditCardAuthorizenet.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,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> | ||
<fixture name="credit_card_authorizenet" | ||
module="Magento_Authorizenet" | ||
type="virtual" | ||
entity_type="credit_card_authorizenet" | ||
repository_class="Magento\Authorizenet\Test\Repository\CreditCard" | ||
class="Magento\Authorizenet\Test\Fixture\CreditCardAuthorizenet"> | ||
<field name="cc_number" /> | ||
<field name="cc_exp_month" /> | ||
<field name="cc_exp_year" /> | ||
<field name="cc_cid" /> | ||
</fixture> | ||
</config> |
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
46 changes: 46 additions & 0 deletions
46
dev/tests/functional/tests/app/Magento/Braintree/Test/Block/Form/Cc.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,46 @@ | ||
<?php | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
|
||
namespace Magento\Braintree\Test\Block\Form; | ||
|
||
|
||
use Magento\Mtf\Block\Mapper; | ||
use Magento\Mtf\Client\Locator; | ||
use Magento\Mtf\Block\BlockFactory; | ||
use Magento\Mtf\Client\BrowserInterface; | ||
use Magento\Mtf\Client\Element\SimpleElement; | ||
use Magento\Mtf\Fixture\FixtureInterface; | ||
use Magento\Payment\Test\Block\Form\Cc as CreditCard; | ||
|
||
/** | ||
* Class Cc | ||
* Form for filling credit card data for Braintree payment method | ||
*/ | ||
class Cc extends CreditCard | ||
{ | ||
/** | ||
* Braintree iFrame locator | ||
* | ||
* @var array | ||
*/ | ||
protected $braintreeForm = [ | ||
"credit_card_number" => "#braintree-hosted-field-number", | ||
"credit_card_exp_month" => "#braintree-hosted-field-expirationMonth", | ||
"credit_card_exp_year" => "#braintree-hosted-field-expirationYear", | ||
"cvv" => "#braintree-hosted-field-cvv", | ||
]; | ||
|
||
public function fill(FixtureInterface $fixture, SimpleElement $element = null) | ||
{ | ||
$mapping = $this->dataMapping($fixture->getData()); | ||
foreach ($this->braintreeForm as $field => $iframe) { | ||
$this->browser->switchToFrame(new Locator($iframe)); | ||
$element = $this->browser->find('body'); | ||
$this->_fill([$mapping[$field]], $element); | ||
$this->browser->switchToFrame(); | ||
} | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
dev/tests/functional/tests/app/Magento/Braintree/Test/Block/Form/Cc.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,23 @@ | ||
<?xml version="1.0" ?> | ||
<!-- | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<mapping strict="0"> | ||
<fields> | ||
<credit_card_number> | ||
<selector>#credit-card-number</selector> | ||
</credit_card_number> | ||
<credit_card_exp_month> | ||
<selector>#expiration-month</selector> | ||
</credit_card_exp_month> | ||
<credit_card_exp_year> | ||
<selector>#expiration-year</selector> | ||
</credit_card_exp_year> | ||
<cvv> | ||
<selector>#cvv</selector> | ||
</cvv> | ||
</fields> | ||
</mapping> |
20 changes: 20 additions & 0 deletions
20
dev/tests/functional/tests/app/Magento/Braintree/Test/Fixture/CreditCardBraintree.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,20 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/fixture.xsd"> | ||
<fixture name="credit_card_braintree" | ||
module="Magento_Braintree" | ||
type="virtual" | ||
entity_type="credit_card_braintree" | ||
repository_class="Magento\Braintree\Test\Repository\CreditCard" | ||
class="Magento\Braintree\Test\Fixture\CreditCardBraintree"> | ||
<field name="credit_card_number" /> | ||
<field name="credit_card_exp_month" /> | ||
<field name="credit_card_exp_year" /> | ||
<field name="cvv" /> | ||
</fixture> | ||
</config> |
12 changes: 12 additions & 0 deletions
12
dev/tests/functional/tests/app/Magento/Braintree/Test/Page/CheckoutOnepage.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,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- | ||
/** | ||
* Copyright © 2015 Magento. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../vendor/magento/mtf/etc/pages.xsd"> | ||
<page name="CheckoutOnepage" mca="checkout/index"> | ||
<block name="braintreeBlock" class="\Magento\Braintree\Test\Block\Form\Сс" locator="body" strategy="xpath"/> | ||
</page> | ||
</config> |
Oops, something went wrong.