1
0

protractor_conf.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. // An example configuration file.
  2. exports.config = {
  3. // Do not start a Selenium Standalone sever - only run this using chrome.
  4. chromeOnly: true,
  5. chromeDriver: './node_modules/protractor/selenium/chromedriver',
  6. // Capabilities to be passed to the webdriver instance.
  7. // See https://sites.google.com/a/chromium.org/chromedriver/capabilities
  8. capabilities: {
  9. 'browserName': 'chrome',
  10. 'chromeOptions': {
  11. 'args': ['show-fps-counter=true', '--test-type', '--ignore-certificate-errors']
  12. }
  13. },
  14. // Use on Commmandline:
  15. // protractor ... --params.login.user=abc --params.login.password=123
  16. params: {
  17. baseUrl: "http://127.0.0.1/",
  18. login: {
  19. user: 'admin',
  20. password: 'password'
  21. }
  22. },
  23. suites: {
  24. install: 'tests/install/**/*_spec.js',
  25. login: 'tests/login/**/*_spec.js',
  26. apps: 'tests/apps/**/*_spec.js',
  27. files: 'tests/files/**/*_spec.js',
  28. share: 'tests/share/**/*_spec.js',
  29. },
  30. // seleniumAddress: 'http://0.0.0.0:4444/wd/hub',
  31. // Options to be passed to Jasmine-node.
  32. jasmineNodeOpts: {
  33. silent: true,
  34. showColors: true,
  35. onComplete: null,
  36. isVerbose: true,
  37. includeStackTrace: true,
  38. defaultTimeoutInterval: 180000
  39. },
  40. onPrepare: function(){
  41. global.isAngularSite = function(flag){
  42. browser.ignoreSynchronization = !flag;
  43. };
  44. browser.driver.manage().window().setSize(1000, 800);
  45. browser.driver.manage().window().maximize();
  46. require('jasmine-spec-reporter');
  47. // add jasmine spec reporter
  48. var spec_reporter = new jasmine.SpecReporter({
  49. displayStacktrace: false, // display stacktrace for each failed assertion
  50. displayFailuresSummary: false, // display summary of all failures after execution
  51. displaySuccessfulSpec: true, // display each successful spec
  52. displayFailedSpec: true, // display each failed spec
  53. displaySkippedSpec: false, // display each skipped spec
  54. displaySpecDuration: true, // display each spec duration
  55. colors: {
  56. success: 'green',
  57. failure: 'red',
  58. skipped: 'cyan'
  59. },
  60. prefixes: {
  61. success: '✓ ',
  62. failure: '✗ ',
  63. skipped: '- '
  64. }
  65. });
  66. global.display = spec_reporter.display;
  67. jasmine.getEnv().addReporter(spec_reporter);
  68. }
  69. };
  70. // Headless testing with Phantomjs
  71. // capabilities: {
  72. // 'browserName': 'phantomjs',
  73. //
  74. // /*
  75. // * Can be used to specify the phantomjs binary path.
  76. // * This can generally be ommitted if you installed phantomjs globally.
  77. // */
  78. // 'phantomjs.binary.path':'./node_modules/phantomjs/bin/phantomjs',
  79. //
  80. // /*
  81. // * Command line arugments to pass to phantomjs.
  82. // * Can be ommitted if no arguments need to be passed.
  83. // * Acceptable cli arugments: https://github.com/ariya/phantomjs/wiki/API-Reference#wiki-command-line-options
  84. // */
  85. // 'phantomjs.cli.args':['--logfile=PATH', '--loglevel=DEBUG']
  86. // },
  87. // TODO: Mobile? See: https://github.com/angular/protractor/blob/master/docs/browser-setup.md#setting-up-protractor-with-appium---androidchrome
  88. // multiCapabilities: [{
  89. // 'browserName': 'firefox'
  90. // }, {
  91. // 'browserName': 'chrome'
  92. // }]