// Set a taller window size to ensure all possible style choices are in view
// because otherwise Mink's getText() will return the empty string for those
// out of view, despite the HTML showing that text.
$this->
getSession()->
resizeWindow(1024, 1000
);
$this->
drupalGet($node->
toUrl('edit-form'
));
$this->
waitForEditor();
// Select the <h2>, assert that no style is active currently.
$this->
selectTextInsideElement('h2'
);
$assert_session =
$this->
assertSession();
$style_dropdown =
$assert_session->
elementExists('css', '.ck-style-dropdown'
);
$this->
assertSame('Styles',
$style_dropdown->
getText());
// Click the dropdown, check the available styles.
$style_dropdown->
click();
$buttons =
$style_dropdown->
findAll('css', '.ck-dropdown__panel button'
);
$this->
assertCount(9,
$buttons);
$this->
assertSame('Highlighted & interesting',
$buttons[0
]->
find('css', '.ck-button__label'
)->
getText());
$this->
assertSame('Red heading',
$buttons[1
]->
find('css', '.ck-button__label'
)->
getText());