Skip to content

spiegelm/xd-testing

Repository files navigation

XD-Testing

A testing library for cross-device (XD) web applications. Based on WebdriverIO and uses the Selenium browser automation stack. This project was developed at ETH Zurich by Michael Spiegel and supervised by Maria Husmann and Alfonso Murolo. An associated paper with the title UI Testing Cross-Device Applications was presented at the 11th ACM International Conference on Interactive Surfaces and Spaces (ISS 2016) and can be found in the ACM digital library.

Here is an example test case using Mocha:

var xdTesting = require('xd-testing')

// Use a Nexus 5 and a Desktop Chrome browser
var scenario = {
    "Nexus 5": xdTesting.templates.devices.nexus5,
    "Desktop": xdTesting.templates.devices.chrome
}
it('should show the selected image on any device', () => {
    return xdTesting.multiremote(scenario).init()
        .name('should show the selected image on any device')
        .app().pairDevicesViaURL(baseUrl)
        .checkpoint('pair devices')
        // Dynamically select any matching device to execute each command
        .any(device => device
            .click('.controller img:nth-of-type(2)')
            .waitForVisible('.viewer img[src="img/02.jpg"]', 10000)
        )
        .checkpoint('select image')
        .end()
})

Screenshot

Installation

Install xd-testing via npm:

npm install --save xd-testing

Additionally, the selenium-standalone package and Mocha are recommended:

npm install --save selenium-standalone mocha

You can also use any Selenium server package and test runner.

About

A testing library for cross-device (XD) web applications

Resources

License

Stars

Watchers

Forks

Packages

No packages published