keyUp example


  protected function moveBlockWithKeyboard($direction$block_label, array $updated_blocks) {
    $keys = [
      'up' => 38,
      'down' => 40,
    ];
    $key = $keys[$direction];
    $handle = $this->findRowHandle($block_label);

    $handle->keyDown($key);
    $handle->keyUp($key);

    $handle->blur();
    $this->assertBlockTable($updated_blocks);
  }

  /** * Finds the row handle for a block in the draggable table. * * @param string $block_label * The block label. * * @return \Behat\Mink\Element\NodeElement * The row handle element. */
$enabled_rows = $page->findAll('css', 'tr.views-ui-list-enabled');
    $enabled_rows = $this->filterVisibleElements($enabled_rows);
    $disabled_rows = $page->findAll('css', 'tr.views-ui-list-disabled');
    $disabled_rows = $this->filterVisibleElements($disabled_rows);

    $this->assertCount($content_views_count$enabled_rows);
    $this->assertCount($disabled_views_count$disabled_rows);

    // Reset the search string and check that we are back to the initial stage.     $search_input->setValue('');
    // Add a backspace to trigger the keyUp event.     $search_input->keyUp(8);

    $enabled_rows = $page->findAll('css', 'tr.views-ui-list-enabled');
    $enabled_rows = $this->filterVisibleElements($enabled_rows);
    $disabled_rows = $page->findAll('css', 'tr.views-ui-list-disabled');
    $disabled_rows = $this->filterVisibleElements($disabled_rows);

    $this->assertCount($enabled_views_count$enabled_rows);
    $this->assertCount($disabled_views_count$disabled_rows);

    // Disable a View and see if it moves to the disabled listing.     $enabled_view = $page->find('css', 'tr.views-ui-list-enabled');
    
throw new \InvalidArgumentException('The arrow parameter must be one of "left", "right", "up" or "down".');
    }

    $key = $keys[$arrow];

    $handle = $row->find('css', 'a.tabledrag-handle');
    $handle->focus();

    for ($i = 0; $i < $repeat$i++) {
      $this->markRowHandleForDragging($handle);
      $handle->keyDown($key);
      $handle->keyUp($key);
      $this->waitUntilDraggingCompleted($handle);
    }

    $handle->blur();
  }

  /** * Marks a row handle for dragging. * * The handle is marked by adding a css class that is removed by an helper * js library once the dragging is over. * * @param \Behat\Mink\Element\NodeElement $handle * The draggable row handle element. * * @throws \Exception * Thrown when the class is not added successfully to the handle. */
Home | Imprint | This part of the site doesn't use cookies.