Last active
September 5, 2016 16:42
-
-
Save djom202/83dbfa97dfd43a5fd03bd0e0c5cb596f to your computer and use it in GitHub Desktop.
A object with a promise of protractor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //*************** | |
| // Protractor is global var | |
| //*************** | |
| var User = function(){ | |
| this.isLogged = function(){ | |
| var _defered = protractor.promise.defer(); | |
| this.httpRequest(); // Call the http request function | |
| return _defered.promise; | |
| }; | |
| this.httpRequest = fucntion(){ | |
| // HTTP Petition | |
| // When finished of run the thread and respond the request | |
| _defered.fulfill(_data); // returned the value of the promise | |
| }; | |
| }; | |
| module.exports = new User(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment