Loading core/modules/layout_builder/tests/src/FunctionalJavascript/AjaxBlockTest.php +7 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ use Drupal\FunctionalJavascriptTests\WebDriverTestBase; use Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay; use Drupal\Tests\system\Traits\OffCanvasTestTrait; /** * Ajax blocks tests. Loading @@ -12,6 +13,8 @@ */ class AjaxBlockTest extends WebDriverTestBase { use OffCanvasTestTrait; /** * {@inheritdoc} */ Loading @@ -22,6 +25,7 @@ class AjaxBlockTest extends WebDriverTestBase { 'layout_builder', 'user', 'layout_builder_test', 'off_canvas_test', ]; /** Loading Loading @@ -78,14 +82,15 @@ public function testAddAjaxBlock() { // Add a new block. $assert_session->linkExists('Add block'); $this->clickLink('Add block'); $this->waitForOffCanvasArea(); $assert_session->assertWaitOnAjaxRequest(); $assert_session->linkExists('TestAjax'); $this->clickLink('TestAjax'); $this->waitForOffCanvasArea(); $assert_session->assertWaitOnAjaxRequest(); // Find the radio buttons. $name = 'settings[ajax_test]'; /** @var \Behat\Mink\Element\NodeElement[] $radios */ $this->markTestSkipped('Temporarily skipped due to random failures.'); $radios = $this->assertSession()->fieldExists($name); // Click them both a couple of times. foreach ([1, 2] as $rounds) { Loading @@ -97,6 +102,7 @@ public function testAddAjaxBlock() { // Then add the block. $assert_session->waitForElementVisible('named', ['button', 'Add block'])->press(); $assert_session->assertWaitOnAjaxRequest(); $assert_session->waitForElementVisible('css', '.block-layout-builder-test-testajax'); $block_elements = $this->cssSelect('.block-layout-builder-test-testajax'); // Should be exactly one of these in there. $this->assertCount(1, $block_elements); Loading Loading
core/modules/layout_builder/tests/src/FunctionalJavascript/AjaxBlockTest.php +7 −1 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ use Drupal\FunctionalJavascriptTests\WebDriverTestBase; use Drupal\layout_builder\Entity\LayoutBuilderEntityViewDisplay; use Drupal\Tests\system\Traits\OffCanvasTestTrait; /** * Ajax blocks tests. Loading @@ -12,6 +13,8 @@ */ class AjaxBlockTest extends WebDriverTestBase { use OffCanvasTestTrait; /** * {@inheritdoc} */ Loading @@ -22,6 +25,7 @@ class AjaxBlockTest extends WebDriverTestBase { 'layout_builder', 'user', 'layout_builder_test', 'off_canvas_test', ]; /** Loading Loading @@ -78,14 +82,15 @@ public function testAddAjaxBlock() { // Add a new block. $assert_session->linkExists('Add block'); $this->clickLink('Add block'); $this->waitForOffCanvasArea(); $assert_session->assertWaitOnAjaxRequest(); $assert_session->linkExists('TestAjax'); $this->clickLink('TestAjax'); $this->waitForOffCanvasArea(); $assert_session->assertWaitOnAjaxRequest(); // Find the radio buttons. $name = 'settings[ajax_test]'; /** @var \Behat\Mink\Element\NodeElement[] $radios */ $this->markTestSkipped('Temporarily skipped due to random failures.'); $radios = $this->assertSession()->fieldExists($name); // Click them both a couple of times. foreach ([1, 2] as $rounds) { Loading @@ -97,6 +102,7 @@ public function testAddAjaxBlock() { // Then add the block. $assert_session->waitForElementVisible('named', ['button', 'Add block'])->press(); $assert_session->assertWaitOnAjaxRequest(); $assert_session->waitForElementVisible('css', '.block-layout-builder-test-testajax'); $block_elements = $this->cssSelect('.block-layout-builder-test-testajax'); // Should be exactly one of these in there. $this->assertCount(1, $block_elements); Loading