Commit 4d45aabb authored by Gábor Hojtsy's avatar Gábor Hojtsy

Issue #2870440 by naveenvalecha, andypost, snetcher, michielnugter, dawehner:...

Issue #2870440 by naveenvalecha, andypost, snetcher, michielnugter, dawehner: Convert web tests to browser tests for config_translation module
parent 9548294b
<?php
namespace Drupal\config_translation\Tests;
namespace Drupal\Tests\config_translation\Functional;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\simpletest\WebTestBase;
use Drupal\Tests\BrowserTestBase;
/**
* Tests for altering configuration translation forms.
*
* @group config_translation
*/
class ConfigTranslationFormTest extends WebTestBase {
class ConfigTranslationFormTest extends BrowserTestBase {
/**
* Modules to enable.
......
<?php
namespace Drupal\config_translation\Tests;
namespace Drupal\Tests\config_translation\Functional;
use Drupal\Component\Utility\Html;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\simpletest\WebTestBase;
use Drupal\Tests\BrowserTestBase;
/**
* Translate settings and entities to various languages.
*
* @group config_translation
*/
class ConfigTranslationOverviewTest extends WebTestBase {
class ConfigTranslationOverviewTest extends BrowserTestBase {
/**
* Modules to enable.
......@@ -77,10 +77,8 @@ public function testMapperListPage() {
// Make sure there is only a single operation for each dropbutton, either
// 'List' or 'Translate'.
foreach ($this->cssSelect('ul.dropbutton') as $i => $dropbutton) {
$this->assertIdentical(1, $dropbutton->count());
foreach ($dropbutton->li as $link) {
$this->assertTrue(((string) $link->a === 'Translate') || ((string) $link->a === 'List'));
}
$this->assertIdentical(1, count($dropbutton->find('xpath', 'li')));
$this->assertTrue(($dropbutton->getText() === 'Translate') || ($dropbutton->getText() === 'List'));
}
$labels = [
......@@ -104,10 +102,8 @@ public function testMapperListPage() {
// Make sure there is only a single 'Translate' operation for each
// dropbutton.
foreach ($this->cssSelect('ul.dropbutton') as $i => $dropbutton) {
$this->assertIdentical(1, $dropbutton->count());
foreach ($dropbutton->li as $link) {
$this->assertIdentical('Translate', (string) $link->a);
}
$this->assertIdentical(1, count($dropbutton->find('xpath', 'li')));
$this->assertIdentical('Translate', $dropbutton->getText());
}
$entity_type = \Drupal::entityManager()->getDefinition($test_entity->getEntityTypeId());
......
<?php
namespace Drupal\config_translation\Tests;
namespace Drupal\Tests\config_translation\Functional;
use Drupal\language\Entity\ConfigurableLanguage;
use Drupal\simpletest\WebTestBase;
use Drupal\Tests\BrowserTestBase;
/**
* Verifies theme configuration translation settings.
*
* @group config_translation
*/
class ConfigTranslationUiThemeTest extends WebTestBase {
class ConfigTranslationUiThemeTest extends BrowserTestBase {
/**
* Modules to enable.
......@@ -65,7 +65,7 @@ public function testThemeDiscovery() {
':label' => 'Install and set as default',
':theme' => $theme,
]);
$this->drupalGet($GLOBALS['base_root'] . $elements[0]['href'], ['external' => TRUE]);
$this->drupalGet($GLOBALS['base_root'] . $elements[0]->getAttribute('href'), ['external' => TRUE]);
$translation_base_url = 'admin/config/development/performance/translate';
$this->drupalGet($translation_base_url);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment