click method

Future<Online> click(
  1. AbstractSelector selector, {
  2. bool show = true,
  3. int index = 0,
})

Implementation

Future<Online> click(AbstractSelector selector,
    {bool show = true, int index = 0}) async {
  if (show) Show.clicking(selector.selector);
  var selected = selector is XPath
      ? await (await page).waitForXPath(selector.selector, visible: true)
      : await (await page).waitForSelector(selector.selector, visible: true);
  if (selected != null) {
    //if the element is not visible, scroll to it
    await selected.click(delay: Duration(milliseconds: 100));

    // await scroll_to(selector);
    // await mouse_enter(selector);
    // await mouse_over(selector);
    // await Future.delayed(Duration(milliseconds: 100));
    // await selected.click();
    // await Future.delayed(Duration(milliseconds: 100));
  }
  return this;
}