$caption_on_button->
click();
$caption =
$assert_session->
waitForElementVisible('css', 'figure.table > figcaption'
);
$this->
assertEquals($this->captionText,
$caption->
getText());
$this->
assertTableStructureInRenderedPage();
} /**
* Confirms the structure of the table within the editor data.
*/
public function assertTableStructureInEditorData(): void
{ $xpath =
new \
DOMXPath($this->
getEditorDataAsDom());
$this->
assertEmpty($xpath->
query('//figure'
), 'There should be no figure tag in editor data'
);
$this->
assertNotEmpty($xpath->
query('//table/caption'
), 'A caption should be the immediate child of <table>'
);
$this->
assertEquals($this->captionText,
(string) $xpath->
query('//table/caption'
)[0
]->nodeValue, "The caption should say {
$this->captionText
}"
);
$this->
assertNotEmpty($xpath->
query('//table/tbody/tr/td'
), 'There is an expected table structure.'
);
$this->
assertEquals($this->tableCellText,
(string) $xpath->
query('//table/tbody/tr/td'
)[0
]->nodeValue, "The table cell should say {
$this->tableCellText
}"
);
} /**
* Confirms the saved page has the expected table structure.
*/
public function assertTableStructureInRenderedPage(): void
{