diff --git a/composer.lock b/composer.lock index 97c6e64..431e4f8 100644 --- a/composer.lock +++ b/composer.lock @@ -3087,16 +3087,16 @@ }, { "name": "jcalderonzumba/gastonjs", - "version": "v1.0.2", + "version": "dev-debug-klausi", "source": { "type": "git", - "url": "https://github.com/jcalderonzumba/gastonjs.git", - "reference": "21bebb8ca03eb0f93ec2f3fad61192fb079e2622" + "url": "https://github.com/klausi/gastonjs.git", + "reference": "941c0f863407ad485ba335152c5dac3b7ca15716" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jcalderonzumba/gastonjs/zipball/21bebb8ca03eb0f93ec2f3fad61192fb079e2622", - "reference": "21bebb8ca03eb0f93ec2f3fad61192fb079e2622", + "url": "https://api.github.com/repos/klausi/gastonjs/zipball/941c0f863407ad485ba335152c5dac3b7ca15716", + "reference": "941c0f863407ad485ba335152c5dac3b7ca15716", "shasum": "" }, "require": { @@ -3112,7 +3112,7 @@ "type": "phantomjs-api", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-debug-klausi": "1.1.x-dev" } }, "autoload": { @@ -3120,7 +3120,11 @@ "Zumba\\GastonJS\\": "src" } }, - "notification-url": "https://packagist.org/downloads/", + "autoload-dev": { + "psr-4": { + "Zumba\\GastonJS\\Tests\\": "tests/unit" + } + }, "license": [ "MIT" ], @@ -3140,7 +3144,10 @@ "headless", "phantomjs" ], - "time": "2016-01-18 09:21:03" + "support": { + "source": "https://github.com/klausi/gastonjs/tree/debug-klausi" + }, + "time": "2016-12-05 14:46:22" }, { "name": "jcalderonzumba/mink-phantomjs-driver", @@ -4208,7 +4215,8 @@ "aliases": [], "minimum-stability": "dev", "stability-flags": { - "behat/mink": 20 + "behat/mink": 20, + "jcalderonzumba/gastonjs": 20 }, "prefer-stable": true, "prefer-lowest": false, diff --git a/core/composer.json b/core/composer.json index 7ae0ccf..4dd96c9 100644 --- a/core/composer.json +++ b/core/composer.json @@ -3,6 +3,12 @@ "description": "Drupal is an open source content management platform powering millions of websites and applications.", "type": "drupal-core", "license": "GPL-2.0+", + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/klausi/gastonjs" + } + ], "require": { "php": ">=5.5.9", "symfony/class-loader": "~2.8", @@ -38,7 +44,7 @@ "require-dev": { "behat/mink": "1.7.x-dev", "behat/mink-goutte-driver": "~1.2", - "jcalderonzumba/gastonjs": "~1.0.2", + "jcalderonzumba/gastonjs": "dev-debug-klausi", "jcalderonzumba/mink-phantomjs-driver": "~0.3.1", "mikey179/vfsStream": "~1.2", "phpunit/phpunit": "~4.8", diff --git a/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php index 9388ec8..86706d4 100644 --- a/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php +++ b/core/modules/outside_in/tests/src/FunctionalJavascript/OutsideInBlockFormTest.php @@ -1,6 +1,7 @@ markTestSkipped('Test skipped due to random failures in DrupalCI, see https://www.drupal.org/node/2830485'); - $web_assert = $this->assertSession(); $blocks = [ [ @@ -80,16 +78,26 @@ public function testBlocks() { foreach ($blocks as $block) { $block_selector = '#' . $block['id']; $this->drupalGet('user'); + $initial = $this->getSession()->getScreenshot(); if (isset($block['toolbar_item'])) { + $has_open_tray = FALSE; // Check that you can open a toolbar tray and it will be closed after // entering edit mode. if ($element = $page->find('css', "#toolbar-administration a.is-active")) { + $has_open_tray = TRUE; // If a tray was open from page load close it. $element->click(); $this->waitForNoElement("#toolbar-administration a.is-active"); } - $page->find('css', $block['toolbar_item'])->click(); - $this->waitForElement("{$block['toolbar_item']}.is-active"); + try { + $page->find('css', $block['toolbar_item'])->click(); + $this->waitForElement("{$block['toolbar_item']}.is-active"); + } + catch (BrowserError $exception) { + $image = $this->getSession()->getScreenshot(); + + $this->assertEquals('', ($has_open_tray ? 'has-open-tray' : '') . ' imginitial' . base64_encode($initial) . 'imginitialend' . ' imgresult' . base64_encode($image) . 'imgresultend'); + } } $this->toggleEditingMode(); if (isset($block['toolbar_item'])) { diff --git a/core/scripts/run-tests.sh b/core/scripts/run-tests.sh index 2936723..cad1642 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\outside_in\FunctionalJavascript\OutsideInBlockFormTest', $test_list)) { + // Do the test 100 times. + $test_list = array_fill(0, 100, 'Drupal\Tests\outside_in\FunctionalJavascript\OutsideInBlockFormTest'); +} +else { + $test_list = []; +} + // Try to allocate unlimited time to run the tests. drupal_set_time_limit(0); simpletest_script_reporter_init();