3 namespace Drupal\Tests\views_ui\Functional;
6 * Tests the views analyze system.
10 class AnalyzeTest extends UITestBase {
17 public static $modules = ['views_ui'];
20 * Views used by this test.
24 public static $testViews = ['test_view'];
27 * Tests that analyze works in general.
29 public function testAnalyzeBasic() {
30 $this->drupalLogin($this->adminUser);
32 $this->drupalGet('admin/structure/views/view/test_view/edit');
33 $this->assertLink(t('Analyze view'));
35 // This redirects the user to the analyze form.
36 $this->clickLink(t('Analyze view'));
37 $this->assertSession()->titleEquals('View analysis | Drupal');
39 foreach (['ok', 'warning', 'error'] as $type) {
40 $xpath = $this->xpath('//div[contains(@class, :class)]', [':class' => $type]);
41 $this->assertTrue(count($xpath), format_string('Analyse messages with @type found', ['@type' => $type]));
44 // This redirects the user back to the main views edit page.
45 $this->drupalPostForm(NULL, [], t('Ok'));