
| Current Path : /var/www/html/store/web/core/modules/config/tests/src/FunctionalJavascript/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/store/web/core/modules/config/tests/src/FunctionalJavascript/ConfigExportTest.php |
<?php
namespace Drupal\Tests\config\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
/**
* Tests the config export form.
*
* @group config
*/
class ConfigExportTest extends WebDriverTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = ['config', 'system'];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* Tests Ajax form functionality on the config export page.
*/
public function testAjaxOnExportPage() {
$this->drupalLogin($this->drupalCreateUser([
'export configuration',
]));
$page = $this->getSession()->getPage();
// Check that the export is empty on load.
$this->drupalGet('admin/config/development/configuration/single/export');
$this->assertSession()->fieldValueEquals('export', '');
// Check that the export is filled when selecting a config name.
$page->selectFieldOption('config_name', 'system.site');
$this->assertSession()->assertWaitOnAjaxRequest();
$this->assertSession()->fieldValueNotEquals('export', '');
// Check that the export is emptied again when selecting a config type.
$page->selectFieldOption('config_type', 'Action');
$this->assertSession()->assertWaitOnAjaxRequest();
$this->assertSession()->fieldValueEquals('export', '');
}
}