https://github.com/gtramontina/screen.object
Page Object Pattern for Appium and Mocha.
https://github.com/gtramontina/screen.object
Last synced: 3 months ago
JSON representation
Page Object Pattern for Appium and Mocha.
- Host: GitHub
- URL: https://github.com/gtramontina/screen.object
- Owner: gtramontina
- Created: 2013-07-10T21:12:38.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2014-01-16T01:19:26.000Z (over 11 years ago)
- Last Synced: 2025-03-03T00:54:09.950Z (3 months ago)
- Language: JavaScript
- Size: 130 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
screen.object
=============[](https://gemnasium.com/gtramontina/screen.object)
[](http://badge.fury.io/js/screen.object)[Page Object Pattern](https://code.google.com/p/selenium/wiki/PageObjects) for [Appium](https://github.com/appium/appium) and [Mocha](https://github.com/visionmedia/mocha).
## Configuration
___It can be a bit complicated to explain, so please take a look at the example (todo) to have a better idea of how to set everything up.___
- Add a file called `drivers.settings.js` to your project root and configure it based on this example:
```javascript
module.exports = {
screensDir : 'test/screen', // DEFAULT
remote : ['localhost', 4723 ], // DEFAULT// REQUIRED!
capabilities : {
ios : {
device : 'iPhone Simulator',
app : require('path').resolve(__dirname, 'build', 'my.app')
}
}
};
```- Create a directory to hold your screen objects under `test/screen`.
- Require `screen.object` in your mocha options. If you are using `mocha.opts` you can just add `--require screen.object` to it.
- Write your Mocha `describe`s as the following example and you'll have the screens required from your screen directory.```javascript
describe('Home', withScreen('HomeScreen', function(screen) {
...
}));
```### Running the Appium server automatically
If you want `screen.object` to run the Appium server automatically, you can `--require screen.object/appium` in your mocha options. And just like `mocha.opts` you can specify a `appium.opts` under your `test` directory with the options you want your server to start with.
## License
This is licensed under the feel-free-to-do-whatever-you-want-to-do license.