test_webdriver 0.0.1 copy "test_webdriver: ^0.0.1" to clipboard
test_webdriver: ^0.0.1 copied to clipboard

outdatedDart 1 only

A helper library to write selenium tests using pageobjects.

Build Status

test_webdriver provides simple utility functions to setup a test environment with a webdriver and pageloader. It makes it easier to receive pageobjects within the testcases.

Writing Tests #

Tests which require pageobjects and a running webdriver should be within a suite block.

import 'package:test_webdriver/test_webdriver.dart';

void main() {
  group('My Test-Suite', suite(() {
    
    test('handle login', withPO((LoginPO po) async {
      expect(await po.handleLogin('test', 'test'), isTrue);
      expect(await driver.title, contains('Dashboard of'));
    }));
  }));
}

There are wrapper functions which inject objects into their body function using the current suite:

  • withPO injects a pageobject into the body.
  • withDriver injects the WebDriver into the body.

These helpers are available within the body function of the previous named wrappers:

  • driver returns the WebDriver
  • object looks up a PageObject

Running Tests #

The package doesn't ship with a selenium server, therefore the actual selenium server (ex. chromedriver) needs to be started before running the tests. In order to run the suite pass the environment variable DRIVER_URI to the test process.

DRIVER_URI=http://localhost:9515/ pub run test
0
likes
0
pub points
0%
popularity

Publisher

unverified uploader

A helper library to write selenium tests using pageobjects.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

pageloader, test, webdriver, yaml

More

Packages that depend on test_webdriver