Unverified Commit 7470bb91 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3089961 by tim.plunkett, Deepak Goyal, Lal_, ravi.shankar, tedbow:...

Issue #3089961 by tim.plunkett, Deepak Goyal, Lal_, ravi.shankar, tedbow: assertOffCanvasFormAfterWait() doesn't check for the correct form ID

(cherry picked from commit 700a6ab9)
parent a79aaf66
......@@ -463,23 +463,16 @@ private function openAddBlockForm($block_title) {
* @param string $expected_form_id
* The expected form ID.
* @param int $timeout
* (Optional) Timeout in milliseconds, defaults to 10000.
private function assertOffCanvasFormAfterWait($expected_form_id, $timeout = 10000) {
$page = $this->getSession()->getPage();
private function assertOffCanvasFormAfterWait($expected_form_id) {
$this->assertNotEmpty($page->waitFor($timeout / 1000, function () use ($page, $expected_form_id) {
// Ensure the form ID exists, is visible, and has the correct value.
$form_id_element = $page->find('hidden_field_selector', ['hidden_field', 'form_id']);
// Ensure the off canvas dialog is visible.
$off_canvas = $page->find('css', '#drupal-off-canvas');
if (!$off_canvas || !$off_canvas->isVisible()) {
return NULL;
return $form_id_element;
$off_canvas = $this->assertSession()->waitForElementVisible('css', '#drupal-off-canvas');
$form_id_element = $off_canvas->find('hidden_field_selector', ['hidden_field', 'form_id']);
// Ensure the form ID has the correct value and that the form is visible.
$this->assertSame($expected_form_id, $form_id_element->getValue());
Supports Markdown
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