Support from Acquia helps fund testing for Drupal Acquia logo

Comments

mathilde_dumond created an issue. See original summary.

mathilde_dumond’s picture

Title: ParagraphsAdministrationTest test fail » ParagraphsAdministrationTest test fail on 9.2
Status: Needs work » Postponed
mathilde_dumond’s picture

mathilde_dumond’s picture

Title: ParagraphsAdministrationTest test fail on 9.2 » Fix D9 test fails
Issue summary: View changes

Problem/Motivation

Creating this issue after a test fail here https://www.drupal.org/pift-ci-job/2155358 on ParagraphsAdministrationTest.

I ran the test locally (on top of Drupal 9.2) and it failed as well on a clean install.

The error is: The string "<a href="http://drupal.local/sites/simpletest/81722527/files/2021-08/image-test.png" type="image/png; length=125">image-test.png</a>" was not found anywhere in the HTML response of the current page. whereas the actual string is <a href="http://drupal.local/sites/simpletest/81722527/files/2021-08/image-test.png" type="image/png">image-test.png</a> so I am guessing that this could be linked to the Media changes that we are seeing in core?

From https://www.drupal.org/pift-ci-job/2155358 I see that the last success was in May and 8.9 got some changes in the meantime.

Steps to reproduce

Proposed resolution

update the test string to <a href="http://drupal.local/sites/simpletest/81722527/files/2021-08/image-test.png" type="image/png">image-test.png</a> (the actual string from the test)

Berdir’s picture

Status: Postponed » Active

did some digging. these assertions go back a very long time, seems to be part of the very first version of that test that one of our first ever students did, that was before john was working for us, although he did work on that test once as well

I would propose that we simplify that and just assert for the image url, we don't have to test core markup that not even core itself was testing for.

sleitner’s picture

Status: Needs review » Needs work

The last submitted patch, 6: paragraphs_3229472_6.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

sleitner’s picture

FileSize
12.14 KB
sleitner’s picture

sleitner’s picture

Status: Needs work » Needs review

Replaced some asserts with more general ones to fit with both Drupal 8 and 9.

There is currently a problem in search_api which leads to the failure with Mysql 5.5: https://www.drupal.org/project/search_api/issues/3247781

sleitner’s picture

alexpott’s picture

+++ b/tests/src/Functional/WidgetLegacy/ParagraphsConfigTest.php
@@ -214,8 +214,8 @@ class ParagraphsConfigTest extends ParagraphsTestBase {
-    $this->assertSession()->pageTextContains('Add paragraph_type_test');
-    $this->assertSession()->pageTextNotContains('Add text');
+    $this->assertSession()->responseContains('Add paragraph_type_test');
+    $this->assertSession()->responseNotContains('Add text');

@@ -237,8 +237,8 @@ class ParagraphsConfigTest extends ParagraphsTestBase {
-    $this->assertSession()->pageTextContains('Add paragraph_type_test');
-    $this->assertSession()->pageTextNotContains('Add text');
+    $this->assertSession()->responseContains('Add paragraph_type_test');
+    $this->assertSession()->responseNotContains('Add text');
   }

+++ b/tests/src/Functional/WidgetStable/ParagraphsConfigTest.php
@@ -182,7 +182,7 @@ class ParagraphsConfigTest extends ParagraphsTestBase {
-    $this->assertSession()->pageTextContains('Add paragraph_type_test');
+    $this->assertSession()->responseContains('Add paragraph_type_test');
     $this->assertSession()->pageTextNotContains('Add text');

@@ -229,8 +229,8 @@ class ParagraphsConfigTest extends ParagraphsTestBase {
-    $this->assertSession()->pageTextContains('Add paragraph_type_test');
-    $this->assertSession()->pageTextNotContains('Add text');
+    $this->assertSession()->responseContains('Add paragraph_type_test');
+    $this->assertSession()->responseNotContains('Add text');

These are button texts... at least the positive assertion could be $this->assertSession()->buttonExists('Add paragraph_type_test');

alexpott’s picture

Status: Needs review » Needs work

The last submitted patch, 13: 3229472-13.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Status: Needs review » Needs work

The last submitted patch, 15: 3229472-15.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

  • Berdir committed 0cbc562 on 8.x-1.x authored by sleitner
    Issue #3229472 by sleitner, alexpott: Fix D9 test fails
    
Berdir’s picture

Status: Needs work » Fixed

Well, that's at least some green :)

Will update the test configuration after this to more recent PHP versions and D9 only.

+++ b/paragraphs.info.yml
@@ -15,3 +15,7 @@ test_dependencies:
   - block_field:block_field
+  - search_api:search_api_db
+  - entity_usage:entity_usage
+  - ctools:ctools
+  - entity_browser:entity_browser

I don't bother updating test dependencies, it doesn't work in patches and merge requests anyway. Committed without that part.

Status: Fixed » Closed (fixed)

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