Issue #3088234 by tim.plunkett: Use $defaultTheme for using views_test_classy_subtheme

(cherry picked from commit 3388371b4c)
merge-requests/2523/head
Alex Pott 2022-07-17 09:56:02 +01:00
parent 9b6af36fa1
commit a9edcb0db4
No known key found for this signature in database
GPG Key ID: BDA67E7EE836E5CE
2 changed files with 62 additions and 25 deletions

View File

@ -0,0 +1,62 @@
<?php
namespace Drupal\Tests\views_ui\FunctionalJavascript;
use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
/**
* Tests the admin UI AJAX interactions.
*
* @group views_ui
*/
class AdminAjaxTest extends WebDriverTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'views_ui',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'views_test_classy_subtheme';
/**
* {@inheritdoc}
*/
protected function setUp(): void {
parent::setUp();
$this->drupalLogin($this->createUser([
'administer views',
]));
}
/**
* Confirms that form_alter is triggered after AJAX rebuilds.
*/
public function testAjaxRebuild() {
\Drupal::service('theme_installer')->install(['views_test_classy_subtheme']);
$this->config('system.theme')
->set('default', 'views_test_classy_subtheme')
->save();
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
$this->drupalGet('admin/structure/views/view/user_admin_people');
$assert_session->pageTextContains('This is text added to the display tabs at the top');
$assert_session->pageTextContains('This is text added to the display edit form');
$page->clickLink('User: Name (Username)');
$assert_session->waitForElementVisible('css', '.views-ui-dialog');
$page->fillField('Label', 'New Title');
$page->find('css', '.ui-dialog-buttonset button:contains("Apply")')->press();
$assert_session->waitForElementRemoved('css', '.views-ui-dialog');
$assert_session->pageTextContains('This is text added to the display tabs at the top');
$assert_session->pageTextContains('This is text added to the display edit form');
}
}

View File

@ -155,31 +155,6 @@ class DisplayTest extends WebDriverTestBase {
$this->getSession()->executeScript("jQuery('{$selector} .contextual .trigger').toggleClass('visually-hidden');");
}
/**
* Confirms that form_alter is triggered after ajax rebuilds.
*/
public function testAjaxRebuild() {
\Drupal::service('theme_installer')->install(['views_test_classy_subtheme']);
$this->config('system.theme')
->set('default', 'views_test_classy_subtheme')
->save();
$page = $this->getSession()->getPage();
$assert_session = $this->assertSession();
$this->drupalGet('admin/structure/views/view/content');
$assert_session->pageTextContains('This is text added to the display tabs at the top');
$assert_session->pageTextContains('This is text added to the display edit form');
$page->clickLink('Content: Title (Title)');
$assert_session->waitForElementVisible('css', '.views-ui-dialog');
$page->fillField('Label', 'New Title');
$page->find('css', '.ui-dialog-buttonset button:contains("Apply")')->press();
$assert_session->waitForElementRemoved('css', '.views-ui-dialog');
$assert_session->pageTextContains('This is text added to the display tabs at the top');
$assert_session->pageTextContains('This is text added to the display edit form');
}
/**
* Test if 'add' translations are filtered from multilingual display options.
*/