|
| 1 | +// A reference configuration file. |
| 2 | +exports.config = { |
| 3 | + // ----- How to setup Selenium ----- |
| 4 | + // |
| 5 | + // There are three ways to specify how to use Selenium. Specify one of the |
| 6 | + // following: |
| 7 | + // |
| 8 | + // 1. seleniumServerJar - to start Selenium Standalone locally. |
| 9 | + // 2. seleniumAddress - to connect to a Selenium server which is already |
| 10 | + // running. |
| 11 | + // 3. sauceUser/sauceKey - to use remote Selenium servers via SauceLabs. |
| 12 | + // |
| 13 | + // If the chromeOnly option is specified, no Selenium server will be started, |
| 14 | + // and chromeDriver will be used directly (from the location specified in |
| 15 | + // chromeDriver) |
| 16 | + |
| 17 | + // The location of the selenium standalone server .jar file, relative |
| 18 | + // to the location of this config. If no other method of starting selenium |
| 19 | + // is found, this will default to |
| 20 | + // node_modules/protractor/selenium/selenium-server... |
| 21 | + seleniumServerJar: null, |
| 22 | + // The port to start the selenium server on, or null if the server should |
| 23 | + // find its own unused port. |
| 24 | + seleniumPort: null, |
| 25 | + // Chromedriver location is used to help the selenium standalone server |
| 26 | + // find chromedriver. This will be passed to the selenium jar as |
| 27 | + // the system property webdriver.chrome.driver. If null, selenium will |
| 28 | + // attempt to find chromedriver using PATH. |
| 29 | + chromeDriver: './node_modules/protractor/selenium/chromedriver', |
| 30 | + // If true, only chromedriver will be started, not a standalone selenium. |
| 31 | + // Tests for browsers other than chrome will not run. |
| 32 | + chromeOnly: false, |
| 33 | + // Additional command line options to pass to selenium. For example, |
| 34 | + // if you need to change the browser timeout, use |
| 35 | + // seleniumArgs: ['-browserTimeout=60'], |
| 36 | + seleniumArgs: [], |
| 37 | + |
| 38 | + // If sauceUser and sauceKey are specified, seleniumServerJar will be ignored. |
| 39 | + // The tests will be run remotely using SauceLabs. |
| 40 | + sauceUser: null, |
| 41 | + sauceKey: null, |
| 42 | + |
| 43 | + // The address of a running selenium server. If specified, Protractor will |
| 44 | + // connect to an already running instance of selenium. This usually looks like |
| 45 | + // seleniumAddress: 'http://localhost:4444/wd/hub' |
| 46 | + seleniumAddress: null, |
| 47 | + |
| 48 | + // The timeout for each script run on the browser. This should be longer |
| 49 | + // than the maximum time your application needs to stabilize between tasks. |
| 50 | + allScriptsTimeout: 11000, |
| 51 | + |
| 52 | + // ----- What tests to run ----- |
| 53 | + // |
| 54 | + // Spec patterns are relative to the location of this config. |
| 55 | + specs: [ |
| 56 | + 'acceptance/*.js', |
| 57 | + ], |
| 58 | + |
| 59 | + // Patterns to exclude. |
| 60 | + exclude: [], |
| 61 | + |
| 62 | + // ----- Capabilities to be passed to the webdriver instance ---- |
| 63 | + // |
| 64 | + // For a full list of available capabilities, see |
| 65 | + // https://code.google.com/p/selenium/wiki/DesiredCapabilities |
| 66 | + // and |
| 67 | + // https://code.google.com/p/selenium/source/browse/javascript/webdriver/capabilities.js |
| 68 | + capabilities: { |
| 69 | + 'browserName': 'chrome' |
| 70 | + }, |
| 71 | + |
| 72 | + // If you would like to run more than one instance of webdriver on the same |
| 73 | + // tests, use multiCapabilities, which takes an array of capabilities. |
| 74 | + // If this is specified, capabilities will be ignored. |
| 75 | + multiCapabilities: [], |
| 76 | + |
| 77 | + // ----- More information for your tests ---- |
| 78 | + // |
| 79 | + // A base URL for your application under test. Calls to protractor.get() |
| 80 | + // with relative paths will be prepended with this. |
| 81 | + baseUrl: 'http://localhost:3020/', |
| 82 | + |
| 83 | + // Selector for the element housing the angular app - this defaults to |
| 84 | + // body, but is necessary if ng-app is on a descendant of <body> |
| 85 | + rootElement: 'body', |
| 86 | + |
| 87 | + // A callback function called once protractor is ready and available, and |
| 88 | + // before the specs are executed |
| 89 | + // You can specify a file containing code to run by setting onPrepare to |
| 90 | + // the filename string. |
| 91 | + onPrepare: function() { |
| 92 | + // At this point, global 'protractor' object will be set up, and jasmine |
| 93 | + // will be available. For example, you can add a Jasmine reporter with: |
| 94 | + // jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter( |
| 95 | + // 'outputdir/', true, true)); |
| 96 | + }, |
| 97 | + |
| 98 | + // The params object will be passed directly to the protractor instance, |
| 99 | + // and can be accessed from your test. It is an arbitrary object and can |
| 100 | + // contain anything you may need in your test. |
| 101 | + // This can be changed via the command line as: |
| 102 | + // --params.login.user 'Joe' |
| 103 | + params: { |
| 104 | + login: { |
| 105 | + user: 'Jane', |
| 106 | + password: '1234' |
| 107 | + } |
| 108 | + }, |
| 109 | + |
| 110 | + // ----- The test framework ----- |
| 111 | + // |
| 112 | + // Jasmine and Cucumber are fully supported as a test and assertion framework. |
| 113 | + // Mocha has limited beta support. You will need to include your own |
| 114 | + // assertion framework if working with mocha. |
| 115 | + framework: 'jasmine', |
| 116 | + |
| 117 | + // ----- Options to be passed to minijasminenode ----- |
| 118 | + // |
| 119 | + // See the full list at https://github.com/juliemr/minijasminenode |
| 120 | + jasmineNodeOpts: { |
| 121 | + // onComplete will be called just before the driver quits. |
| 122 | + onComplete: null, |
| 123 | + // If true, display spec names. |
| 124 | + isVerbose: false, |
| 125 | + // If true, print colors to the terminal. |
| 126 | + showColors: true, |
| 127 | + // If true, include stack traces in failures. |
| 128 | + includeStackTrace: true, |
| 129 | + // Default time to wait in ms before a test fails. |
| 130 | + defaultTimeoutInterval: 30000 |
| 131 | + }, |
| 132 | + |
| 133 | + // ----- Options to be passed to mocha ----- |
| 134 | + // |
| 135 | + // See the full list at http://visionmedia.github.io/mocha/ |
| 136 | + mochaOpts: { |
| 137 | + ui: 'bdd', |
| 138 | + reporter: 'list' |
| 139 | + }, |
| 140 | + |
| 141 | + // ----- Options to be passed to cucumber ----- |
| 142 | + cucumberOpts: { |
| 143 | + // Require files before executing the features. |
| 144 | + require: 'cucumber/stepDefinitions.js', |
| 145 | + // Only execute the features or scenarios with tags matching @dev. |
| 146 | + // This may be an array of strings to specify multiple tags to include. |
| 147 | + tags: '@dev', |
| 148 | + // How to format features (default: progress) |
| 149 | + format: 'summary' |
| 150 | + }, |
| 151 | + |
| 152 | + // ----- The cleanup step ----- |
| 153 | + // |
| 154 | + // A callback function called once the tests have finished running and |
| 155 | + // the webdriver instance has been shut down. It is passed the exit code |
| 156 | + // (0 if the tests passed or 1 if not). |
| 157 | + onCleanUp: function() {} |
| 158 | +}; |
0 commit comments