You are here

public function VarbaseWorkflowTest::testCheckVarbaseWorkflowModerationSidebar in Varbase Workflow 2.0.x

Check Varbase Workflow moderation sidebar.

File

tests/src/FunctionalJavascript/VarbaseWorkflowTest.php, line 124

Class

VarbaseWorkflowTest
Tests Varbase Workflow moderation test.

Namespace

Drupal\Tests\varbase_workflow\FunctionalJavascript

Code

public function testCheckVarbaseWorkflowModerationSidebar() {

  // Given that the root super user was logged in to the site.
  $this
    ->drupalLogin($this->rootUser);

  // Create a testing content type.
  $this
    ->drupalGet('admin/structure/types/add');
  $this
    ->assertSession()
    ->pageTextContains('Add content type');
  $page = $this
    ->getSession()
    ->getPage();
  $page
    ->fillField('name', 'News');
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $edit_type_button = $this
    ->assertSession()
    ->waitForElementVisible('css', '#edit-name-machine-name-suffix .link');
  $edit_type_button
    ->click();
  $this
    ->assertSession()
    ->assertWaitOnAjaxRequest();
  $page
    ->fillField('type', 'news');
  $submit = $page
    ->findButton('op');
  $submit
    ->click();
  drupal_flush_all_caches();

  // Create a testing node.
  $this
    ->drupalCreateNode([
    'title' => 'Test News Contnet',
    'type' => 'news',
    'body' => [
      [
        'value' => 'Test body for test news content.',
      ],
    ],
  ]);
  $this
    ->drupalGet('admin/content');
  $this
    ->assertSession()
    ->pageTextContains('Test News Contnet');
  $this
    ->clickLink('Test News Contnet');
  $this
    ->assertSession()
    ->pageTextContains('Tasks');
}