diff --git a/modules/acquia_cms_common/tests/src/FunctionalJavascript/MediaEmbedTestBase.php b/modules/acquia_cms_common/tests/src/FunctionalJavascript/MediaEmbedTestBase.php index e4048c029..dfb0997fb 100644 --- a/modules/acquia_cms_common/tests/src/FunctionalJavascript/MediaEmbedTestBase.php +++ b/modules/acquia_cms_common/tests/src/FunctionalJavascript/MediaEmbedTestBase.php @@ -83,9 +83,13 @@ public function testEmbedMedia() { if (AcquiaDrupalEnvironmentDetector::isAhIdeEnv()) { $this->markTestSkipped('This cannot be run in a Cloud IDE right now'); } - $node_type = $this->drupalCreateContentType()->id(); + $bundle = 'page'; + $this->drupalCreateContentType([ + 'type' => 'page', + 'name' => 'Page', + ]); user_role_grant_permissions('content_author', [ - "create $node_type content", + "create $bundle content", ]); $account = $this->drupalCreateUser(); @@ -93,7 +97,7 @@ public function testEmbedMedia() { $account->save(); $this->drupalLogin($account); - $this->drupalGet("/node/add/$node_type"); + $this->drupalGet("/node/add/$bundle"); $this->openMediaLibrary(); // The media position number now starts from 1 (instead of 0) starting @@ -216,6 +220,7 @@ protected function openMediaLibrary() { if ($showMoreItems) { $this->pressEditorButton('Show more items'); } + $assertSession->waitForText('body'); $this->pressEditorButton('Insert Media'); /** @var \Drupal\FunctionalJavascriptTests\JSWebAssert $assertSession */ $assertSession = $this->assertSession();