Firebase wrapper for use in Protractor tests
Firebase wrapper for use in Protractor tests.
Copyright (C) 2013, 2014, Uri Shaked email@example.com
Use this module as a drop-in replacement for the Firebase module.
This will add some new methods to your Firebase instances that are useful for interacting with Firebase inside your test code. The methods integrate seamlessly with the Web Driver Control Flow, so you can assume that their operation completes before the next statement in the control flow is executing.
Below is the list of the new methods. They all return a webdriver.promise.Promise that is resolved once the operation has been successfully completed:
$remove()- Wrapper for remove()
$set(value)- Wrapper for set()
$setWithPriority(value, priority)- Wrapper for setWithPriority()
$setPriority(priority)- Wrapper for setPriority()
$update(value)- Wrapper for update()
$push(value)- Wrapper for push(). The promise will be resolved with a Firebase reference for the generated location.
$value(waits)- Reads the data from the current location and returns a promise that will be resolved with the data. If
waitsit true, the promise will only be resolved once non null data has arrived.
$valueChange()- Resolves once the data from current location has changed. The promise will be resolved with the new value.
$waitForValue(predicate)- Calls the
predicatecallback whenever the value changes with the new value as an argument. Resolves once predicate returns true for the given value.
Released under the terms of MIT License:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.