Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Secure3d.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\Client\Locator;
10 use Magento\Mtf\Client\Element\SimpleElement;
11 use Magento\Mtf\Fixture\FixtureInterface;
12 use Magento\Mtf\Block\Form;
13 
17 class Secure3d extends Form
18 {
24  protected $braintree3dSecure = "//iframe[contains(@src, 'braintreegateway.com/3ds')]";
25 
31  protected $submitButton = 'input[name="UsernamePasswordEntry"]';
32 
38  public function switchToFrame($locator)
39  {
40  $this->browser->switchToFrame(new Locator($locator, Locator::SELECTOR_XPATH));
41  $this->browser->switchToFrame(new Locator($locator, Locator::SELECTOR_XPATH));
42  }
43 
49  public function submit()
50  {
51  $this->browser->find($this->submitButton)->click();
52  }
53 
61  public function fill(FixtureInterface $fixture, SimpleElement $element = null)
62  {
63  $mapping = $this->dataMapping($fixture->getData());
64  $this->switchToFrame($this->braintree3dSecure);
65  $element = $this->browser->find('body');
66  $this->_fill([$mapping['secure3d_password']], $element);
67  $this->submit();
68  $this->browser->switchToFrame();
69  }
70 }
fill(FixtureInterface $fixture, SimpleElement $element=null)
Definition: Secure3d.php:61
$element
Definition: element.phtml:12