How to use the appium-flutter-finder.ancestor function in appium-flutter-finder

To help you get started, we’ve selected a few appium-flutter-finder examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github truongsinh / appium-flutter-driver / example / nodejs / src / index.js View on Github external
await driver.execute('flutter:scrollUntilVisible', find.byType('ListView'), {item:find.byType('TextField'), dxScroll: 90, dyScroll: -400});
  await driver.execute('flutter:scroll', find.byType('ListView'), {dx: 50, dy: 100, durationMilliseconds: 200, frequency: 30});
  await driver.execute('flutter:scrollIntoView', find.byType('TextField'), {alignment: 0.1});
  await driver.elementSendKeys(find.byType('TextField'), 'I can enter text');
  await driver.execute('flutter:waitFor', find.byText('I can enter text')); // verify text appears on UI

  await driver.elementClick(find.pageBack());
  await driver.execute(
    'flutter:waitFor',
    buttonFinder
  );

  assert.strictEqual(
    await driver.getElementText(
      find.descendant({
        of: find.ancestor({
          of: find.bySemanticsLabel(RegExp('counter_semantic')),
          matching: find.byType('Tooltip')
        }),
        matching: find.byType('Text')
      })
    ),
    '3'
  );

  driver.deleteSession();
})();