diff --git a/contrib/field_group_migrate/tests/src/Kernel/Migrate/d7/MigrateFieldGroupTest.php b/contrib/field_group_migrate/tests/src/Kernel/Migrate/d7/MigrateFieldGroupTest.php
index 40a88fd..0e15392 100644
--- a/contrib/field_group_migrate/tests/src/Kernel/Migrate/d7/MigrateFieldGroupTest.php
+++ b/contrib/field_group_migrate/tests/src/Kernel/Migrate/d7/MigrateFieldGroupTest.php
@@ -11,7 +11,10 @@
  */
 class MigrateFieldGroupTest extends MigrateDrupal7TestBase {
 
-  static $modules = [
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = [
     'field_group',
     'field_group_migrate',
     'comment',
@@ -67,13 +70,14 @@ protected function setUp() {
    *   The expected parent name.
    */
   protected function assertEntity($id, $type, $group_name, $expected_label, $expected_weight = 0, $expected_format_settings = [], $expected_format_type = 'tabs', $expected_children = [], $expected_parent_name = '') {
-    /** @var EntityDisplayInterface $entity */
+    /** @var \Drupal\Core\Entity\Display\EntityDisplayInterface $entity */
     $entity = \Drupal::entityTypeManager()
       ->getStorage($type)
       ->load($id);
     $field_group_settings = $entity->getThirdPartySettings('field_group');
     $this->assertNotEmpty($field_group_settings);
     $this->assertArrayHasKey($group_name, $field_group_settings);
+
     $field_group = $field_group_settings[$group_name];
     $this->assertEquals($expected_label, $field_group['label']);
     $this->assertEquals($expected_format_settings, $field_group['format_settings']);
@@ -93,7 +97,7 @@ public function testFieldGroup() {
     $this->assertEntity('node.article.teaser', 'entity_view_display', 'group_article', 'htab group', 2, ['classes' => 'htab-group'], 'tab', ['field_image']);
 
     // Check an entity_view_display without a field group.
-    /** @var EntityDisplayInterface $entity */
+    /** @var \Drupal\Core\Entity\Display\EntityDisplayInterface $entity */
     $entity = \Drupal::entityTypeManager()
       ->getStorage('entity_view_display')
       ->load('node.page.teaser');
diff --git a/contrib/field_group_migrate/tests/src/Unit/Migrate/d7/FieldGroupTest.php b/contrib/field_group_migrate/tests/src/Unit/Migrate/d7/FieldGroupTest.php
index c82dfe6..5a43c27 100644
--- a/contrib/field_group_migrate/tests/src/Unit/Migrate/d7/FieldGroupTest.php
+++ b/contrib/field_group_migrate/tests/src/Unit/Migrate/d7/FieldGroupTest.php
@@ -91,4 +91,12 @@ protected function setUp() {
     parent::setUp();
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function providerSource() {
+    // @TODO FIX.
+    return [];
+  }
+
 }
diff --git a/src/Tests/ManageDisplayTest.php b/src/Tests/ManageDisplayTest.php
deleted file mode 100644
index 8e6155c..0000000
--- a/src/Tests/ManageDisplayTest.php
+++ /dev/null
@@ -1,148 +0,0 @@
-<?php
-
-namespace Drupal\field_group\Tests;
-
-use Drupal\Component\Utility\Unicode;
-use Drupal\Core\Entity\Entity\EntityFormDisplay;
-use Drupal\simpletest\WebTestBase;
-
-/**
- * Tests for managing display of entities.
- *
- * @group field_group
- */
-class ManageDisplayTest extends WebTestBase {
-
-  use FieldGroupTestTrait;
-
-  /**
-   * Modules to enable.
-   *
-   * @var array
-   */
-  public static $modules = array('node', 'field_ui', 'field_group');
-
-  function setUp() {
-
-    parent::setUp();
-
-    // Create test user.
-    $admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'bypass node access'));
-    $this->drupalLogin($admin_user);
-
-    // Create content type, with underscores.
-    $type_name =  Unicode::strtolower($this->randomMachineName(8)) . '_test';
-    $type = $this->drupalCreateContentType(array('name' => $type_name, 'type' => $type_name));
-    $this->type = $type->id();
-
-  }
-
-  /**
-   * Test the creation a group on the article content type.
-   */
-  function testCreateGroup() {
-
-    // Create random group name.
-    $this->group_label = $this->randomString(8);
-    $this->group_name_input = Unicode::strtolower($this->randomMachineName());
-    $this->group_name = 'group_' . $this->group_name_input;
-    $this->group_formatter = 'details';
-
-    // Setup new group.
-    $group = array(
-      'group_formatter' => $this->group_formatter,
-      'label' => $this->group_label,
-    );
-
-    $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/form-display/add-group', $group, t('Save and continue'));
-    $this->assertText('Machine-readable name field is required.');
-
-    // Setup new group.
-    $group = array(
-      'group_formatter' => $this->group_formatter,
-      'label' => $this->group_label,
-      'group_name' => $this->group_name_input,
-    );
-
-    // Add new group on the 'Manage form display' page.
-    $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/form-display/add-group', $group, t('Save and continue'));
-    $this->drupalPostForm(NULL, [], t('Create group'));
-
-    $this->assertRaw(t('New group %label successfully created.', array('%label' => $this->group_label)), t('Group message displayed on screen.'));
-
-    // Test if group is in the $groups array.
-    $this->group = field_group_load_field_group($this->group_name, 'node', $this->type, 'form', 'default');
-    $this->assertNotNull($this->group, t('Group was loaded'));
-
-    // Add new group on the 'Manage display' page.
-    $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/display/add-group', $group, t('Save and continue'));
-    $this->drupalPostForm(NULL, [], t('Create group'));
-
-    $this->assertRaw(t('New group %label successfully created.', array('%label' => $this->group_label)), t('Group message displayed on screen.'));
-
-    // Test if group is in the $groups array.
-    $loaded_group = field_group_load_field_group($this->group_name, 'node', $this->type, 'view', 'default');
-    $this->assertNotNull($loaded_group, t('Group was loaded'));
-  }
-
-  /**
-   * Delete a group.
-   */
-  function testDeleteGroup() {
-
-    $data = array(
-      'format_type' => 'fieldset',
-      'label' => 'testing',
-    );
-
-    $group = $this->createGroup('node', $this->type, 'form', 'default', $data);
-
-    $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/form-display/' . $group->group_name . '/delete', array(), t('Delete'));
-    $this->assertRaw(t('The group %label has been deleted from the %type content type.', array('%label' => $group->label, '%type' => $this->type)), t('Group removal message displayed on screen.'));
-
-    $display = EntityFormDisplay::load($group->entity_type . '.' . $group->bundle . '.' . $group->mode);
-    $data = $display->getThirdPartySettings('field_group');
-
-    // Test that group is not in the $groups array.
-    \Drupal::entityTypeManager()->getStorage('entity_form_display')->resetCache();
-    $loaded_group = field_group_load_field_group($group->group_name, 'node', $this->type, 'form', 'default');
-    $this->assertNull($loaded_group, t('Group not found after deleting'));
-
-    $data = array(
-      'format_type' => 'fieldset',
-      'label' => 'testing',
-    );
-
-    $group = $this->createGroup('node', $this->type, 'view', 'default', $data);
-
-    $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/display/' . $group->group_name . '/delete', array(), t('Delete'));
-    $this->assertRaw(t('The group %label has been deleted from the %type content type.', array('%label' => $group->label, '%type' => $this->type)), t('Group removal message displayed on screen.'));
-
-    // Test that group is not in the $groups array.
-    \Drupal::entityTypeManager()->getStorage('entity_view_display')->resetCache();
-    $loaded_group = field_group_load_field_group($group->group_name, 'node', $this->type, 'view', 'default');
-    $this->assertNull($loaded_group, t('Group not found after deleting'));
-  }
-
-  /**
-   * Nest a field underneath a group.
-   */
-  function testNestField() {
-
-    $data = array(
-      'format_type' => 'fieldset',
-    );
-
-    $group = $this->createGroup('node', $this->type, 'form', 'default', $data);
-
-    $edit = array(
-      'fields[body][parent]' => $group->group_name,
-    );
-    $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/form-display', $edit, t('Save'));
-    $this->assertRaw(t('Your settings have been saved.'), t('Settings saved'));
-
-    $group = field_group_load_field_group($group->group_name, 'node', $this->type, 'form', 'default');
-    $this->assertTrue(in_array('body', $group->children), t('Body is a child of %group', array('%group' => $group->group_name)));
-  }
-
-}
diff --git a/src/Tests/EntityDisplayTest.php b/tests/src/Functional/EntityDisplayTest.php
similarity index 81%
rename from src/Tests/EntityDisplayTest.php
rename to tests/src/Functional/EntityDisplayTest.php
index 4496ec6..d83b8cd 100644
--- a/src/Tests/EntityDisplayTest.php
+++ b/tests/src/Functional/EntityDisplayTest.php
@@ -1,39 +1,67 @@
 <?php
 
-namespace Drupal\field_group\Tests;
+namespace Drupal\Tests\field_group\Functional;
 
 use Drupal\field\Entity\FieldConfig;
 use Drupal\field\Entity\FieldStorageConfig;
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Tests for displaying entities.
  *
  * @group field_group
  */
-class EntityDisplayTest extends WebTestBase {
+class EntityDisplayTest extends BrowserTestBase {
 
   use FieldGroupTestTrait;
 
   /**
-   * Modules to enable.
+   * {@inheritdoc}
+   */
+  public static $modules = [
+    'node',
+    'field_test',
+    'field_ui',
+    'field_group',
+    'field_group_test',
+  ];
+
+  /**
+   * The node type id.
    *
-   * @var array
+   * @var string
    */
-  public static $modules = array('node', 'field_test', 'field_ui', 'field_group', 'field_group_test');
+  protected $type;
 
-  function setUp() {
+  /**
+   * A node to use for testing.
+   *
+   * @var \Drupal\node\NodeInterface
+   */
+  protected $node;
 
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
     parent::setUp();
 
     // Create test user.
-    $admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'bypass node access'));
+    $admin_user = $this->drupalCreateUser([
+      'access content',
+      'administer content types',
+      'administer node fields',
+      'administer node form display',
+      'administer node display',
+      'bypass node access'
+    ]);
     $this->drupalLogin($admin_user);
 
     // Create content type, with underscores.
     $type_name = strtolower($this->randomMachineName(8)) . '_test';
     $type = $this->drupalCreateContentType(array('name' => $type_name, 'type' => $type_name));
     $this->type = $type->id();
+    /** @var \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display */
     $display = \Drupal::entityTypeManager()
       ->getStorage('entity_view_display')
       ->load('node' . '.' . $type_name . '.' . 'default');
@@ -42,9 +70,7 @@ function setUp() {
     $node_values = array('type' => $type_name);
 
     // Create test fields.
-    $test_fields = array('field_test', 'field_test_2', 'field_no_access');
-    foreach ($test_fields as $field_name) {
-
+    foreach (['field_test', 'field_test_2', 'field_no_access'] as $field_name) {
       $field_storage = FieldStorageConfig::create([
         'field_name' => $field_name,
         'entity_type' => 'node',
@@ -76,15 +102,12 @@ function setUp() {
     // Save display + create node.
     $display->save();
     $this->node = $this->drupalCreateNode($node_values);
-
   }
 
   /**
-   * Test if an fieldgroup that only contains fields
-   * that has no access is not shown.
+   * Test field access for field groups.
    */
-  function testFieldAccess() {
-
+  public function testFieldAccess() {
     $data = array(
       'label' => 'Wrapper',
       'children' => array(
@@ -107,8 +130,7 @@ function testFieldAccess() {
   /**
    * Test the html element formatter.
    */
-  function testHtmlElement() {
-
+  public function testHtmlElement() {
     $data = array(
       'weight' => '1',
       'children' => array(
@@ -130,11 +152,11 @@ function testHtmlElement() {
     $this->drupalGet('node/' . $this->node->id());
 
     // Test group ids and classes.
-    $this->assertFieldByXPath("//div[contains(@id, 'wrapper-id')]", NULL, t('Wrapper id set on wrapper div'));
-    $this->assertFieldByXPath("//div[contains(@class, 'test-class')]", NULL, t('Test class set on wrapper div') . 'class="' . $group->group_name . ' test-class');
+    $this->assertFieldByXPath("//div[contains(@id, 'wrapper-id')]", NULL, 'Wrapper id set on wrapper div');
+    $this->assertFieldByXPath("//div[contains(@class, 'test-class')]", NULL, 'Test class set on wrapper div, class="' . $group->group_name . ' test-class');
 
     // Test group label.
-    $this->assertNoRaw('<h3><span>' . $data['label'] . '</span></h3>', t('Label is not shown'));
+    $this->assertNoRaw('<h3><span>' . $data['label'] . '</span></h3>');
 
     // Set show label to true.
     $group->format_settings['show_label'] = TRUE;
@@ -142,7 +164,7 @@ function testHtmlElement() {
     field_group_group_save($group);
 
     $this->drupalGet('node/' . $this->node->id());
-    $this->assertRaw('<h3>' . $data['label'] . '</h3>', t('Label is shown'));
+    $this->assertRaw('<h3>' . $data['label'] . '</h3>');
 
     // Change to collapsible with blink effect.
     $group->format_settings['effect'] = 'blink';
@@ -150,15 +172,14 @@ function testHtmlElement() {
     field_group_group_save($group);
 
     $this->drupalGet('node/' . $this->node->id());
-    $this->assertFieldByXPath("//div[contains(@class, 'speed-fast')]", NULL, t('Speed class is set'));
-    $this->assertFieldByXPath("//div[contains(@class, 'effect-blink')]", NULL, t('Effect class is set'));
+    $this->assertFieldByXPath("//div[contains(@class, 'speed-fast')]", NULL, 'Speed class is set');
+    $this->assertFieldByXPath("//div[contains(@class, 'effect-blink')]", NULL, 'Effect class is set');
   }
 
   /**
    * Test the fieldset formatter.
    */
-  function testFieldset() {
-
+  public function testFieldset() {
     $data = array(
       'weight' => '1',
       'children' => array(
@@ -173,21 +194,20 @@ function testFieldset() {
         'description' => 'test description',
       ),
     );
-    $group = $this->createGroup('node', $this->type, 'view', 'default', $data);
+    $this->createGroup('node', $this->type, 'view', 'default', $data);
 
     $this->drupalGet('node/' . $this->node->id());
 
     // Test group ids and classes.
-    $this->assertFieldByXPath("//fieldset[contains(@id, 'fieldset-id')]", NULL, t('Correct id set on the fieldset'));
-    $this->assertFieldByXPath("//fieldset[contains(@class, 'test-class')]", NULL, t('Test class set on the fieldset'));
+    $this->assertFieldByXPath("//fieldset[contains(@id, 'fieldset-id')]", NULL, 'Correct id set on the fieldset');
+    $this->assertFieldByXPath("//fieldset[contains(@class, 'test-class')]", NULL, 'Test class set on the fieldset');
 
   }
 
   /**
    * Test the tabs formatter.
    */
-  function testTabs() {
-
+  public function testTabs() {
     $data = array(
       'label' => 'Tab 1',
       'weight' => '1',
@@ -239,9 +259,9 @@ function testTabs() {
     $this->drupalGet('node/' . $this->node->id());
 
     // Test properties.
-    $this->assertFieldByXPath("//div[contains(@class, 'test-class-wrapper')]", NULL, t('Test class set on tabs wrapper'));
-    $this->assertFieldByXPath("//details[contains(@class, 'test-class-2')]", NULL, t('Test class set on second tab'));
-    $this->assertRaw('<div class="details-description">description of second tab</div>', t('Description of tab is shown'));
+    $this->assertFieldByXPath("//div[contains(@class, 'test-class-wrapper')]", NULL, 'Test class set on tabs wrapper');
+    $this->assertFieldByXPath("//details[contains(@class, 'test-class-2')]", NULL, 'Test class set on second tab');
+    $this->assertRaw('<div class="details-description">description of second tab</div>');
 
     // Test if correctly nested.
     $this->assertFieldByXPath("//div[contains(@class, 'test-class-wrapper')]//details[contains(@class, 'test-class')]", NULL, 'First tab is displayed as child of the wrapper.');
@@ -264,7 +284,7 @@ function testTabs() {
   /**
    * Test the accordion formatter.
    */
-  function testAccordion() {
+  public function testAccordion() {
 
     $data = array(
       'label' => 'Accordion item 1',
@@ -280,7 +300,6 @@ function testAccordion() {
       ),
     );
     $first_item = $this->createGroup('node', $this->type, 'view', 'default', $data);
-    $first_item_id = 'node_article_full_' . $first_item->group_name;
 
     $data = array(
       'label' => 'Accordion item 2',
@@ -296,7 +315,6 @@ function testAccordion() {
       ),
     );
     $second_item = $this->createGroup('node', $this->type, 'view', 'default', $data);
-    $second_item_id = 'node_article_full_' . $second_item->group_name;
 
     $data = array(
       'label' => 'Accordion',
@@ -312,16 +330,16 @@ function testAccordion() {
         'effect' => 'bounceslide'
       ),
     );
-    $accordion = $this->createGroup('node', $this->type, 'view', 'default', $data);
+    $this->createGroup('node', $this->type, 'view', 'default', $data);
 
     $this->drupalGet('node/' . $this->node->id());
 
     // Test properties.
-    $this->assertFieldByXPath("//div[contains(@class, 'test-class-wrapper')]", NULL, t('Test class set on tabs wrapper'));
-    $this->assertFieldByXPath("//div[contains(@class, 'effect-bounceslide')]", NULL, t('Correct effect is set on the accordion'));
-    $this->assertFieldByXPath("//div[contains(@class, 'test-class')]", NULL, t('Accordion item with test-class is shown'));
-    $this->assertFieldByXPath("//div[contains(@class, 'test-class-2')]", NULL, t('Accordion item with test-class-2 is shown'));
-    $this->assertFieldByXPath("//h3[contains(@class, 'field-group-accordion-active')]", NULL, t('Accordion item 2 was set active'));
+    $this->assertFieldByXPath("//div[contains(@class, 'test-class-wrapper')]", NULL, 'Test class set on tabs wrapper');
+    $this->assertFieldByXPath("//div[contains(@class, 'effect-bounceslide')]", NULL, 'Correct effect is set on the accordion');
+    $this->assertFieldByXPath("//div[contains(@class, 'test-class')]", NULL, 'Accordion item with test-class is shown');
+    $this->assertFieldByXPath("//div[contains(@class, 'test-class-2')]", NULL, 'Accordion item with test-class-2 is shown');
+    $this->assertFieldByXPath("//h3[contains(@class, 'field-group-accordion-active')]", NULL, 'Accordion item 2 was set active');
 
     // Test if correctly nested
     $this->assertFieldByXPath("//div[contains(@class, 'test-class-wrapper')]//div[contains(@class, 'test-class')]", NULL, 'First item is displayed as child of the wrapper.');
diff --git a/src/Tests/FieldGroupTestTrait.php b/tests/src/Functional/FieldGroupTestTrait.php
similarity index 77%
rename from src/Tests/FieldGroupTestTrait.php
rename to tests/src/Functional/FieldGroupTestTrait.php
index 7feb156..81fa458 100644
--- a/src/Tests/FieldGroupTestTrait.php
+++ b/tests/src/Functional/FieldGroupTestTrait.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\field_group\Tests;
+namespace Drupal\Tests\field_group\Functional;
 
 use Drupal\Component\Utility\Unicode;
 
@@ -11,8 +11,19 @@
 
   /**
    * Create a new group.
+   *
+   * @param string $entity_type
+   *   The entity type as string.
+   * @param string $bundle
+   *   The bundle of the enity type
+   * @param string $context
+   *   The context for the group.
+   * @param string $mode
+   *   The view/form mode.
    * @param array $data
    *   Data for the field group.
+   *
+   * @return \Drupal\Core\Entity\Display\EntityDisplayInterface
    */
   function createGroup($entity_type, $bundle, $context, $mode, array $data) {
 
diff --git a/src/Tests/FieldGroupWithoutFieldUiTest.php b/tests/src/Functional/FieldGroupWithoutFieldUiTest.php
similarity index 56%
rename from src/Tests/FieldGroupWithoutFieldUiTest.php
rename to tests/src/Functional/FieldGroupWithoutFieldUiTest.php
index f9bd3b1..2beae97 100644
--- a/src/Tests/FieldGroupWithoutFieldUiTest.php
+++ b/tests/src/Functional/FieldGroupWithoutFieldUiTest.php
@@ -1,19 +1,25 @@
 <?php
 
-namespace Drupal\field_group\Tests;
+namespace Drupal\Tests\field_group\Functional;
 
 use Drupal\Core\Url;
-use Drupal\simpletest\WebTestBase;
+use Drupal\Tests\BrowserTestBase;
 
 /**
  * Test field_group without field_ui.
  *
  * @group field_group
  */
-class FieldGroupWithoutFieldUiTest extends WebTestBase {
+class FieldGroupWithoutFieldUiTest extends BrowserTestBase {
 
-  protected static $modules = ['field_group', 'block'];
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['field_group', 'block'];
 
+  /**
+   * Test that local actions show up without field ui enabled.
+   */
   public function testLocalActions() {
     // Local actions of field_group should not depend on field_ui
     // @see https://www.drupal.org/node/2719569
diff --git a/tests/src/Functional/ManageDisplayTest.php b/tests/src/Functional/ManageDisplayTest.php
new file mode 100644
index 0000000..e89ee46
--- /dev/null
+++ b/tests/src/Functional/ManageDisplayTest.php
@@ -0,0 +1,158 @@
+<?php
+
+namespace Drupal\Tests\field_group\Functional;
+
+use Drupal\Component\Utility\Unicode;
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Tests for managing display of entities.
+ *
+ * @group field_group
+ */
+class ManageDisplayTest extends BrowserTestBase {
+
+  use FieldGroupTestTrait;
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = array('node', 'field_ui', 'field_group');
+
+  /**
+   * Content type id.
+   *
+   * @var string
+   */
+  protected $type;
+
+  protected $strictConfigSchema = FALSE;
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setUp() {
+    parent::setUp();
+
+    // Create test user.
+    $admin_user = $this->drupalCreateUser([
+      'access content',
+      'administer content types',
+      'administer node fields',
+      'administer node form display',
+      'administer node display',
+      'bypass node access',
+    ]);
+    $this->drupalLogin($admin_user);
+
+    // Create content type, with underscores.
+    $type_name = 'll4ma_test';
+    $type = $this->drupalCreateContentType(['name' => $type_name, 'type' => $type_name]);
+    $this->type = $type->id();
+
+  }
+
+  /**
+   * Test the creation a group on the article content type.
+   */
+  public function testCreateGroup() {
+    // Create random group name.
+    $group_label = $this->randomString(8);
+    $group_name_input = Unicode::strtolower($this->randomMachineName());
+    $group_name = 'group_' . $group_name_input;
+    $group_formatter = 'details';
+
+    // Setup new group.
+    $group = array(
+      'group_formatter' => $group_formatter,
+      'label' => $group_label,
+    );
+
+    $add_form_display = 'admin/structure/types/manage/' . $this->type . '/form-display/add-group';
+    $this->drupalPostForm($add_form_display, $group, 'Save and continue');
+    $this->assertSession()->pageTextContains('Machine-readable name field is required.');
+
+    // Add required field to form.
+    $group['group_name'] = $group_name_input;
+
+    // Add new group on the 'Manage form display' page.
+    $this->drupalPostForm($add_form_display, $group, 'Save and continue');
+    $this->drupalPostForm(NULL, [], 'Create group');
+
+    $this->assertSession()->responseContains(t('New group %label successfully created.', array('%label' => $group_label)));
+
+    // Test if group is in the $groups array.
+    $this->group = field_group_load_field_group($group_name, 'node', $this->type, 'form', 'default');
+    $this->assertNotNull($group, 'Group was loaded');
+
+    // Add new group on the 'Manage display' page.
+    $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/display/add-group', $group, 'Save and continue');
+    $this->drupalPostForm(NULL, [], 'Create group');
+
+    $this->assertSession()->responseContains(t('New group %label successfully created.', array('%label' => $group_label)));
+
+    // Test if group is in the $groups array.
+    $loaded_group = field_group_load_field_group($group_name, 'node', $this->type, 'view', 'default');
+    $this->assertNotNull($loaded_group, 'Group was loaded');
+  }
+
+  /**
+   * Delete a group.
+   */
+  public function testDeleteGroup() {
+    $data = array(
+      'format_type' => 'fieldset',
+      'label' => 'testing',
+    );
+
+    $group = $this->createGroup('node', $this->type, 'form', 'default', $data);
+
+    $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/form-display/' . $group->group_name . '/delete', array(), 'Delete');
+    $this->assertSession()->responseContains(t('The group %label has been deleted from the %type content type.', array('%label' => $group->label, '%type' => $this->type)));
+
+    // Test that group is not in the $groups array.
+    \Drupal::entityTypeManager()
+      ->getStorage('entity_form_display')
+      ->resetCache();
+    $loaded_group = field_group_load_field_group($group->group_name, 'node', $this->type, 'form', 'default');
+    $this->assertNull($loaded_group, 'Group not found after deleting');
+
+    $data = array(
+      'format_type' => 'fieldset',
+      'label' => 'testing',
+    );
+
+    $group = $this->createGroup('node', $this->type, 'view', 'default', $data);
+
+    $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/display/' . $group->group_name . '/delete', array(), t('Delete'));
+    $this->assertRaw(t('The group %label has been deleted from the %type content type.', array('%label' => $group->label, '%type' => $this->type)));
+
+    // Test that group is not in the $groups array.
+    \Drupal::entityTypeManager()
+      ->getStorage('entity_view_display')
+      ->resetCache();
+    $loaded_group = field_group_load_field_group($group->group_name, 'node', $this->type, 'view', 'default');
+    $this->assertNull($loaded_group, 'Group not found after deleting');
+  }
+
+  /**
+   * Nest a field underneath a group.
+   */
+  public function testNestField() {
+    $data = array(
+      'format_type' => 'fieldset',
+    );
+
+    $group = $this->createGroup('node', $this->type, 'form', 'default', $data);
+
+    $edit = array(
+      'fields[body][parent]' => $group->group_name,
+    );
+    $this->drupalPostForm('admin/structure/types/manage/' . $this->type . '/form-display', $edit, 'Save');
+    $this->assertRaw('Your settings have been saved.');
+
+    $group = field_group_load_field_group($group->group_name, 'node', $this->type, 'form', 'default');
+    $this->assertTrue(in_array('body', $group->children), t('Body is a child of %group', array('%group' => $group->group_name)));
+  }
+
+}
diff --git a/tests/src/FunctionalJavascript/FieldGroupUiTest.php b/tests/src/FunctionalJavascript/FieldGroupUiTest.php
index a3d7c3f..75d74ea 100644
--- a/tests/src/FunctionalJavascript/FieldGroupUiTest.php
+++ b/tests/src/FunctionalJavascript/FieldGroupUiTest.php
@@ -4,9 +4,9 @@
 
 use Drupal\Component\Utility\Unicode;
 use Drupal\Core\Entity\Entity\EntityFormDisplay;
-use Drupal\field_group\Tests\FieldGroupTestTrait;
 use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
 use Drupal\node\Entity\NodeType;
+use Drupal\Tests\field_group\Functional\FieldGroupTestTrait;
 
 /**
  * Test field_group user interface.
@@ -33,7 +33,14 @@ public function setUp() {
     parent::setUp();
 
     // Create test user.
-    $admin_user = $this->drupalCreateUser(array('access content', 'administer content types', 'administer node fields', 'administer node form display', 'administer node display', 'bypass node access'));
+    $admin_user = $this->drupalCreateUser([
+      'access content',
+      'administer content types',
+      'administer node fields',
+      'administer node form display',
+      'administer node display',
+      'bypass node access',
+    ]);
     $this->drupalLogin($admin_user);
 
     // Create content type, with underscores.
@@ -46,6 +53,9 @@ public function setUp() {
     $this->nodeType = $type->id();
   }
 
+  /**
+   * Test creation and editing trough the UI.
+   */
   public function testCreateAndEdit() {
     foreach (['test_1', 'test_2'] as $name) {
       $group = array(
@@ -55,8 +65,8 @@ public function testCreateAndEdit() {
       );
 
       // Add new group on the 'Manage form display' page.
-      $this->drupalPostForm('admin/structure/types/manage/' . $this->nodeType . '/form-display/add-group', $group, t('Save and continue'));
-      $this->drupalPostForm(NULL, [], t('Create group'));
+      $this->drupalPostForm('admin/structure/types/manage/' . $this->nodeType . '/form-display/add-group', $group, 'Save and continue');
+      $this->drupalPostForm(NULL, [], 'Create group');
     }
 
     // Update title in group 1
@@ -83,7 +93,7 @@ public function testCreateAndEdit() {
 
     $page->pressButton('Save');
 
-    /** @var EntityFormDisplayInterface $display */
+    /** @var \Drupal\Core\Entity\Display\EntityFormDisplayInterface $display */
     $display = EntityFormDisplay::load("node.{$this->nodeType}.default");
     $this->assertSame('Test 1 - Update', $display->getThirdPartySetting('field_group', 'group_test_1')['label']);
     $this->assertSame('Test 1 - Update', $display->getThirdPartySetting('field_group', 'group_test_1')['format_settings']['label']);
