mongoose-webdriver
v1.0.0
Published
Make mongoose queries in the selenium-webdriver control flow.
Downloads
3
Readme
Mongoose Webdriver
Make mongoose queries in the selenium-webdriver control flow.
Usage
npm install mongoose-webdriver
var mongoose = require('mongoose');
var wd = require('selenium-webdriver');
var driver = new wd.Builder().build();
// Setup
var bootstrap = require('mongoose-webdriver');
bootstrap(mongoose, driver);
// Let's verify that clicking a button on a webpage increases a counter in the database:
Model.scheduleCreate({slug: 'example-url', counter: 0});
driver.get('http://localhost:8000/example-url');
driver.findElement(webdriver.By.css('button.increment')).click();
MongooseModel.find({slug: 'example-url'}).schedule().then(function(document) {
assert.equal(document.counter, 1);
});
FAQs
- Does it work with Protractor? Yes! Mongoose-webdriver will work with Protractor. It will even wait for Angular to finish all its background http requests before it runs your Mongoose queries.
Contributing
Please follow our Code of Conduct when contributing to this project.
You need to have mongodb running on your machine.
$ git clone https://github.com/goodeggs/mongoose-webdriver && cd mongoose-webdriver
$ npm install
$ npm test