ConfigSelectorTest.php in Thunder 6.2.x
File
tests/src/FunctionalJavascript/Integration/ConfigSelectorTest.php
View source
<?php
namespace Drupal\Tests\thunder\FunctionalJavascript\Integration;
use Drupal\Tests\thunder\FunctionalJavascript\ThunderJavascriptTestBase;
class ConfigSelectorTest extends ThunderJavascriptTestBase {
protected static $modules = [
'thunder_testing_demo',
];
protected static $defaultUserRole = 'administrator';
public function testContentViewSearchApi() {
$assert_session = $this
->assertSession();
$this
->drupalGet('admin/content');
$assert_session
->elementExists('xpath', '//*[@id="view-title-table-column"]/a');
$assert_session
->elementExists('css', '#block-thunder-admin-content > div > div.view-content');
$this
->drupalGet('admin/modules');
$edit = [
'modules[thunder_search][enable]' => TRUE,
];
$this
->submitForm($edit, 'Install');
$this
->submitForm([], 'Continue');
$this
->drupalGet('admin/config/search/search-api/index/content');
$this
->getSession()
->getPage()
->pressButton('Index now');
$assert_session
->waitForId('edit-index-now');
$this
->drupalGet('admin/content');
$assert_session
->elementExists('xpath', '//*[@id="view-title-table-column"]/a');
$assert_session
->elementExists('css', '#block-thunder-admin-content > div > div.view-content-search-api');
$this
->drupalGet('admin/modules/uninstall');
$edit = [
'uninstall[thunder_search]' => TRUE,
];
$this
->submitForm($edit, 'Uninstall');
$this
->submitForm([], 'Uninstall');
$this
->drupalGet('admin/modules/uninstall');
$edit = [
'uninstall[search_api_mark_outdated]' => TRUE,
];
$this
->submitForm($edit, 'Uninstall');
$this
->submitForm([], 'Uninstall');
$this
->drupalGet('admin/content');
$assert_session
->elementExists('xpath', '//*[@id="view-title-table-column"]/a');
$assert_session
->elementExists('css', '#block-thunder-admin-content > div > div.view-content');
}
}