explorer.js 751 B

123456789101112131415161718192021222324
  1. var q = require('q');
  2. /**
  3. * A framework which does not actually run any tests. It allows users to drop
  4. * into a repl loop to experiment with protractor commands.
  5. *
  6. * @param {Runner} runner The current Protractor Runner.
  7. * @return {q.Promise} Promise resolved with the test results
  8. */
  9. exports.run = function(runner) {
  10. /* globals browser */
  11. return q.promise(function(resolve) {
  12. if (runner.getConfig().baseUrl) {
  13. browser.get(runner.getConfig().baseUrl);
  14. }
  15. browser.executeScriptWithDescription('var e = 0', 'starting explorer hook');
  16. browser.enterRepl();
  17. browser.executeScriptWithDescription('var e = 1', 'done with explorer hook').then(function() {
  18. resolve({
  19. failedCount: 0
  20. });
  21. });
  22. });
  23. };