Commit 83753e0c authored by Andreas Åkre Solberg's avatar Andreas Åkre Solberg

Rename and clean up

parent 11ba9bae
var browserstack = require('browserstack-local');
exports.config = {
user: process.env.BROWSERSTACK_USERNAME || 'BROWSERSTACK_USERNAME',
key: process.env.BROWSERSTACK_ACCESS_KEY || 'BROWSERSTACK_ACCESS_KEY',
updateJob: false,
specs: [
'./tests/specs/local_test.js'
],
exclude: [],
capabilities: [{
browser: 'chrome',
name: 'local_test',
build: 'webdriver-browserstack',
'browserstack.local': true
}],
logLevel: 'verbose',
coloredLogs: true,
screenshotPath: './errorShots/',
baseUrl: '',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
framework: 'mocha',
mochaOpts: {
ui: 'bdd'
},
// Code to start browserstack local before start of test
onPrepare: function (config, capabilities) {
console.log("Connecting local");
return new Promise(function(resolve, reject){
exports.bs_local = new browserstack.Local();
exports.bs_local.start({'key': exports.config.key }, function(error) {
if (error) return reject(error);
console.log('Connected. Now testing...');
resolve();
});
});
},
// Code to stop browserstack local after end of test
onComplete: function (capabilties, specs) {
exports.bs_local.stop(function() {});
}
}
exports.config = {
user: process.env.BROWSERSTACK_USERNAME || 'BROWSERSTACK_USERNAME',
key: process.env.BROWSERSTACK_ACCESS_KEY || 'BROWSERSTACK_ACCESS_KEY',
updateJob: false,
specs: [
'./tests/specs/multiple_test.js'
],
exclude: [],
capabilities: [{
browser: 'chrome',
name: 'multiple_test',
build: 'webdriver-browserstack'
}],
logLevel: 'verbose',
coloredLogs: true,
screenshotPath: './errorShots/',
baseUrl: '',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
framework: 'mocha',
mochaOpts: {
ui: 'bdd'
}
}
exports.config = {
user: process.env.BROWSERSTACK_USERNAME || 'BROWSERSTACK_USERNAME',
key: process.env.BROWSERSTACK_ACCESS_KEY || 'BROWSERSTACK_ACCESS_KEY',
updateJob: false,
specs: [
'./tests/specs/single_test.js'
],
exclude: [],
maxInstances: 10,
commonCapabilities: {
name: 'parallel_test',
build: 'webdriver-browserstack'
},
capabilities: [{
browser: 'chrome'
},{
browser: 'firefox'
},{
browser: 'internet explorer'
},{
browser: 'safari'
}],
logLevel: 'verbose',
coloredLogs: true,
screenshotPath: './errorShots/',
baseUrl: '',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,
framework: 'mocha',
mochaOpts: {
ui: 'bdd'
}
}
// Code to support common capabilities
exports.config.capabilities.forEach(function(caps){
for(var i in exports.config.commonCapabilities) caps[i] = caps[i] || exports.config.commonCapabilities[i];
});
var assert = require('assert');
describe('BrowserStack Local Testing', function() {
it('can check tunnel working', function () {
browser
.url('http://bs-local.com:45691/check')
assert(browser.getSource().match(/Up and running/i));
});
});
var assert = require('assert');
describe('Google\'s Search Functionality', function() {
it('opens google', function () {
browser
.url('https://www.google.com/ncr')
assert(browser.getTitle().match(/Google/i));
});
});
var assert = require('assert');
describe('Google\'s Search Functionality', function() {
it('can find search results', function () {
browser
.url('https://www.google.com/ncr')
.setValue('*[name="q"]','BrowserStack\n')
.pause(5000);
assert(browser.getTitle().match(/BrowserStack - Google Search/i));
});
});
var assert = require('assert');
describe('Google\'s Search Functionality', function() {
it('can find search results for non ncr', function () {
browser
.url('https://www.google.com')
.setValue('*[name="q"]','BrowserStack\n')
.pause(5000);
assert(browser.getTitle().match(/BrowserStack - Google/i));
});
});
var specs = [
'./multiple/test_01.js',
'./multiple/test_02.js',
'./multiple/test_03.js'
];
for (var i = specs.length - 1; i >= 0; i--) {
require(specs[i]);
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment