Commit 7bf7cebe authored by catch's avatar catch

Issue #2864610 by Manuel Garcia, andypost, Lendude: Convert ExposedFormUITest...

Issue #2864610 by Manuel Garcia, andypost, Lendude: Convert ExposedFormUITest in views_ui module to BrowserTestBase
parent fbb8a06f
<?php
namespace Drupal\views_ui\Tests;
namespace Drupal\Tests\views_ui\Functional;
use Drupal\views\Entity\View;
......@@ -32,8 +32,8 @@ class ExposedFormUITest extends UITestBase {
*/
protected $groupFormUiErrors = [];
protected function setUp() {
parent::setUp();
protected function setUp($import_test_views = TRUE) {
parent::setUp($import_test_views);
$this->drupalCreateContentType(['type' => 'article']);
$this->drupalCreateContentType(['type' => 'page']);
......@@ -61,8 +61,8 @@ public function testExposedAdminUi() {
// The first time the filter UI is displayed, the operator and the
// value forms should be shown.
$this->assertFieldById('edit-options-operator-in', '', 'Operator In exists');
$this->assertFieldById('edit-options-operator-not-in', '', 'Operator Not In exists');
$this->assertFieldById('edit-options-operator-in', 'in', 'Operator In exists');
$this->assertFieldById('edit-options-operator-not-in', 'not in', 'Operator Not In exists');
$this->assertFieldById('edit-options-value-page', '', 'Checkbox for Page exists');
$this->assertFieldById('edit-options-value-article', '', 'Checkbox for Article exists');
......@@ -72,8 +72,8 @@ public function testExposedAdminUi() {
$this->helperButtonHasLabel('edit-options-expose-button-button', t('Hide filter'));
// After exposing the filter, Operator and Value should be still here.
$this->assertFieldById('edit-options-operator-in', '', 'Operator In exists');
$this->assertFieldById('edit-options-operator-not-in', '', 'Operator Not In exists');
$this->assertFieldById('edit-options-operator-in', 'in', 'Operator In exists');
$this->assertFieldById('edit-options-operator-not-in', 'not in', 'Operator Not In exists');
$this->assertFieldById('edit-options-value-page', '', 'Checkbox for Page exists');
$this->assertFieldById('edit-options-value-article', '', 'Checkbox for Article exists');
......@@ -98,8 +98,8 @@ public function testExposedAdminUi() {
$this->drupalPostForm(NULL, [], t('Hide filter'));
// After Un-exposing the filter, Operator and Value should be shown again.
$this->assertFieldById('edit-options-operator-in', '', 'Operator In exists after hide filter');
$this->assertFieldById('edit-options-operator-not-in', '', 'Operator Not In exists after hide filter');
$this->assertFieldById('edit-options-operator-in', 'in', 'Operator In exists after hide filter');
$this->assertFieldById('edit-options-operator-not-in', 'not in', 'Operator Not In exists after hide filter');
$this->assertFieldById('edit-options-value-page', '', 'Checkbox for Page exists after hide filter');
$this->assertFieldById('edit-options-value-article', '', 'Checkbox for Article exists after hide filter');
......@@ -108,7 +108,7 @@ public function testExposedAdminUi() {
$this->drupalPostForm('admin/structure/views/nojs/handler/test_exposed_admin_ui/default/sort/created', $edit, t('Expose sort'));
// Check the label of the expose button.
$this->helperButtonHasLabel('edit-options-expose-button-button', t('Hide sort'));
$this->assertFieldById('edit-options-expose-label', '', 'Make sure a label field is shown');
$this->assertFieldById('edit-options-expose-label', 'Authored on', 'Make sure a label field is shown');
// Test adding a new exposed sort criteria.
$view_id = $this->randomView()['id'];
......@@ -150,8 +150,8 @@ public function testGroupedFilterAdminUi() {
// After click on 'Grouped Filters', the standard operator and value should
// not be displayed.
$this->assertNoFieldById('edit-options-operator-in', '', 'Operator In not exists');
$this->assertNoFieldById('edit-options-operator-not-in', '', 'Operator Not In not exists');
$this->assertNoFieldById('edit-options-operator-in', 'in', 'Operator In not exists');
$this->assertNoFieldById('edit-options-operator-not-in', 'not in', 'Operator Not In not exists');
$this->assertNoFieldById('edit-options-value-page', '', 'Checkbox for Page not exists');
$this->assertNoFieldById('edit-options-value-article', '', 'Checkbox for Article not exists');
......
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