You are here

protected function PurchaseOrderTest::assertCheckoutProgressStep in Commerce Purchase Order 8

Asserts the current step in the checkout progress block.

Parameters

string $expected: The expected value.

1 call to PurchaseOrderTest::assertCheckoutProgressStep()
PurchaseOrderTest::testPurchaseOrderCheckout in tests/src/Functional/PurchaseOrderTest.php
Tests anonymous and authenticated checkout.

File

tests/src/Functional/PurchaseOrderTest.php, line 182

Class

PurchaseOrderTest
Tests the checkout of an order.

Namespace

Drupal\Tests\commerce_purchase_order\Functional

Code

protected function assertCheckoutProgressStep($expected) {
  $current_step_node = $this
    ->getSession()
    ->getPage()
    ->find('css', '.checkout-progress--step__current');
  if (!$current_step_node instanceof NodeElement) {
    $this
      ->fail('Checkout progress element is not present.');
  }
  $current_step = $current_step_node
    ->getText();
  $this
    ->assertEquals($expected, $current_step);
}