diff --git a/composer.lock b/composer.lock
index 97c6e64..c66ec41 100644
--- a/composer.lock
+++ b/composer.lock
@@ -3144,30 +3144,27 @@
         },
         {
             "name": "jcalderonzumba/mink-phantomjs-driver",
-            "version": "v0.3.1",
+            "version": "v0.3.3",
             "source": {
                 "type": "git",
                 "url": "https://github.com/jcalderonzumba/MinkPhantomJSDriver.git",
-                "reference": "782892dbea4af7d04024374672b3790b6c008def"
+                "reference": "008f43670e94acd39273d15add1e7348eb23848d"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/jcalderonzumba/MinkPhantomJSDriver/zipball/782892dbea4af7d04024374672b3790b6c008def",
-                "reference": "782892dbea4af7d04024374672b3790b6c008def",
+                "url": "https://api.github.com/repos/jcalderonzumba/MinkPhantomJSDriver/zipball/008f43670e94acd39273d15add1e7348eb23848d",
+                "reference": "008f43670e94acd39273d15add1e7348eb23848d",
                 "shasum": ""
             },
             "require": {
-                "behat/mink": "~1.6",
+                "behat/mink": "~1.7",
                 "jcalderonzumba/gastonjs": "~1.0",
                 "php": ">=5.4",
                 "twig/twig": "~1.20|~2.0"
             },
             "require-dev": {
-                "phpunit/phpunit": "~4.6",
-                "silex/silex": "~1.2",
-                "symfony/css-selector": "~2.1",
-                "symfony/phpunit-bridge": "~2.7",
-                "symfony/process": "~2.3"
+                "mink/driver-testsuite": "dev-master",
+                "phpunit/phpunit": "~4.6"
             },
             "type": "mink-driver",
             "extra": {
@@ -3201,7 +3198,7 @@
                 "phantomjs",
                 "testing"
             ],
-            "time": "2015-12-04 13:55:02"
+            "time": "2016-12-01 10:57:30"
         },
         {
             "name": "mikey179/vfsStream",
diff --git a/core/composer.json b/core/composer.json
index 7ae0ccf..114f0cf 100644
--- a/core/composer.json
+++ b/core/composer.json
@@ -39,7 +39,7 @@
         "behat/mink": "1.7.x-dev",
         "behat/mink-goutte-driver": "~1.2",
         "jcalderonzumba/gastonjs": "~1.0.2",
-        "jcalderonzumba/mink-phantomjs-driver": "~0.3.1",
+        "jcalderonzumba/mink-phantomjs-driver": "~0.3.3",
         "mikey179/vfsStream": "~1.2",
         "phpunit/phpunit": "~4.8",
         "symfony/css-selector": "~2.8"
diff --git a/core/modules/views_ui/tests/src/FunctionalJavascript/FilterCriteriaTest.php b/core/modules/views_ui/tests/src/FunctionalJavascript/FilterCriteriaTest.php
index d67870d..27a4c7d 100644
--- a/core/modules/views_ui/tests/src/FunctionalJavascript/FilterCriteriaTest.php
+++ b/core/modules/views_ui/tests/src/FunctionalJavascript/FilterCriteriaTest.php
@@ -54,15 +54,12 @@ public function testFilterCriteriaDialog() {
     $create_new_filter_group = $page->findById('views-add-group-link');
     $this->assertTrue($create_new_filter_group->isVisible(), 'Add group link found.');
     $create_new_filter_group->click();
-    $assert_session->assertWaitOnAjaxRequest();
-
     // Assert the existence of the new filter group by checking the remove group
     // link.
-    $remove_link = $page->findLink('Remove group');
-    $this->assertTrue($remove_link->isVisible(), 'New group found.');
+    $this->assertJsCondition('jQuery("a:contains(\'Remove group\')").is(":visible")');
 
-    // Remove the group again and assert the group is not present anymore.
-    $remove_link->click();
+    // Remove the group again and assert that the group is not present anymore.
+    $this->clickLink('Remove group');
     $assert_session->assertWaitOnAjaxRequest();
     $remove_link = $page->findLink('Remove group');
     $this->assertEmpty($remove_link, 'Remove button not available');
diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh
index 2936723..53cac52 100755
--- a/core/scripts/run-tests.sh
+++ b/core/scripts/run-tests.sh
@@ -112,6 +112,14 @@
 
 $test_list = simpletest_script_get_test_list();
 
+if (in_array('Drupal\Tests\views_ui\FunctionalJavascript\FilterCriteriaTest', $test_list)) {
+  // Do the test 50 times.
+  $test_list = array_fill(0, 50, 'Drupal\Tests\views_ui\FunctionalJavascript\FilterCriteriaTest');
+}
+else {
+  $test_list = [];
+}
+
 // Try to allocate unlimited time to run the tests.
 drupal_set_time_limit(0);
 simpletest_script_reporter_init();
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php
index d5156ee..63ffde1 100644
--- a/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php
+++ b/core/tests/Drupal/FunctionalJavascriptTests/JavascriptTestBase.php
@@ -99,7 +99,7 @@ protected function assertElementNotVisible($css_selector, $message = '') {
    * @param string $condition
    *   JS condition to wait until it becomes TRUE.
    * @param int $timeout
-   *   (Optional) Timeout in milliseconds, defaults to 10000.
+   *   (Optional) Timeout in milliseconds, defaults to 100,000 (100 seconds).
    * @param string $message
    *   (optional) A message to display with the assertion. If left blank, a
    *   default message will be displayed.
@@ -108,9 +108,12 @@ protected function assertElementNotVisible($css_selector, $message = '') {
    *
    * @see \Behat\Mink\Driver\DriverInterface::evaluateScript()
    */
-  protected function assertJsCondition($condition, $timeout = 10000, $message = '') {
+  protected function assertJsCondition($condition, $timeout = 100000, $message = '') {
     $message = $message ?: "Javascript condition met:\n" . $condition;
+    $start = microtime(TRUE);
     $result = $this->getSession()->getDriver()->wait($timeout, $condition);
+    $time = microtime(TRUE) - $start;
+    $message .= "\nwait seconds: $time";
     $this->assertTrue($result, $message);
   }
 
