Creazione organizza
[YouAndWeb_TwoToc] / protractor.conf.js
1 // Protractor configuration
2 // https://github.com/angular/protractor/blob/master/referenceConf.js
3
4 'use strict';
5
6 var config = {
7   // The timeout for each script run on the browser. This should be longer
8   // than the maximum time your application needs to stabilize between tasks.
9   allScriptsTimeout: 110000,
10
11   // A base URL for your application under test. Calls to protractor.get()
12   // with relative paths will be prepended with this.
13   baseUrl: 'http://localhost:' + (process.env.PORT || '9000'),
14
15   // Credientials for Saucelabs
16   sauceUser: process.env.SAUCE_USERNAME,
17
18   sauceKey: process.env.SAUCE_ACCESS_KEY,
19
20   // list of files / patterns to load in the browser
21   specs: [
22     'e2e/**/*.spec.js'
23   ],
24
25   // Patterns to exclude.
26   exclude: [],
27
28   // ----- Capabilities to be passed to the webdriver instance ----
29   //
30   // For a full list of available capabilities, see
31   // https://code.google.com/p/selenium/wiki/DesiredCapabilities
32   // and
33   // https://code.google.com/p/selenium/source/browse/javascript/webdriver/capabilities.js
34   capabilities: {
35     'browserName': 'chrome',
36     'name': 'Fullstack E2E',
37     'tunnel-identifier': process.env.TRAVIS_JOB_NUMBER,
38     'build': process.env.TRAVIS_BUILD_NUMBER
39   },
40
41   // ----- The test framework -----
42   //
43   // Jasmine and Cucumber are fully supported as a test and assertion framework.
44   // Mocha has limited beta support. You will need to include your own
45   // assertion framework if working with mocha.
46   framework: 'jasmine2',
47
48   // ----- Options to be passed to minijasminenode -----
49   //
50   // See the full list at https://github.com/jasmine/jasmine-npm
51   jasmineNodeOpts: {
52     defaultTimeoutInterval: 30000,
53     print: function() {}  // for jasmine-spec-reporter
54   },
55
56   // Prepare environment for tests
57   params: {
58     serverConfig: require('./server/config/environment')
59   },
60
61   onPrepare: function() {
62     var SpecReporter = require('jasmine-spec-reporter');
63     // add jasmine spec reporter
64     jasmine.getEnv().addReporter(new SpecReporter({displayStacktrace: true}));
65
66     var serverConfig = config.params.serverConfig;
67
68     // Setup mongo for tests
69     var mongoose = require('mongoose');
70     mongoose.connect(serverConfig.mongo.uri, serverConfig.mongo.options); // Connect to database
71   }
72 };
73
74 config.params.baseUrl = config.baseUrl;
75 exports.config = config;