list_inputs method

Future<Online> list_inputs()

List inputs List all input elements and their attributes for the current page

Implementation

Future<Online> list_inputs() async {
  Show.action(
      'listing', 'input elements', 'in', (await page).url.clean_url());
  await (await page).waitForSelector('input');
  //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')).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: "inputs");
  return this;
}