appium_driver 0.5.2 copy "appium_driver: ^0.5.2" to clipboard
appium_driver: ^0.5.2 copied to clipboard

outdated

An Appium binding for Dart. Support WebDriver W3C spec inheriting webdriver.dart.

example/main.dart

import 'package:appium_driver/async_io.dart';
import 'package:test/test.dart';

void main() {
  late AppiumWebDriver driver;

  setUpAll(() async {
    driver = await createDriver(
        uri: Uri.parse('http://127.0.0.1:4723/wd/hub/'),
        desired: {
          'platformName': 'ios',
          'platformVersion': '14.4',
          'deviceName': 'iPhone 8',
          'browserName': 'Safari',
          'automationName': 'xcuitest',
          'reduceMotion': true,
        });
  });

  tearDownAll(() async {
    await driver.quit();
  });

  test('connect to server', () async {
    expect(await driver.title, 'Appium/welcome');
  });

  test('connect to existing session', () async {
    var sessionId = driver.id;

    AppiumWebDriver newDriver = await fromExistingSession(sessionId);
    expect(await newDriver.title, 'Appium/welcome');
    expect(newDriver.id, sessionId);
  });

  test('find by appium element', () async {
    final title = 'Appium/welcome';
    try {
      await driver.findElement(AppiumBy.accessibilityId(title));
      throw 'expected Unsupported locator strategy: accessibility id error';
    } on UnknownException catch (e) {
      expect(
          e.message!.contains('Unsupported locator strategy: accessibility id'),
          true);
    }
  });
}
23
likes
0
pub points
80%
popularity

Publisher

unverified uploader

An Appium binding for Dart. Support WebDriver W3C spec inheriting webdriver.dart.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

webdriver

More

Packages that depend on appium_driver