Problem/Motivation

drupalPostAjaxForm() is simulating the behaviour of ajax.js, so using it, doesn't really provide fundamental guarantees.
#2809161: Convert Javascript/AJAX testing to use JavascriptTestBase suggests to convert them to JavascriptTestBase

Proposed resolution

  1. Figure out which part of the test is testing PHP code and which part ajax behaviour
  2. Extract the ajax behaviour into a test that extends JavascriptTestBase

The AJAX behaviour getting tested here is just that a view edit form gets rendered in a dialog, we have coverage for that in \Drupal\Tests\views_ui\FunctionalJavascript\DisplayTest, so we should be able to get by without using AJAX.

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#7 2809553-7.patch1.83 KBlendude

Comments

dawehner created an issue. See original summary.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

michielnugter’s picture

Component: phpunit » views_ui.module
Issue tags: +phpunit initiative

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

lendude’s picture

Title: Convert AJAX part of \Drupal\views_ui\Tests\RowUITest to JavascriptTestBase » Convert AJAX part of \Drupal\views_ui\Tests\RowUITest to BrowserTestBase
Issue summary: View changes
Status: Active » Needs review
StatusFileSize
new1.83 KB

The AJAX behaviour getting tested here is just that a view edit form gets rendered in a dialog, we have coverage for that in \Drupal\Tests\views_ui\FunctionalJavascript\DisplayTest, so we should be able to get by without using AJAX and not lose coverage.

So this is just a straight conversion to BrowserTestBase.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Nice!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

And then there was one view_ui test left.

Committed and pushed c51bd29cdf to 8.7.x and 6aabc78b33 to 8.6.x. Thanks!

  • alexpott committed c51bd29 on 8.7.x
    Issue #2809553 by Lendude: Convert AJAX part of \Drupal\views_ui\Tests\...

  • alexpott committed 6aabc78 on 8.6.x
    Issue #2809553 by Lendude: Convert AJAX part of \Drupal\views_ui\Tests\...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.