3 namespace Drupal\Tests\node\FunctionalJavascript;
5 use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
8 * Tests the JavaScript updating of summaries on content type form.
12 class TestSettingSummariesContentType extends JavascriptTestBase {
17 public static $modules = ['node'];
22 public function setUp() {
25 $admin_user = $this->drupalCreateUser(['administer content types']);
26 $this->drupalLogin($admin_user);
27 $this->drupalCreateContentType(['type' => 'test']);
31 * Test a vertical tab 'Workflow' summary.
33 public function testWorkflowSummary() {
34 $this->drupalGet('admin/structure/types/manage/test');
35 $page = $this->getSession()->getPage();
36 $page->findField('options[status]')->uncheck();
37 $page->findField('options[sticky]')->check();
38 $page->findField('options[promote]')->check();
39 $page->findField('options[revision]')->check();
40 $locator = '[href="#edit-workflow"] .vertical-tabs__menu-item-summary';
41 $page->waitFor(10, function () use ($page, $locator) {
42 $summary = $page->find('css', $locator)->getText();
43 return strpos('Not published', $summary) !== FALSE;
45 $summary = $page->find('css', $locator)->getText();
46 $this->assertEquals('Not published, Promoted to front page, Sticky at top of lists, Create new revision', $summary);