list_radio_buttons method

Future<Online> list_radio_buttons()

List radio buttons

Implementation

Future<Online> list_radio_buttons() async {
  Show.action(
      'listing', 'radio button elements', 'in', (await page).url.clean_url());
  await (await page).waitForSelector('input[type="radio"]');
  //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="radio"]')).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: "radio buttons");
  return this;
}