You are here

protected function DeveloperAppFieldTest::assertFieldVisibleOnEntityDisplay in Apigee Edge 8

Asserts whether a field is visible on the entity view.

Parameters

string $app_name: Name of the app.

string $field_label: Label of the field.

string $field_value: Value of the field to assert.

bool $visible: Whether it should be visible or not.

2 calls to DeveloperAppFieldTest::assertFieldVisibleOnEntityDisplay()
DeveloperAppFieldTest::credentialsViewTest in tests/src/Functional/DeveloperAppFieldTest.php
Tests showing and hiding credentials on the developer app view.
DeveloperAppFieldTest::viewRegionTest in tests/src/Functional/DeveloperAppFieldTest.php
Tests the view regions.

File

tests/src/Functional/DeveloperAppFieldTest.php, line 564

Class

DeveloperAppFieldTest
Fieldable developer app test.

Namespace

Drupal\Tests\apigee_edge\Functional

Code

protected function assertFieldVisibleOnEntityDisplay(string $app_name, string $field_label, string $field_value, bool $visible = TRUE) {
  $this
    ->drupalGet(Url::fromRoute('entity.developer_app.canonical_by_developer', [
    'user' => $this->account
      ->id(),
    'app' => $app_name,
  ]));
  if ($visible) {
    $this
      ->assertSession()
      ->pageTextContains($field_label);
    $this
      ->assertSession()
      ->pageTextContains($field_value);
  }
  else {
    $this
      ->assertSession()
      ->pageTextNotContains($field_label);
    $this
      ->assertSession()
      ->pageTextNotContains($field_value);
  }
}