list_checkboxes method

Future<Online> list_checkboxes()

List checkboxes

Implementation

Future<Online> list_checkboxes() async {
  Show.action(
      'listing', 'checkbox elements', 'in', (await page).url.clean_url());
  await (await page).waitForSelector('input[type="checkbox"]');
  //return a list of all input elements each as a map of properties
  var elements = await (await page).evaluate('''() => {
    return Array.from(document.querySelectorAll('input[type="checkbox"]')).map((e) => {
     // list all attributes and their values
      return Array.from(e.attributes).reduce((map, attribute) => {
        map[attribute.name] = attribute.value;
        return map;
      }, {});
    });
  }''');
  Show.tree(elements, title: "checkboxes");
  return this;
}