diff --git a/src/Tests/ContentAccessTestHelp.php b/src/Tests/ContentAccessTestHelp.php
deleted file mode 100644
index 2171df7..0000000
--- a/src/Tests/ContentAccessTestHelp.php
+++ /dev/null
@@ -1,149 +0,0 @@
-<?php
-
-namespace Drupal\content_access\Tests;
-
-use Drupal\Core\Session\AccountInterface;
-use Drupal\node\NodeInterface;
-use Drupal\user\Entity\Role;
-use Drupal\simpletest\WebTestBase;
-
-/**
- * Helper class with auxiliary functions for content access module tests.
- */
-class ContentAccessTestHelp extends WebTestBase {
-
-  protected $test_user;
-  protected $rid = AccountInterface::AUTHENTICATED_ROLE;
-  protected $admin_user;
-  protected $content_type;
-  protected $url_content_type_name;
-  protected $node1;
-  protected $node2;
-
-  /**
-   * Modules to enable.
-   *
-   * @var array
-   */
-  public static $modules = ['content_access', 'acl'];
-
-  /**
-   * Preparation work that is done before each test.
-   * Test users, content types, nodes etc. are created.
-   */
-  public function setUp() {
-    parent::setUp();
-
-    // Create test user with separate role.
-    $this->test_user = $this->drupalCreateUser();
-
-    // Get the value of the new role.
-    // @see drupalCreateUser().
-    $test_user_roles = $this->test_user->getRoles();
-    foreach ($test_user_roles as $role) {
-      if (!in_array($role, [AccountInterface::AUTHENTICATED_ROLE])) {
-        $this->rid = $role;
-        break;
-      }
-    }
-
-    // Create admin user.
-    $this->admin_user = $this->drupalCreateUser([
-      'access content',
-      'administer content types',
-      'grant content access',
-      'grant own content access',
-      'administer nodes',
-      'access administration pages'
-    ]);
-    $this->drupalLogin($this->admin_user);
-
-    // Rebuild content access permissions.
-    node_access_rebuild();
-
-    // Create test content type.
-    $this->content_type = $this->drupalCreateContentType();
-  }
-
-  /**
-   * Change access permissions for a content type.
-   */
-  function changeAccessContentType($access_settings) {
-    $this->drupalPostForm(
-      'admin/structure/types/manage/' . $this->content_type->id() . '/access',
-      $access_settings,
-      t('Submit')
-    );
-    $this->assertText(
-      t('Your changes have been saved.'),
-      'access rules of content type were updated successfully'
-    );
-  }
-
-  /**
-   * Change access permissions for a content type by a given keyword
-   * for the role of the user.
-   */
-  function changeAccessContentTypeKeyword($keyword, $access = TRUE, AccountInterface $user = NULL) {
-    $roles = array();
-
-    if ($user === NULL) {
-      $role = Role::load($this->rid);
-      $roles[$role->id()] = $role->id();
-    }
-    else {
-      $user_roles = $user->getRoles();
-      foreach ($user_roles as $role) {
-        $roles[$role] = $role;
-        break;
-      }
-    }
-
-    $access_settings = [
-      $keyword . '[' . key($roles) . ']' => $access,
-    ];
-
-    $this->changeAccessContentType($access_settings);
-  }
-
-  /**
-   * Change the per node access setting for a content type.
-   */
-  function changeAccessPerNode($access = TRUE) {
-    $access_permissions = [
-      'per_node' => $access,
-    ];
-    $this->changeAccessContentType($access_permissions);
-  }
-
-  /**
-   * Change access permissions for a node by a given keyword
-   * (view, update or delete).
-   */
-  function changeAccessNodeKeyword(NodeInterface $node, $keyword, $access = TRUE) {
-    $user = $this->test_user;
-    $user_roles = $user->getRoles();
-    foreach ($user_roles as $rid) {
-      $role = Role::load($rid);
-      $roles[$role->id()] = $role->get('label');
-    }
-
-    $access_settings = [
-      $keyword . '[' . key($roles) . ']' => $access,
-    ];
-
-    $this->changeAccessNode($node, $access_settings);
-  }
-
-  /**
-   * Change access permission for a node.
-   */
-  function changeAccessNode(NodeInterface $node, $access_settings) {
-    $this->drupalPostForm('node/' . $node->id() . '/access', $access_settings, t('Submit'));
-    $this->assertText(
-      t('Your changes have been saved.'),
-      'access rules of node were updated successfully'
-    );
-  }
-
-}
diff --git a/src/Tests/ContentAccessAclTestCase.php b/tests/src/Functional/ContentAccessAclTest.php
similarity index 55%
rename from src/Tests/ContentAccessAclTestCase.php
rename to tests/src/Functional/ContentAccessAclTest.php
index aecb909..dd41c4c 100644
--- a/src/Tests/ContentAccessAclTestCase.php
+++ b/tests/src/Functional/ContentAccessAclTest.php
@@ -1,49 +1,46 @@
 <?php
 
-namespace Drupal\content_access\Tests;
+namespace Drupal\Tests\content_access\Functional;
 
 /**
- * Automated SimpleTest Case for using content access module with acl module.
+ * Browser tests for using content access module with acl module.
  *
- * @group Access
+ * @group content_access
  */
-class ContentAccessAclTestCase extends ContentAccessTestHelp {
+class ContentAccessAclTest extends ContentAccessBrowserTestBase {
 
   /**
-   * Implementation of getInfo() for information.
+   * Modules to enable for this test.
+   *
+   * @var string[]
    */
-  public static function getInfo() {
-    return array(
-      'name' => t('Content Access Module with ACL Module Tests'),
-      'description' => t('Various tests to check the combination of content access and ACL module.'),
-      'group' => 'Content Access',
-    );
-  }
+  public static $modules = [
+    'node',
+    'content_access',
+    'acl',
+  ];
+
+  /**
+   * Node used for testing.
+   *
+   * @var \Drupal\node\NodeInterface
+   */
+  protected $node1;
 
   /**
    * Setup configuration before each test.
    */
-  function setUp() {
+  public function setUp() {
     parent::setUp();
 
-    if (!\Drupal::moduleHandler()->moduleExists('acl')) {
-      $this->pass('No ACL module present, skipping test');
-      return;
-    }
-
     // Create test node.
-    $this->node1 = $this->drupalCreateNode(['type' => $this->content_type->id()]);
+    $this->node1 = $this->drupalCreateNode(['type' => $this->contentType->id()]);
   }
 
   /**
    * Test Viewing accessibility with permissions for single users.
    */
-  function testViewAccess() {
-    // Exit test if ACL module could not be enabled.
-    if (!\Drupal::moduleHandler()->moduleExists('acl')) {
-      $this->pass('No ACL module present, skipping test');
-      return;
-    }
+  public function testViewAccess() {
 
     // Restrict access to this content type.
     // Enable per node access control.
@@ -56,7 +53,7 @@ class ContentAccessAclTestCase extends ContentAccessTestHelp {
 
     // Allow access for test user.
     $edit = [
-      'acl[view][add]' => $this->test_user->getUsername(),
+      'acl[view][add]' => $this->testUser->getUsername(),
     ];
     $this->drupalPostForm('node/'. $this->node1->id() .'/access', $edit, t('Add User'));
     $this->drupalPostForm(NULL, array(), t('Submit'));
@@ -64,44 +61,39 @@ class ContentAccessAclTestCase extends ContentAccessTestHelp {
     // Logout admin, try to access the node anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id());
-    $this->assertText(t('Access denied'), 'node is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, view access should be allowed now.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id());
-    $this->assertNoText(t('Access denied'), 'node is viewable');
+    $this->assertSession()->pageTextNotContains(t('Access denied'));
 
     // Login admin and disable per node access.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
     $this->changeAccessPerNode(FALSE);
 
     // Logout admin, try to access the node anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id());
-    $this->assertText(t('Access denied'), 'node is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, view access should be denied now.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id());
-    $this->assertText(t('Access denied'), 'node is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
   }
 
   /**
    * Test Editing accessibility with permissions for single users.
    */
-  function testEditAccess() {
-    // Exit test if ACL module could not be enabled.
-    if (!\Drupal::moduleHandler()->moduleExists('acl')) {
-      $this->pass('No ACL module present, skipping test');
-      return;
-    }
+  public function testEditAccess() {
 
     // Enable per node access control.
     $this->changeAccessPerNode();
 
     // Allow edit access for test user.
     $edit = [
-      'acl[update][add]' => $this->test_user->getUsername(),
+      'acl[update][add]' => $this->testUser->getUsername(),
     ];
     $this->drupalPostForm('node/' . $this->node1->id() .'/access', $edit, t('Add User'));
     $this->drupalPostForm(NULL, array(), t('Submit'));
@@ -109,44 +101,39 @@ class ContentAccessAclTestCase extends ContentAccessTestHelp {
     // Logout admin, try to edit the node anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id() .'/edit');
-    $this->assertText(t('Access denied'), 'node is not editable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, edit access should be allowed now.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id() .'/edit');
-    $this->assertNoText(t('Access denied'), 'node is editable');
+    $this->assertSession()->pageTextNotContains(t('Access denied'));
 
     // Login admin and disable per node access.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
     $this->changeAccessPerNode(FALSE);
 
     // Logout admin, try to edit the node anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id() .'/edit');
-    $this->assertText(t('Access denied'), 'node is not editable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, edit access should be denied now.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id() .'/edit');
-    $this->assertText(t('Access denied'), 'node is not editable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
   }
 
   /**
    * Test Deleting accessibility with permissions for single users.
    */
-  function testDeleteAccess() {
-    // Exit test if ACL module could not be enabled.
-    if (!\Drupal::moduleHandler()->moduleExists('acl')) {
-      $this->pass('No ACL module present, skipping test');
-      return;
-    }
+  public function testDeleteAccess() {
 
     // Enable per node access control.
     $this->changeAccessPerNode();
 
     // Allow delete access for test user.
     $edit = array(
-      'acl[delete][add]' => $this->test_user->getUsername(),
+      'acl[delete][add]' => $this->testUser->getUsername(),
     );
     $this->drupalPostForm('node/' . $this->node1->id() .'/access', $edit, t('Add User'));
     $this->drupalPostForm(NULL, array(), t('Submit'));
@@ -154,26 +141,26 @@ class ContentAccessAclTestCase extends ContentAccessTestHelp {
     // Logout admin, try to delete the node anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id() .'/delete');
-    $this->assertText(t('Access denied'), 'node is not deletable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, delete access should be allowed now.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id() .'/delete');
-    $this->assertNoText(t('Access denied'), 'node is deletable');
+    $this->assertSession()->pageTextNotContains(t('Access denied'));
 
     // Login admin and disable per node access.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
     $this->changeAccessPerNode(FALSE);
 
     // Logout admin, try to delete the node anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id() .'/delete');
-    $this->assertText(t('Access denied'), 'node is not deletable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, delete access should be denied now.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id() .'/delete');
-    $this->assertText(t('Access denied'), 'node is not deletable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
   }
 
 }
diff --git a/tests/src/Functional/ContentAccessBrowserTestBase.php b/tests/src/Functional/ContentAccessBrowserTestBase.php
new file mode 100644
index 0000000..917748b
--- /dev/null
+++ b/tests/src/Functional/ContentAccessBrowserTestBase.php
@@ -0,0 +1,184 @@
+<?php
+
+namespace Drupal\Tests\content_access\Functional;
+
+use Drupal\Core\Session\AccountInterface;
+use Drupal\node\NodeInterface;
+use Drupal\user\Entity\Role;
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Provides the base class for web tests for Content Access.
+ *
+ * @group content_access
+ */
+abstract class ContentAccessBrowserTestBase extends BrowserTestBase {
+
+  /**
+   * Modules to enable for this test.
+   *
+   * @var string[]
+   */
+  public static $modules = [
+    'node',
+    'content_access',
+  ];
+
+  /**
+   * This user is granted the permissions under test.
+   *
+   * @var \Drupal\user\Entity\User
+   */
+  protected $testUser;
+
+  /**
+   * The role of the test user.
+   *
+   * @var string
+   */
+  protected $roleId = AccountInterface::AUTHENTICATED_ROLE;
+
+  /**
+   * A full privileged user.
+   *
+   * @var \Drupal\user\Entity\User
+   */
+  protected $adminUser;
+
+  /**
+   * Access to content of this type is subject to tests.
+   *
+   * @var \Drupal\node\Entity\NodeType
+   */
+  protected $contentType;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+
+    parent::setUp();
+
+    // Create test user with separate role.
+    $this->testUser = $this->drupalCreateUser();
+
+    // Get the value of the new role.
+    // @see drupalCreateUser().
+    $roles = $this->testUser->getRoles();
+    foreach ($roles as $role) {
+      if (!in_array($role, [AccountInterface::AUTHENTICATED_ROLE])) {
+        $this->roleId = $role;
+        break;
+      }
+    }
+
+    // Create admin user.
+    $this->adminUser = $this->drupalCreateUser([
+      'access content',
+      'administer content types',
+      'grant content access',
+      'grant own content access',
+      'administer nodes',
+      'access administration pages'
+    ]);
+    $this->drupalLogin($this->adminUser);
+
+    // Rebuild content access permissions.
+    node_access_rebuild();
+
+    // Create test content type.
+    $this->contentType = $this->drupalCreateContentType();
+  }
+
+  /**
+   * Change access permissions for a content type.
+   *
+   * @param array $accessSettings
+   */
+  public function changeAccessContentType($accessSettings) {
+    $this->drupalPostForm(
+      'admin/structure/types/manage/' . $this->contentType->id() . '/access',
+      $accessSettings,
+      t('Submit')
+    );
+    $this->assertSession()->pageTextContains(t('Your changes have been saved.'));
+  }
+
+  /**
+   * Change access permissions for a content type by a given keyword
+   * for the role of the user.
+   *
+   * @param string $keyword
+   * @param bool $access
+   * @param \Drupal\Core\Session\AccountInterface|NULL $user
+   */
+  public function changeAccessContentTypeKeyword($keyword, $access = TRUE, AccountInterface $user = NULL) {
+    $roles = array();
+
+    if ($user === NULL) {
+      $role = Role::load($this->roleId);
+      $roles[$role->id()] = $role->id();
+    }
+    else {
+      $userRoles = $user->getRoles();
+      foreach ($userRoles as $role) {
+        $roles[$role] = $role;
+        break;
+      }
+    }
+
+    // @todo This only sets ONE role. Is that intentionally?
+    $accessSettings = [
+      $keyword . '[' . key($roles) . ']' => $access,
+    ];
+    $this->changeAccessContentType($accessSettings);
+  }
+
+  /**
+   * Change the per node access setting for a content type.
+   *
+   * @param bool $access
+   */
+  public function changeAccessPerNode($access = TRUE) {
+    $accessPermissions = [
+      'per_node' => $access,
+    ];
+    $this->changeAccessContentType($accessPermissions);
+  }
+
+  /**
+   * Change access permissions for a node by a given keyword
+   * (view, update or delete).
+   *
+   * @param \Drupal\node\NodeInterface $node
+   * @param $keyword
+   * @param bool $access
+   */
+  public function changeAccessNodeKeyword(NodeInterface $node, $keyword, $access = TRUE) {
+    $user = $this->testUser;
+    $roles = $user->getRoles();
+    // @todo Wy load the role, when we only need the ID?
+    foreach ($roles as $roleId) {
+      $role = Role::load($roleId);
+      $roles[$role->id()] = $role->get('label');
+    }
+
+    // @todo This only sets ONE role, probably the LAST. Is that intentionally?
+    $accessSettings = [
+      $keyword . '[' . key($roles) . ']' => $access,
+    ];
+    $this->changeAccessNode($node, $accessSettings);
+  }
+
+  /**
+   * Change access permission for a node.
+   *
+   * @param \Drupal\node\NodeInterface $node
+   * @param array $accessSettings
+   */
+  public function changeAccessNode(NodeInterface $node, $accessSettings) {
+    $this->drupalPostForm('node/' . $node->id() . '/access', $accessSettings, t('Submit'));
+    $this->assertSession()->pageTextContains(t('Your changes have been saved.'));
+  }
+
+}
diff --git a/src/Tests/ContentAccessModuleTestCase.php b/tests/src/Functional/ContentAccessNodeTest.php
similarity index 63%
rename from src/Tests/ContentAccessModuleTestCase.php
rename to tests/src/Functional/ContentAccessNodeTest.php
index 741e7ad..db1f280 100644
--- a/src/Tests/ContentAccessModuleTestCase.php
+++ b/tests/src/Functional/ContentAccessNodeTest.php
@@ -1,26 +1,27 @@
 <?php
 
-namespace Drupal\content_access\Tests;
+namespace Drupal\Tests\content_access\Functional;
 
 /**
- * Automated SimpleTest Case for content access module.
+ * Browser tests for content access module.
  *
- * @group Access
+ * @group content_access
  */
-class ContentAccessModuleTestCase extends ContentAccessTestHelp {
+class ContentAccessNodeTest extends ContentAccessBrowserTestBase {
 
   /**
-   * Implementation of get_info() for information.
+   * Node used for testing.
+   *
+   * @var \Drupal\node\NodeInterface
    */
-  public static function getInfo() {
-    return [
-      'name' => t('Content Access Module Tests'),
-      'description' => t(
-        'Various tests to check permission settings on nodes.'
-      ),
-      'group' => t('Content Access'),
-    ];
-  }
+  protected $node1;
+
+  /**
+   * Node used for testing.
+   *
+   * @var \Drupal\node\NodeInterface
+   */
+  protected $node2;
 
   /**
    * {@inheritdoc}
@@ -29,8 +30,8 @@ class ContentAccessModuleTestCase extends ContentAccessTestHelp {
     parent::setUp();
 
     // Create test nodes.
-    $this->node1 = $this->drupalCreateNode(['type' => $this->content_type->id()]);
-    $this->node2 = $this->drupalCreateNode(['type' => $this->content_type->id()]);
+    $this->node1 = $this->drupalCreateNode(['type' => $this->contentType->id()]);
+    $this->node2 = $this->drupalCreateNode(['type' => $this->contentType->id()]);
   }
 
   /**
@@ -38,39 +39,39 @@ class ContentAccessModuleTestCase extends ContentAccessTestHelp {
    */
   function testViewAccess() {
     // Restrict access to the content type.
-    $access_permissions = [
+    $accessPermissions = [
       'view[anonymous]' => FALSE,
       'view[authenticated]' => FALSE,
     ];
-    $this->changeAccessContentType($access_permissions);
+    $this->changeAccessContentType($accessPermissions);
 
     // Logout admin and try to access the node anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id());
-    $this->assertText(t('Access denied'), 'node1 is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, view node, access must be denied.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id());
-    $this->assertText(t('Access denied'), 'node1 is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login admin and grant access for viewing to the test user.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
     $this->changeAccessContentTypeKeyword('view');
 
     // Logout admin and try to access the node anonymously
     // access must be denied again.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id());
-    $this->assertText(t('Access denied'), 'node1 is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, view node, access must be granted.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id());
-    $this->assertNoText(t('Access denied'), 'node1 is viewable');
+    $this->assertSession()->pageTextNotContains(t('Access denied'));
 
     // Login admin and enable per node access.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
     $this->changeAccessPerNode();
 
     // Restrict access on node2 for the test user role.
@@ -79,21 +80,21 @@ class ContentAccessModuleTestCase extends ContentAccessTestHelp {
     // Logout admin and try to access both nodes anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id());
-    $this->assertText(t('Access denied'), 'node1 is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
     $this->drupalGet('node/' . $this->node2->id());
-    $this->assertText(t('Access denied'), 'node2 is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, view node1, access must be granted.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id());
-    $this->assertNoText(t('Access denied'), 'node1 is viewable');
+    $this->assertSession()->pageTextNotContains(t('Access denied'));
 
     // View node2, access must be denied.
     $this->drupalGet('node/' . $this->node2->id());
-    $this->assertText(t('Access denied'), 'node2 is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login admin, swap permissions between content type and node2.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
 
     // Restrict access to content type
     $this->changeAccessContentTypeKeyword('view', FALSE);
@@ -104,18 +105,18 @@ class ContentAccessModuleTestCase extends ContentAccessTestHelp {
     // Logout admin and try to access both nodes anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id());
-    $this->assertText(t('Access denied'), 'node1 is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
     $this->drupalGet('node/' . $this->node2->id());
-    $this->assertText(t('Access denied'), 'node2 is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, view node1, access must be denied.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id());
-    $this->assertText(t('Access denied'), 'node1 is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // View node2, access must be granted.
     $this->drupalGet('node/' . $this->node2->id());
-    $this->assertNoText(t('Access denied'), 'node2 is viewable');
+    $this->assertSession()->pageTextNotContains(t('Access denied'));
   }
 
   /**
@@ -125,30 +126,30 @@ class ContentAccessModuleTestCase extends ContentAccessTestHelp {
     // Logout admin and try to edit the node anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id() . '/edit');
-    $this->assertText(t('Access denied'), 'edit access denied for anonymous');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, edit node, access must be denied.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id() . '/edit');
-    $this->assertText(t('Access denied'), 'edit access denied for test user');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login admin and grant access for editing to the test user.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
     $this->changeAccessContentTypeKeyword('update');
 
     // Logout admin and try to edit the node anonymously
     // access must be denied again.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id() . '/edit');
-    $this->assertText(t('Access denied'), 'edit access denied for anonymous');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, edit node, access must be granted.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id() . '/edit');
-    $this->assertNoText(t('Access denied'), 'node1 is editable');
+    $this->assertSession()->pageTextNotContains(t('Access denied'));
 
     // Login admin and enable per node access.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
     $this->changeAccessPerNode();
 
     // Restrict access for this content type for the test user.
@@ -161,21 +162,21 @@ class ContentAccessModuleTestCase extends ContentAccessTestHelp {
     // Logout admin and try to edit both nodes anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id() . '/edit');
-    $this->assertText(t('Access denied'), 'node1 is not editable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
     $this->drupalGet('node/' . $this->node2->id() . '/edit');
-    $this->assertText(t('Access denied'), 'node2 is not editable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, edit node1, access must be granted.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id() . '/edit');
-    $this->assertNoText(t('Access denied'), 'node1 is editable');
+    $this->assertSession()->pageTextNotContains(t('Access denied'));
 
     // Edit node2, access must be denied.
     $this->drupalGet('node/' . $this->node2->id() . '/edit');
-    $this->assertText(t('Access denied'), 'node2 is not editable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login admin, swap permissions between node1 and node2.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
 
     // Grant edit access to node2.
     $this->changeAccessNodeKeyword($this->node2, 'update');
@@ -185,18 +186,18 @@ class ContentAccessModuleTestCase extends ContentAccessTestHelp {
     // Logout admin and try to edit both nodes anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id() . '/edit');
-    $this->assertText(t('Access denied'), 'node1 is not editable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
     $this->drupalGet('node/' . $this->node2->id() . '/edit');
-    $this->assertText(t('Access denied'), 'node2 is not editable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, edit node1, access must be denied.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id() . '/edit');
-    $this->assertText(t('Access denied'), 'node1 is not editable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Edit node2, access must be granted.
     $this->drupalGet('node/' . $this->node2->id() . '/edit');
-    $this->assertNoText(t('Access denied'), 'node2 is editable');
+    $this->assertSession()->pageTextNotContains(t('Access denied'));
   }
 
   /**
@@ -206,15 +207,15 @@ class ContentAccessModuleTestCase extends ContentAccessTestHelp {
     // Logout admin and try to delete the node anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id() . '/delete');
-    $this->assertText(t('Access denied'), 'delete access denied for anonymous');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, delete node, access must be denied.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id() . '/delete');
-    $this->assertText(t('Access denied'), 'delete access denied for test user');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login admin and grant access for deleting to the test user.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
 
     $this->changeAccessContentTypeKeyword('delete');
 
@@ -222,24 +223,22 @@ class ContentAccessModuleTestCase extends ContentAccessTestHelp {
     // access must be denied again.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id() . '/delete');
-    $this->assertText(t('Access denied'), 'delete access denied for anonymous');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, delete node, access must be granted.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalPostForm(
       'node/' . $this->node1->id() . '/delete',
       array(),
       'Delete'
     );
-    $this->assertRaw(
-      t('%node has been deleted', array('%node' => $this->node1->getTitle())),
-      'Test node was deleted successfully by test user'
-    );
+    $this->assertSession()->responseContains(t('%node has been deleted', array('%node' => $this->node1->getTitle())));
+
 
     // Login admin and recreate test node1.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
     $this->node1 = $this->drupalCreateNode(
-      array('type' => $this->content_type->id())
+      array('type' => $this->contentType->id())
     );
 
     // Enable per node access.
@@ -255,21 +254,21 @@ class ContentAccessModuleTestCase extends ContentAccessTestHelp {
     // Logout admin and try to delete both nodes anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id() . '/delete');
-    $this->assertText(t('Access denied'), 'node1 is not deletable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
     $this->drupalGet('node/' . $this->node2->id() . '/delete');
-    $this->assertText(t('Access denied'), 'node2 is not deletable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, delete node1, access must be granted.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id() . '/delete');
-    $this->assertNoText(t('Access denied'), 'node1 is deletable');
+    $this->assertSession()->pageTextNotContains(t('Access denied'));
 
     // Delete node2, access must be denied.
     $this->drupalGet('node/' . $this->node2->id() . '/delete');
-    $this->assertText(t('Access denied'), 'node2 is not deletable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login admin, swap permissions between node1 and node2.
-    $this->drupalLogin($this->admin_user);
+    $this->drupalLogin($this->adminUser);
 
     // Grant delete access to node2.
     $this->changeAccessNodeKeyword($this->node2, 'delete');
@@ -279,18 +278,18 @@ class ContentAccessModuleTestCase extends ContentAccessTestHelp {
     // Logout admin and try to delete both nodes anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id() . '/delete');
-    $this->assertText(t('Access denied'), 'node1 is not deletable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
     $this->drupalGet('node/' . $this->node2->id() . '/delete');
-    $this->assertText(t('Access denied'), 'node2 is not deletable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user, delete node1, access must be denied.
-    $this->drupalLogin($this->test_user);
+    $this->drupalLogin($this->testUser);
     $this->drupalGet('node/' . $this->node1->id() . '/delete');
-    $this->assertText(t('Access denied'), 'node1 is not deletable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Delete node2, access must be granted.
     $this->drupalGet('node/' . $this->node2->id() . '/delete');
-    $this->assertNoText(t('Access denied'), 'node2 is deletable');
+    $this->assertSession()->pageTextNotContains(t('Access denied'));
   }
 
   /**
@@ -298,53 +297,53 @@ class ContentAccessModuleTestCase extends ContentAccessTestHelp {
    */
   function testOwnViewAccess() {
     // Setup 2 test users.
-    $test_user1 = $this->test_user;
-    $test_user2 = $this->drupalCreateUser();
+    $testUser1 = $this->testUser;
+    $testUser2 = $this->drupalCreateUser();
 
     // Change ownership of test nodes to test users.
-    $this->node1->setOwner($test_user1);
+    $this->node1->setOwner($testUser1);
     $this->node1->save();
 
-    $this->node2->setOwner($test_user2);
+    $this->node2->setOwner($testUser2);
     $this->node2->save();
 
     // Remove all view permissions for this content type.
-    $access_permissions = [
+    $accessPermissions = [
       'view[anonymous]' => FALSE,
       'view[authenticated]' => FALSE,
       'view_own[anonymous]' => FALSE,
       'view_own[authenticated]' => FALSE,
     ];
-    $this->changeAccessContentType($access_permissions);
+    $this->changeAccessContentType($accessPermissions);
 
     // Allow view own content for test user 1 and 2 roles.
-    $this->changeAccessContentTypeKeyword('view_own', TRUE, $test_user1);
-    $this->changeAccessContentTypeKeyword('view_own', TRUE, $test_user2);
+    $this->changeAccessContentTypeKeyword('view_own', TRUE, $testUser1);
+    $this->changeAccessContentTypeKeyword('view_own', TRUE, $testUser2);
 
     // Logout admin and try to access both nodes anonymously.
     $this->drupalLogout();
     $this->drupalGet('node/' . $this->node1->id());
-    $this->assertText(t('Access denied'), 'node1 is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
     $this->drupalGet('node/' . $this->node2->id());
-    $this->assertText(t('Access denied'), 'node2 is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user 1, view node1, access must be granted.
-    $this->drupalLogin($test_user1);
+    $this->drupalLogin($testUser1);
     $this->drupalGet('node/' . $this->node1->id());
-    $this->assertNoText(t('Access denied'), 'node1 is viewable');
+    $this->assertSession()->pageTextNotContains(t('Access denied'));
 
     // View node2, access must be denied.
     $this->drupalGet('node/' . $this->node2->id());
-    $this->assertText(t('Access denied'), 'node2 is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // Login test user 2, view node1, access must be denied.
-    $this->drupalLogin($test_user2);
+    $this->drupalLogin($testUser2);
     $this->drupalGet('node/' . $this->node1->id());
-    $this->assertText(t('Access denied'), 'node1 is not viewable');
+    $this->assertSession()->pageTextContains(t('Access denied'));
 
     // View node2, access must be granted.
     $this->drupalGet('node/' . $this->node2->id());
-    $this->assertNoText(t('Access denied'), 'node2 is viewable');
+    $this->assertSession()->pageTextNotContains(t('Access denied'));
   }
 
 }
