Skip to content

Commit

Permalink
more changes toward e2e on browserstack
Browse files Browse the repository at this point in the history
  • Loading branch information
megahirt committed Nov 3, 2017
1 parent a96713b commit 9a2f413
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
6 changes: 3 additions & 3 deletions browserStackE2E.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@

if [ "$1" = "sf" ]
then
E2EHOSTNAME="e2etest.scriptureforge.org"
E2EHOSTNAME="e2etest.scriptureforge.local"
else
E2EHOSTNAME="e2etest.languageforge.org"
E2EHOSTNAME="e2etest.languageforge.local"
fi
gulp test-e2e-run --conf protractorConfBrowserStack.js --webserverHost $E2EHOSTNAME ${@:2}
gulp test-e2e-run --webserverHost $E2EHOSTNAME ${@:2}
STATUS=$?

# Ensure cleanup
Expand Down
20 changes: 11 additions & 9 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -550,11 +550,11 @@ gulp.task('test-e2e-doTest', function (cb) {
demand: false,
describe: 'filename of a protractor conf file. default is protractorConf.js',
type: 'string' })
.option('browserstackUser', {
.option('browserStackUser', {
demand: false,
describe: 'BrowserStack API username',
type: 'string' })
.option('browserstackKey', {
.option('browserStackKey', {
demand: false,
describe: 'BrowserStack API key',
type: 'string' })
Expand All @@ -577,27 +577,29 @@ gulp.task('test-e2e-doTest', function (cb) {
}

var isBrowserStack = false;
var protractorOptions = {
debug: false,
args: []
};

// Get the browser stack user and password
if (params.browserstackUser && params.browserstackUser.length > 0) {
if (params.browserStackUser && params.browserStackUser.length > 0) {
protractorOptions.args.push('--browserstackUser', params.browserStackUser);
isBrowserStack = true;
}
if (params.browserstackKey && params.browserstackKey.length > 0) {
if (params.browserStackKey && params.browserStackKey.length > 0) {
protractorOptions.args.push('--browserstackKey', params.browserStackKey);
}

var webserverHost = params.webserverHost;
if (isBrowserStack) {
webserverHost = webserverHost.replace(".local", ".org");
configFile = './test/app/browserStackLFProtractorConf.js';
}

// vars for configuring protractor
var protractorOptions = {
configFile: configFile,
args: ['--baseUrl', protocol + params.webserverHost],
debug: false
};
protractorOptions.configFile = configFile;
protractorOptions.args.push('--baseUrl', protocol + params.webserverHost);

// Generate list of specs to test (glob format so protractor will test whatever files exist)
var specString = (params.specs) ? params.specs : '*';
Expand Down
9 changes: 9 additions & 0 deletions test/app/browserStackLFProtractorConf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
exports.config = {
'baseUrl': 'http://e2etest.languageforge.org',
'framework': 'jasmine2',
'rootElement': '[id="app-container-for-bootstrap"]',

'capabilities': {
'browserName': 'chrome'
}
};

0 comments on commit 9a2f413

Please sign in to comment.