Verified Commit 1074da88 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3268678 by bnjmnm: [random test failure] Restore...

Issue #3268678 by bnjmnm: [random test failure] Restore ContentPreviewToggleTest::testContentPreviewToggle()

(cherry picked from commit dcf0fd3b)
(cherry picked from commit b9f1240c)
parent 4a16fbe6
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@

use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
use Drupal\Tests\contextual\FunctionalJavascript\ContextualLinkClickTrait;
use Drupal\Tests\system\Traits\OffCanvasTestTrait;

/**
 * Tests toggling of content preview.
@@ -14,7 +15,7 @@ class ContentPreviewToggleTest extends WebDriverTestBase {

  use ContextualLinkClickTrait;
  use LayoutBuilderSortTrait;

  use OffCanvasTestTrait;
  /**
   * {@inheritdoc}
   */
@@ -23,6 +24,7 @@ class ContentPreviewToggleTest extends WebDriverTestBase {
    'block',
    'node',
    'contextual',
    'off_canvas_test',
  ];

  /**
@@ -50,7 +52,6 @@ protected function setUp(): void {
   * Tests the content preview toggle.
   */
  public function testContentPreviewToggle() {
    $this->markTestSkipped();
    $assert_session = $this->assertSession();
    $page = $this->getSession()->getPage();
    $links_field_placeholder_label = '"Links" field';
@@ -92,7 +93,6 @@ public function testContentPreviewToggle() {
    $this->getSession()->reload();
    $this->assertNotEmpty($assert_session->waitForElement('css', '.layout-builder-block__content-preview-placeholder-label'));
    $assert_session->pageTextNotContains($content_preview_body_text);
    $this->markTestSkipped('Temporarily skipped due to random failures.');
    $this->assertContextualLinks();

    // Confirm repositioning blocks works with content preview disabled.
@@ -133,7 +133,7 @@ protected function assertContextualLinks(): void {
    $assert_session = $this->assertSession();

    $this->clickContextualLink('.block-field-blocknodebundle-for-this-particular-testbody', 'Configure');
    $this->assertNotEmpty($assert_session->waitForElement('css', "#drupal-off-canvas"));
    $this->waitForOffCanvasArea();
    $this->assertSession()->assertWaitOnAjaxRequest();
    $this->assertNotEmpty($this->assertSession()->waitForButton('Close'));
    $page->pressButton('Close');