You are here

public function ProductTabsTest::testProductTabs in Ubercart 8.4

Tests presence of the tabs attached to the product node page.

File

uc_product/tests/src/Functional/ProductTabsTest.php, line 41

Class

ProductTabsTest
Tests the product edit page tabs.

Namespace

Drupal\Tests\uc_product\Functional

Code

public function testProductTabs() {

  /** @var \Drupal\Tests\WebAssert $assert */
  $assert = $this
    ->assertSession();
  $product = $this
    ->createProduct();
  $this
    ->drupalGet('node/' . $product
    ->id() . '/edit');

  // Check we are on the edit page.
  $assert
    ->fieldValueEquals('title[0][value]', $product
    ->getTitle());

  // Check that each of the tabs exist.
  $assert
    ->linkExists('Product');
  $assert
    ->linkExists('Attributes');
  $assert
    ->linkExists('Options');
  $assert
    ->linkExists('Adjustments');
  $assert
    ->linkExists('Features');
  $assert
    ->linkExists('Stock');
}