Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CreateSandboxCustomerStep.php
Go to the documentation of this file.
1 <?php
8 
9 use Magento\Mtf\TestStep\TestStepInterface;
10 use Magento\Paypal\Test\Fixture\SandboxCustomer;
11 use Magento\Paypal\Test\Page\Sandbox\AccountSignup;
12 use Magento\Paypal\Test\Page\Sandbox\SignupAddCard;
13 use Magento\Paypal\Test\Page\Sandbox\SignupCreate;
14 
18 class CreateSandboxCustomerStep implements TestStepInterface
19 {
25  protected $sandboxCustomer;
26 
32  protected $accountSignup;
33 
39  protected $signupAddCard;
40 
46  protected $signupCreate;
47 
55  public function __construct(
56  SandboxCustomer $sandboxCustomer,
57  AccountSignup $accountSignup,
58  SignupAddCard $signupAddCard,
59  SignupCreate $signupCreate
60  ) {
61  $this->sandboxCustomer = $sandboxCustomer;
62  $this->accountSignup = $accountSignup;
63  $this->signupAddCard = $signupAddCard;
64  $this->signupCreate = $signupCreate;
65  }
66 
72  public function run()
73  {
74  $this->accountSignup->open();
75  $this->accountSignup->getSignupPersonalAccountBlock()->fill($this->sandboxCustomer);
76  $this->accountSignup->getSignupPersonalAccountBlock()->continueSignup();
77  $this->signupCreate->getSignupCreateBlock()->fill($this->sandboxCustomer);
78  $this->signupCreate->getSignupCreateBlock()->createAccount();
79  $this->signupAddCard->getSignupAddCardBlock()->fill($this->sandboxCustomer);
80  $this->signupAddCard->getSignupAddCardBlock()->linkCardToAccount();
81  }
82 }
__construct(SandboxCustomer $sandboxCustomer, AccountSignup $accountSignup, SignupAddCard $signupAddCard, SignupCreate $signupCreate)