3 namespace Drupal\Tests\node\FunctionalJavascript;
5 use Drupal\FunctionalJavascriptTests\WebDriverTestBase;
8 * Tests the JavaScript updating of summaries on content type form.
12 class TestSettingSummariesContentType extends WebDriverTestBase {
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->find('css', 'a[href="#edit-workflow"]')->click();
37 $this->assertSession()->waitForElementVisible('css', '[name="options[status]"]');
38 $page->findField('options[status]')->uncheck();
39 $page->findField('options[sticky]')->check();
40 $page->findField('options[promote]')->check();
41 $page->findField('options[revision]')->check();
42 $locator = '[href="#edit-workflow"] .vertical-tabs__menu-item-summary';
43 $page->waitFor(10, function () use ($page, $locator) {
44 $summary = $page->find('css', $locator)->getText();
45 return strpos('Not published', $summary) !== FALSE;
47 $summary = $page->find('css', $locator)->getText();
48 $this->assertEquals('Not published, Promoted to front page, Sticky at top of lists, Create new revision', $summary);