- Status changed to Needs work
almost 2 years ago 3:25pm 27 February 2023 - 🇺🇸United States smustgrave
Will give it another shot but was having issues with those test modules
Thanks!
- Status changed to Needs review
over 1 year ago 6:58pm 7 April 2023 The last submitted patch, 51: 2724829-51-tests-only.patch, failed testing. View results →
- 🇮🇳India TanujJain-TJ
Tested and verified patch #51 with drupal: 10.1.x and the patch applied successfully and fixed the issue of multiple message on page. adding screenshots for reference. RTBC+1
- 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
+++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxMaintenanceModeTest.php @@ -0,0 +1,72 @@ + // Turn on maintenance mode. + $edit = [ + 'maintenance_mode' => 1, + ]; + $this->drupalGet('admin/config/development/maintenance'); + $this->submitForm($edit, 'Save configuration');
Micro-optimisation, but I think we can enable this by setting the flag direct in state rather than needing to submit the form, will save a few HTTP requests and speed up the test
Other than that, makes sense to me
- last update
over 1 year ago 29,284 pass - 🇺🇸United States dww
The test-only patch is failing exactly as expected:
1) Drupal\FunctionalJavascriptTests\Ajax\AjaxMaintenanceModeTest::testAjaxCallMaintenanceMode Behat\Mink\Exception\ResponseTextException: Failed asserting that the page matches the pattern '/Operating in maintenance mode/ui' 1 time(s), 2 found. Failed asserting that 2 is identical to 1.
I closely reviewed the code here. Almost all looked great. Found a couple of very trivial nits. Fixing those as a new patch and RTBC'ing.
- Status changed to RTBC
over 1 year ago 12:42am 20 April 2023 9:21 5:42 Running- last update
over 1 year ago 29,303 pass - Status changed to Fixed
over 1 year ago 8:47am 24 April 2023 - 🇬🇧United Kingdom alexpott 🇪🇺🌍
diff --git a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxMaintenanceModeTest.php b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxMaintenanceModeTest.php index 4d4d72b8ad..335557cdba 100644 --- a/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxMaintenanceModeTest.php +++ b/core/tests/Drupal/FunctionalJavascriptTests/Ajax/AjaxMaintenanceModeTest.php @@ -18,13 +18,6 @@ class AjaxMaintenanceModeTest extends WebDriverTestBase { use FileFieldCreationTrait; use TestFileCreationTrait; - /** - * An user with administration permissions. - * - * @var \Drupal\user\UserInterface - */ - protected $adminUser; - /** * {@inheritdoc} */ @@ -40,26 +33,22 @@ class AjaxMaintenanceModeTest extends WebDriverTestBase { */ protected function setUp(): void { parent::setUp(); - $this->adminUser = $this->drupalCreateUser([ + $this->drupalLogin($this->drupalCreateUser([ 'access administration pages', 'administer site configuration', 'access site in maintenance mode', - ]); - $this->drupalLogin($this->adminUser); + ])); } /** * Tests maintenance message only appears once on an AJAX call. */ public function testAjaxCallMaintenanceMode(): void { - $page = $this->getSession()->getPage(); - $assert_session = $this->assertSession(); - \Drupal::state()->set('system.maintenance_mode', TRUE); $this->drupalGet('ajax-test/insert-inline-wrapper'); - $assert_session->pageTextContains('Target inline'); - $page->clickLink('Link html pre-wrapped-div'); + $this->assertSession()->pageTextContains('Target inline'); + $this->clickLink('Link html pre-wrapped-div'); $this->assertSession()->assertWaitOnAjaxRequest(); $this->assertSession()->pageTextContainsOnce('Operating in maintenance mode'); }
I was going to make the above changes on commit. Not important enough to do a revert but maybe someone wants to do a followup. We don't need the adminUser variable on test object and the $page and $assert_session variables are unnecessary and not even used consistently.
Automatically closed - issue fixed for 2 weeks with no activity.