diff --git a/composer.json b/composer.json
index 04e4c8b..1d2459f 100644
--- a/composer.json
+++ b/composer.json
@@ -23,6 +23,6 @@
     "drupal/search_api": "1.x"
   },
   "require-dev": {
-    "drupal/search_api_page": "@dev"
+    "drupal/search_api_page": "1.x-dev"
   }
 }
diff --git a/search_api_autocomplete.info.yml b/search_api_autocomplete.info.yml
index 60c005e..c7bb1e2 100644
--- a/search_api_autocomplete.info.yml
+++ b/search_api_autocomplete.info.yml
@@ -1,7 +1,7 @@
 name: Search API Autocomplete
 description: "Adds autocomplete functionality to searches."
 dependencies:
-  - drupal:system (>=8.5)
+  - drupal:system (>=8.6)
   - search_api:search_api
 core: 8.x
 type: module
diff --git a/search_api_autocomplete.module b/search_api_autocomplete.module
index 0cc77bf..520f3f9 100644
--- a/search_api_autocomplete.module
+++ b/search_api_autocomplete.module
@@ -154,7 +154,7 @@ function search_api_autocomplete_form_views_exposed_form_alter(array &$form, For
 }
 
 /**
- * Implements hook_form_FORM_ID_alter() for "search_api_page_block_form".
+ * Implements hook_form_BASE_FORM_ID_alter() for "search_api_page_block_form".
  *
  * Adds autocompletion to the keywords field on search pages, if enabled by the
  * user.
@@ -162,12 +162,8 @@ function search_api_autocomplete_form_views_exposed_form_alter(array &$form, For
  * @see \Drupal\search_api_page\Form\SearchApiPageBlockForm
  * @see \Drupal\search_api_autocomplete\Plugin\search_api_autocomplete\search\Page
  */
-function search_api_autocomplete_form_search_api_page_block_form_alter(array &$form, FormStateInterface $form_state) {
-  $build_info = $form_state->getBuildInfo();
-  if (!isset($build_info['args'][0]['search_api_page'])) {
-    return;
-  }
-  $page_id = $build_info['args'][0]['search_api_page'];
+function search_api_autocomplete_form_search_api_page_block_form_alter(array &$form, FormStateInterface $form_state, $form_id) {
+  $page_id = substr($form_id, strlen('search_api_page_block_form_'));
   /** @var \Drupal\search_api_autocomplete\Entity\SearchStorage $search_storage */
   $search_storage = \Drupal::entityTypeManager()
     ->getStorage('search_api_autocomplete_search');
diff --git a/tests/src/FunctionalJavascript/IntegrationTest.php b/tests/src/FunctionalJavascript/IntegrationTest.php
index 6e74202..b816b97 100644
--- a/tests/src/FunctionalJavascript/IntegrationTest.php
+++ b/tests/src/FunctionalJavascript/IntegrationTest.php
@@ -100,7 +100,6 @@ protected function enableSearch() {
     $assert_session = $this->assertSession();
 
     $this->drupalGet($this->getAdminPath());
-    $assert_session->statusCodeEquals(200);
 
     // Check whether all expected groups and searches are present.
     $assert_session->pageTextContains('Search views');
@@ -116,7 +115,6 @@ protected function enableSearch() {
 
     $this->click('[data-drupal-selector="edit-actions-submit"]');
     $this->logPageChange(NULL, 'POST');
-    $assert_session->statusCodeEquals(200);
     $assert_session->pageTextContains('The settings have been saved. Please remember to set the permissions for the newly enabled searches.');
   }
 
@@ -128,7 +126,6 @@ protected function configureSearch() {
 
     $this->click('.dropbutton-action a[href$="/edit"]');
     $this->logPageChange();
-    $assert_session->statusCodeEquals(200);
     $assert_session->addressEquals($this->getAdminPath('edit'));
 
     // The "Server" suggester shouldn't be available at that point.
@@ -157,6 +154,10 @@ protected function configureSearch() {
     $this->click('input[name="suggesters[enabled][server]"]');
     $this->assertVisible('css', 'details[data-drupal-selector="edit-suggesters-settings-server"]');
 
+    $page = $this->getSession()->getPage();
+    $page->findButton('Show row weights')->click();
+    $page->find('css', 'details[data-drupal-selector="edit-suggesters-settings-server"] > summary')->click();
+
     // Submit the form with some values for all fields.
     $edit = [
       'suggesters[enabled][live_results]' => FALSE,
@@ -211,7 +212,6 @@ protected function checkSearchAutocomplete($click_url_suggestion = FALSE) {
     $assert_session = $this->assertSession();
 
     $this->drupalGet('search-api-autocomplete-test');
-    $assert_session->statusCodeEquals(200);
 
     $assert_session->elementAttributeContains('css', 'input[data-drupal-selector="edit-keys"]', 'data-search-api-autocomplete-search', $this->searchId);
 
@@ -292,6 +292,10 @@ protected function checkLiveResultsAutocomplete() {
     $assert_session = $this->assertSession();
 
     // First, enable "Live results" as the only suggester.
+    $this->drupalGet($this->getAdminPath('edit'));
+    $page = $this->getSession()->getPage();
+    $this->click('input[name="suggesters[enabled][live_results]"]');
+    $page->find('css', 'details[data-drupal-selector="edit-suggesters-settings-live-results"] > summary')->click();
     $edit = [
       'suggesters[enabled][live_results]' => TRUE,
       'suggesters[enabled][search_api_autocomplete_test]' => FALSE,
@@ -299,7 +303,7 @@ protected function checkLiveResultsAutocomplete() {
       'suggesters[settings][live_results][fields][name]' => FALSE,
       'suggesters[settings][live_results][fields][body]' => TRUE,
     ];
-    $this->drupalPostForm($this->getAdminPath('edit'), $edit, 'Save');
+    $this->drupalPostForm(NULL, $edit, 'Save');
     $assert_session->pageTextContains('The autocompletion settings for the search have been saved.');
 
     // Then, set an appropriate search method for the test backend.
@@ -308,7 +312,6 @@ protected function checkLiveResultsAutocomplete() {
 
     // Get the autocompletion results.
     $this->drupalGet('search-api-autocomplete-test');
-    $assert_session->statusCodeEquals(200);
     $suggestions = [];
     foreach ($this->getAutocompleteSuggestions() as $element) {
       $label = $this->getElementText($element, '.autocomplete-suggestion-label');
@@ -357,15 +360,17 @@ protected function checkCustomAutocompleteScript() {
     // This gets the request path to the "tests" directory.
     $path = str_replace(DRUPAL_ROOT, '', dirname(dirname(__DIR__)));
     $path .= '/search_api_autocomplete_test/core/custom_autocomplete_script.php';
+    $this->click('input[name="suggesters[enabled][custom_script]"]');
+    $page = $this->getSession()->getPage();
+    $page->find('css', 'details[data-drupal-selector="edit-suggesters-settings-custom-script"] > summary')
+      ->click();
     $edit = [
       'suggesters[enabled][custom_script]' => TRUE,
       'suggesters[settings][custom_script][path]' => $path,
     ];
     $this->submitForm($edit, 'Save');
-    $assert_session->statusCodeEquals(200);
 
     $this->drupalGet('search-api-autocomplete-test');
-    $assert_session->statusCodeEquals(200);
 
     $assert_session->elementAttributeContains('css', 'input[data-drupal-selector="edit-keys"]', 'data-search-api-autocomplete-search', $this->searchId);
 
@@ -385,9 +390,11 @@ protected function checkCustomAutocompleteScript() {
     $this->assertEquals($expected, $suggestions, 'Unexpected suggestions returned by custom script.');
 
     $this->drupalGet($this->getAdminPath('edit'));
+    $page = $this->getSession()->getPage();
+    $page->find('css', 'details[data-drupal-selector="edit-suggesters-settings-custom-script"] > summary')->click();
     $edit = [
-      'suggesters[enabled][custom_script]' => FALSE,
       'suggesters[settings][custom_script][path]' => '',
+      'suggesters[enabled][custom_script]' => FALSE,
     ];
     $this->submitForm($edit, 'Save');
   }
@@ -413,7 +420,6 @@ protected function checkHooks() {
     $assert_session->pageTextNotContains('Test suggester');
 
     $this->drupalGet('search-api-autocomplete-test');
-    $assert_session->statusCodeEquals(200);
     $assert_session->pageTextContains("Creek Mary's Blood");
 
     $autocomplete_path = "search_api_autocomplete/{$this->searchId}";
@@ -473,13 +479,13 @@ protected function checkAutocompleteAccess() {
       }
 
       $this->drupalGet('search-api-autocomplete-test');
-      $assert_session->statusCodeEquals(200);
       $element = $assert_session->elementExists('css', 'input[data-drupal-selector="edit-keys"]');
       $this->assertFalse($element->hasAttribute('data-search-api-autocomplete-search'), "Autocomplete should not be enabled for $user_type user without the necessary permission.");
       $this->assertFalse($element->hasClass('form-autocomplete'), "Autocomplete should not be enabled for $user_type user without the necessary permission.");
 
       $this->drupalGet($autocomplete_path, ['query' => ['q' => 'test']]);
-      $assert_session->statusCodeEquals(403);
+      $assert_session->pageTextContains('Access denied');
+      $assert_session->pageTextContains('You are not authorized to access this page.');
 
       $rid = $account ? 'authenticated' : 'anonymous';
       $role = Role::load($rid);
@@ -487,14 +493,12 @@ protected function checkAutocompleteAccess() {
       $role->save();
 
       $this->drupalGet('search-api-autocomplete-test');
-      $assert_session->statusCodeEquals(200);
       $element = $assert_session->elementExists('css', 'input[data-drupal-selector="edit-keys"]');
       $this->assertTrue($element->hasAttribute('data-search-api-autocomplete-search'), "Autocomplete should not be enabled for $user_type user without the necessary permission.");
       $this->assertContains($this->searchId, $element->getAttribute('data-search-api-autocomplete-search'), "Autocomplete should not be enabled for $user_type user without the necessary permission.");
       $this->assertTrue($element->hasClass('form-autocomplete'), "Autocomplete should not be enabled for $user_type user without the necessary permission.");
 
       $this->drupalGet($autocomplete_path, ['query' => ['q' => 'test']]);
-      $assert_session->statusCodeEquals(200);
     }
     $this->drupalLogin($this->adminUser);
   }
@@ -503,6 +507,8 @@ protected function checkAutocompleteAccess() {
    * Verifies that admin pages are properly protected.
    */
   protected function checkAdminAccess() {
+    $assert_session = $this->assertSession();
+
     // Make sure anonymous and non-admin users cannot access admin pages.
     $users = [
       'non-admin' => $this->normalUser,
@@ -520,8 +526,8 @@ protected function checkAdminAccess() {
       }
       foreach ($paths as $label => $path) {
         $this->drupalGet($path);
-        $status_code = $this->getSession()->getStatusCode();
-        $this->assertEquals(403, $status_code, "The $label is accessible for $user_type users.");
+        $assert_session->pageTextContains('Access denied');
+        $assert_session->pageTextContains('You are not authorized to access this page.');
       }
     }
     $this->drupalLogin($this->adminUser);
@@ -584,36 +590,4 @@ protected function logPageChange($url = NULL, $method = 'GET') {
     $this->htmlOutput($html_output);
   }
 
-  /**
-   * Asserts that the specified element exists and is visible.
-   *
-   * @param string $selector_type
-   *   The element selector type (CSS, XPath).
-   * @param string|array $selector
-   *   The element selector. Note: the first found element is used.
-   *
-   * @throws \Behat\Mink\Exception\ElementHtmlException
-   *   Thrown if the element doesn't exist.
-   */
-  protected function assertVisible($selector_type, $selector) {
-    $element = $this->assertSession()->elementExists($selector_type, $selector);
-    $this->assertTrue($element->isVisible(), "Element should be visible but isn't.");
-  }
-
-  /**
-   * Asserts that the specified element exists but is not visible.
-   *
-   * @param string $selector_type
-   *   The element selector type (CSS, XPath).
-   * @param string|array $selector
-   *   The element selector. Note: the first found element is used.
-   *
-   * @throws \Behat\Mink\Exception\ElementHtmlException
-   *   Thrown if the element doesn't exist.
-   */
-  protected function assertNotVisible($selector_type, $selector) {
-    $element = $this->assertSession()->elementExists($selector_type, $selector);
-    $this->assertFalse($element->isVisible(), "Element shouldn't be visible but is.");
-  }
-
 }
diff --git a/tests/src/FunctionalJavascript/IntegrationTestBase.php b/tests/src/FunctionalJavascript/IntegrationTestBase.php
index b7a93dc..70e4a49 100644
--- a/tests/src/FunctionalJavascript/IntegrationTestBase.php
+++ b/tests/src/FunctionalJavascript/IntegrationTestBase.php
@@ -4,13 +4,13 @@
 
 use Behat\Mink\Driver\GoutteDriver;
 use Behat\Mink\Element\NodeElement;
-use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
+use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
 use Drupal\search_api_test\PluginTestTrait;
 
 /**
  * Provides a base class for integration tests of this module.
  */
-abstract class IntegrationTestBase extends JavascriptTestBase {
+abstract class IntegrationTestBase extends WebDriverTestBase {
 
   use PluginTestTrait;
 
@@ -38,7 +38,7 @@ protected function getAutocompleteSuggestions($field_html_id = 'edit-keys', $inp
     $page = $this->getSession()->getPage();
     $assert_session = $this->assertSession();
     $field = $assert_session->elementExists('css', "input[data-drupal-selector=\"$field_html_id\"]");
-    $field->setValue(substr($input, 0, -1));
+    $field->setValue($input);
     $this->getSession()
       ->getDriver()
       ->keyDown($field->getXpath(), substr($input, -1));
@@ -133,7 +133,7 @@ protected function logPageChange($url = NULL, $method = 'GET') {
    * @param string|array $selector
    *   The element selector. Note: the first found element is used.
    *
-   * @throws \Behat\Mink\Exception\ElementHtmlException
+   * @throws \Behat\Mink\Exception\ElementNotFoundException
    *   Thrown if the element doesn't exist.
    */
   protected function assertVisible($selector_type, $selector) {
@@ -149,7 +149,7 @@ protected function assertVisible($selector_type, $selector) {
    * @param string|array $selector
    *   The element selector. Note: the first found element is used.
    *
-   * @throws \Behat\Mink\Exception\ElementHtmlException
+   * @throws \Behat\Mink\Exception\ElementNotFoundException
    *   Thrown if the element doesn't exist.
    */
   protected function assertNotVisible($selector_type, $selector) {
diff --git a/tests/src/FunctionalJavascript/PagesIntegrationTest.php b/tests/src/FunctionalJavascript/PagesIntegrationTest.php
index 88d540d..e3fdd74 100644
--- a/tests/src/FunctionalJavascript/PagesIntegrationTest.php
+++ b/tests/src/FunctionalJavascript/PagesIntegrationTest.php
@@ -105,7 +105,6 @@ protected function enableSearch() {
     // Save the settings.
     $this->click('[data-drupal-selector="edit-actions-submit"]');
     $this->logPageChange(NULL, 'POST');
-    $assert_session->statusCodeEquals(200);
     $assert_session->pageTextContains('The settings have been saved.');
     // Our admin user for this test doesn't have the "administer permissions"
     // permission, so the permission reminder should not be included.
@@ -114,8 +113,9 @@ protected function enableSearch() {
     // Edit the search.
     $this->click('.dropbutton-action a[href$="/edit"]');
     $this->logPageChange();
-    $assert_session->statusCodeEquals(200);
     $assert_session->addressEquals($this->getAdminPath('edit'));
+    $page = $this->getSession()->getPage();
+    $page->findButton('Show row weights')->click();
     $edit = [
       'suggesters[enabled][server]' => TRUE,
       'suggesters[enabled][search_api_autocomplete_test]' => TRUE,
@@ -161,7 +161,6 @@ protected function checkAutocompleteFunctionality() {
     $assert_session = $this->assertSession();
 
     $this->drupalGet('test-search');
-    $assert_session->statusCodeEquals(200);
 
     $assert_session->elementAttributeContains('css', 'input[data-drupal-selector="edit-keys"]', 'data-search-api-autocomplete-search', $this->searchId);
 
@@ -206,13 +205,15 @@ protected function checkAutocompleteFunctionality() {
     list($query) = $this->getMethodArguments('backend', 'getAutocompleteSuggestions');
     $this->assertEquals(['name'], $query->getFulltextFields());
 
+    $this->drupalGet($this->getAdminPath('edit'));
+    $page = $this->getSession()->getPage();
+    $page->find('css', '#edit-suggesters-settings-server > summary')->click();
     $edit = [
       'suggesters[settings][server][fields][body]' => TRUE,
     ];
-    $this->drupalPostForm($this->getAdminPath('edit'), $edit, 'Save');
+    $this->drupalPostForm(NULL, $edit, 'Save');
 
     $this->drupalGet('test-search');
-    $assert_session->statusCodeEquals(200);
 
     $elements = $this->getAutocompleteSuggestions();
     $this->assertCount(5, $elements);
