diff --git a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditIntegrationTest.php b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditIntegrationTest.php index 0094b376bf..57b4074b7c 100644 --- a/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditIntegrationTest.php +++ b/core/modules/quickedit/tests/src/FunctionalJavascript/QuickEditIntegrationTest.php @@ -21,7 +21,7 @@ class QuickEditIntegrationTest extends QuickEditJavascriptTestBase { /** * {@inheritdoc} */ - public static $modules = ['node', 'editor', 'ckeditor', 'taxonomy', 'block', 'block_content']; + public static $modules = ['node', 'editor', 'ckeditor', 'taxonomy', 'block', 'block_content', 'settings_tray_test_css']; /** * A user with permissions to edit Articles and use Quick Edit. @@ -83,7 +83,6 @@ protected function setUp() { ->setComponent($field_name, ['type' => 'entity_reference_label']) ->save(); - $this->drupalPlaceBlock('page_title_block'); $this->drupalPlaceBlock('system_main_block'); // Log in as a content author who can use Quick Edit and edit Articles. @@ -99,6 +98,9 @@ protected function setUp() { 'administer blocks', ]); $this->drupalLogin($this->contentAuthorUser); + + \Drupal::service('theme_handler')->install(['bartik']); + \Drupal::theme()->setActiveTheme(\Drupal::service('theme.initialization')->initTheme('bartik')); } /** @@ -152,9 +154,11 @@ public function testArticleNode() { 'node/1/field_tags/en/full' => 'candidate', ]); - // Click the title field. - $this->click('h1.js-quickedit-page-title > span'); $assert_session = $this->assertSession(); + + // Click the title field. + $assert_session->waitForElementVisible('css', '[data-quickedit-field-id="node/1/title/en/full"].quickedit-candidate')->click(); + $assert_session->waitForElementVisible('css', '.quickedit-toolbar.quickedit-toolbar-entity .field'); $assert_session->waitForElement('css', '.quickedit-toolbar-field div[id*="title"]'); $this->assertQuickEditEntityToolbar((string) $node->label(), 'Title'); $this->assertEntityInstanceFieldStates('node', 1, 0, [ @@ -169,7 +173,8 @@ public function testArticleNode() { ]); // Append something to the title. - $this->typeInPlainTextEditor('h1.js-quickedit-page-title > span', $node->label() . ' Llamas are awesome!'); + $this->typeInPlainTextEditor('[data-quickedit-field-id="node/1/title/en/full"].quickedit-candidate', $node->label() . ' Llamas are awesome!'); + $this->awaitEntityInstanceFieldState('node', 1, 0, 'title', 'en', 'changed'); $this->assertEntityInstanceFieldStates('node', 1, 0, [ 'node/1/title/en/full' => 'changed', 'node/1/uid/en/full' => 'candidate', @@ -179,7 +184,8 @@ public function testArticleNode() { ]); // Click the body field. - $this->click('[data-quickedit-entity-id="node/1"] .field--name-body'); + $assert_session->waitForElementVisible('css', '[data-quickedit-field-id="node/1/body/en/full"]')->click(); + $assert_session->waitForElementVisible('css', '.quickedit-toolbar.quickedit-toolbar-entity .field'); $assert_session->waitForElement('css', '.quickedit-toolbar-field div[id*="body"]'); $this->assertQuickEditEntityToolbar((string) $node->label(), 'Body'); $this->assertEntityInstanceFieldStates('node', 1, 0, [ @@ -198,11 +204,12 @@ public function testArticleNode() { ]); $this->assertSession()->elementExists('css', '#quickedit-entity-toolbar .quickedit-toolgroup.wysiwyg-main > .cke_chrome .cke_top[role="presentation"] .cke_toolbar[role="toolbar"] .cke_toolgroup[role="presentation"] > .cke_button[title~="Bold"][role="button"]'); - // Wait for the validating & saving of the tags field to complete. - $this->awaitEntityInstanceFieldState('node', 1, 0, 'field_tags', 'en', 'candidate'); + // Wait for the validating & saving of the title to complete. + $this->awaitEntityInstanceFieldState('node', 1, 0, 'title', 'en', 'candidate'); // Click the tags field. - $this->click('.field--name-field-tags'); + $assert_session->waitForElementVisible('css', '[data-quickedit-field-id="node/1/field_tags/en/full"]')->click(); + $assert_session->waitForElementVisible('css', '.quickedit-toolbar.quickedit-toolbar-entity .field'); $assert_session->waitForElement('css', '.quickedit-toolbar-field div[id*="tags"]'); $this->assertQuickEditEntityToolbar((string) $node->label(), 'Tags'); $this->assertEntityInstanceFieldStates('node', 1, 0, [