See #2735005: Convert all Simpletest web tests to BrowserTestBase (or UnitTestBase/KernelTestBase)

Lists of tests to convert

\Drupal\content_translation\Tests\ContentTestTranslationUITest
\Drupal\content_translation\Tests\ContentTranslationDisableSettingTest (note: This test file needs to be moved to the right location, but its BrowserTestBase already)
\Drupal\content_translation\Tests\ContentTranslationEnableTest
<de>\Drupal\content_translation\Tests\ContentTranslationLanguageChangeTest</del> (this needs some node conversion)
\Drupal\content_translation\Tests\ContentTranslationSettingsTest
\Drupal\content_translation\Tests\ContentTranslationSyncImageTest
\Drupal\content_translation\Tests\ContentTranslationTestBase
\Drupal\content_translation\Tests\ContentTranslationUITestBase

Out of Scope

\Drupal\content_translation\Tests\ContentTranslationContextualLinksTest
\Drupal\content_translation\Tests\ContentTranslationWorkflowsTest

https://www.drupal.org/node/2887813

Members fund testing for the Drupal project. Drupal Association Learn more

Comments

michielnugter created an issue. See original summary.

michielnugter’s picture

Issue summary: View changes
Status: Active » Postponed
michielnugter’s picture

dawehner’s picture

Issue summary: View changes
Status: Postponed » Active

This can be worked on.

michielnugter’s picture

Component: phpunit » content_translation.module
Issue tags: +phpunit initiative
andypost’s picture

\Drupal\Tests\content_translation\Functional\ContentTranslationUITestBase was fixed in #2870451: Convert web tests to browser tests for menu_link_content module

naveenvalecha’s picture

Here's the straight patch which is the straight conversion of WTB to BTB. Let's see how much pass on straight conversion.

//Naveen

naveenvalecha’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 8: 2870441-8.patch, failed testing. View results

naveenvalecha’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
8.76 KB

Here's the patch with more fixes.
These two files are out of scope for follow-up issue as they are relying on the asserting cache and old curl methods.

Status: Needs review » Needs work

The last submitted patch, 11: 2870441-10.patch, failed testing. View results

naveenvalecha’s picture

Status: Needs work » Needs review
FileSize
10.24 KB

Here we go with fixes.
No interdiff as no one has reviewed the patch before :)

//Naveen

dawehner’s picture

@naveenvalecha
This is not ideal. If someone would be interested in knowing what fixed failures, an interdiff would be quite helpful :(

naveenvalecha’s picture

FileSize
2.73 KB

Find the attached interdiff b/w #11 and #13

Don't mind I just thought it's wouldn't be required.

//Naveen

Lendude’s picture

Status: Needs review » Needs work

One little thing:

+++ b/core/modules/content_translation/tests/src/Functional/ContentTranslationUITestBase.php
@@ -227,10 +226,10 @@ protected function doTestTranslationOverview() {
+        $this->assertEqual($elements[0]->getText(), $entity->getTranslation($langcode)->label(), format_string('Label correctly shown for %language translation.', ['%language' => $langcode]));
...
+        $this->assertEqual($elements[0]->getText(), t('Edit'), format_string('Edit link correct for %language translation.', ['%language' => $langcode]));

Any reason we are replacing something that isn't deprecated with something that is?

naveenvalecha’s picture

Status: Needs work » Needs review
FileSize
8.42 KB
1.83 KB

#16,
No Reason. Seems it gets converted somehow which I don't know how :(

//Naveen

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Nice, another minimal conversion!

Gábor Hojtsy’s picture

  • Gábor Hojtsy committed 2904580 on 8.4.x
    Issue #2870441 by naveenvalecha, dawehner, Lendude: Convert web tests to...
Gábor Hojtsy’s picture

Version: 8.4.x-dev » 8.3.x-dev
Status: Reviewed & tested by the community » Fixed

Looks good, thanks!

  • Gábor Hojtsy committed 10db0b8 on 8.3.x
    Issue #2870441 by naveenvalecha, dawehner, Lendude: Convert web tests to...
naveenvalecha’s picture

Issue summary: View changes

Thanks, Gabor!
Here's the follow-up of the out of the scope tests specified in issue summary. https://www.drupal.org/node/2887813
Also updated the plan #2735005: Convert all Simpletest web tests to BrowserTestBase (or UnitTestBase/KernelTestBase)

//Naveen

Status: Fixed » Closed (fixed)

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