Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
AssertReorderButtonIsNotVisibleOnFrontend.php
Go to the documentation of this file.
1 <?php
8 
10 use Magento\Customer\Test\Page\CustomerAccountIndex;
11 use Magento\Mtf\Constraint\AbstractConstraint;
12 use Magento\Mtf\ObjectManager;
14 use Magento\Sales\Test\Page\OrderHistory;
15 
19 class AssertReorderButtonIsNotVisibleOnFrontend extends AbstractConstraint
20 {
21  /* tags */
22  const SEVERITY = 'low';
23  /* end tags */
24 
38  public function processAssert(
39  OrderInjectable $order,
40  Customer $customer,
41  ObjectManager $objectManager,
42  CustomerAccountIndex $customerAccountIndex,
43  OrderHistory $orderHistory,
44  $status = null,
45  $orderId = '',
46  $statusToCheck = null
47  ) {
48  $filter = [
49  'id' => $order->hasData('id') ? $order->getId() : $orderId,
50  'status' => $statusToCheck === null ? $status : $statusToCheck,
51  ];
52 
53  $objectManager->create(
54  \Magento\Customer\Test\TestStep\LoginCustomerOnFrontendStep::class,
55  ['customer' => $customer]
56  )->run();
57  $customerAccountIndex->getAccountMenuBlock()->openMenuItem('My Orders');
58  $errorMessage = implode(', ', $filter);
59  \PHPUnit\Framework\Assert::assertFalse(
60  $orderHistory->getOrderHistoryBlock()->isReorderButtonPresentByOrderId($filter['id']),
61  '"Reorder" button for order with following data \'' . $errorMessage
62  . '\' is present in Orders block on frontend.'
63  );
64  }
65 
71  public function toString()
72  {
73  return '"Reorder" button is not present in orders on frontend.';
74  }
75 }
processAssert(OrderInjectable $order, Customer $customer, ObjectManager $objectManager, CustomerAccountIndex $customerAccountIndex, OrderHistory $orderHistory, $status=null, $orderId='', $statusToCheck=null)
$objectManager
Definition: bootstrap.php:17
$customer
Definition: customers.php:11
$order
Definition: order.php:55
$status
Definition: order_status.php:8
taxRateField this edit on("click.mselect-delete", ".mselect-delete", function() { if(!confirm('<?=/*@escapeNotVerified */__( 'Do you really want to delete this tax rate?') ?>')) { return;} var that=$(this), select=that.closest('.mselect-list').prev(), rateValue=that.parent().find( 'input[type="checkbox"]').val();$( 'body').trigger( 'processStart');var ajaxOptions={ type:'POST', data:{ tax_calculation_rate_id:rateValue, form_key:$( 'input[name="form_key"]').val() }, dataType:'json', url:'<?=/*@escapeNotVerified */$block->getTaxRateDeleteUrl() ?>', success:function(result, status) { $( 'body').trigger( 'processStop');if(result.success) { that.parent().remove();select.find( 'option').each(function() { if(this.value===rateValue) { $(this).remove();} });select.trigger( 'change.hiddenSelect');} else { if(result.error_message) alert({ content:result.error_message });else alert({ content:'<?=/*@escapeNotVerified */__( 'An error occurred') ?>' });} }, error:function() { $( 'body').trigger( 'processStop');alert({ content:'<?=/*@escapeNotVerified */__( 'An error occurred') ?>' });} };$.ajax(ajaxOptions);}) .on( 'click.mselectAdd'
Definition: edit.phtml:164