Skip to content
This repository has been archived by the owner on Dec 5, 2019. It is now read-only.

Commit

Permalink
Updating to use latest protractor/jasmine/chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
Chad Roberts committed Dec 11, 2017
1 parent 9bd5cfd commit 56bb7d5
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 16 deletions.
14 changes: 9 additions & 5 deletions .travis.yml
Expand Up @@ -4,7 +4,10 @@ language: node_js
node_js:
- "6"
addons:
firefox: "46.0"
apt:
packages:
- net-tools
chrome: stable
## home folder is /home/travis/build/radanalyticsio/oshinko-console
services:
- docker
Expand Down Expand Up @@ -36,9 +39,12 @@ before_install:
- oc version
- export PATH=$PATH:/home/travis/origin/
- echo $PATH
- ip addr show eth0
- export HOST_IP_ADDRESS="$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)"
- echo "Host IP is $HOST_IP_ADDRESS"
## below cmd is important to get oc working in ubuntu
- sudo docker run -v /:/rootfs -ti --rm --entrypoint=/bin/bash --privileged openshift/origin:$OC_VERSION -c "mv /rootfs/bin/findmnt /rootfs/bin/findmnt.backup"
- oc cluster up --host-config-dir=/home/travis/origin
- oc cluster up --host-config-dir=/home/travis/origin --public-hostname=$HOST_IP_ADDRESS
- sudo ls -l /home/travis/origin
- oc cluster down
## get the latest release code
Expand All @@ -52,7 +58,7 @@ before_install:
- "sudo sed -i -e \"s/extensionStylesheets: null/extensionStylesheets:\\n - oshinko.css/\" /home/travis/origin/master/master-config.yaml"
- sudo cat /home/travis/origin/master/master-config.yaml
## oc cluster up
- oc cluster up --host-config-dir=/home/travis/origin --use-existing-config=true
- oc cluster up --host-config-dir=/home/travis/origin --use-existing-config=true --public-hostname=$HOST_IP_ADDRESS
## find IP:PORT of openshift
- IPSTR=`oc status |grep server`
- echo $IPSTR
Expand All @@ -63,8 +69,6 @@ before_install:
install:
- npm install grunt-cli -g
- npm install
- npm install grunt-protractor-runner@1.2.1
- ./node_modules/grunt-protractor-runner/scripts/webdriver-manager-update
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
Expand Down
6 changes: 3 additions & 3 deletions Gruntfile.js
Expand Up @@ -327,7 +327,7 @@ module.exports = function (grunt) {
// Arguments passed to the command
suite: grunt.option('suite') || 'e2e',
baseUrl: grunt.option('baseUrl') || ("https://localhost:8443/" + contextRoot + "/"),
browser: grunt.option('browser') || "firefox"
browser: grunt.option('browser') || "chrome"
}
},
default: {
Expand All @@ -336,7 +336,7 @@ module.exports = function (grunt) {
args: {
suite: grunt.option('suite') || 'e2e',
baseUrl: grunt.option('baseUrl') || ("https://localhost:8443/" + contextRoot + "/"),
browser: grunt.option('browser') || "firefox"
browser: grunt.option('browser') || "chrome"
} // Target-specific arguments
}
}
Expand Down Expand Up @@ -387,7 +387,7 @@ module.exports = function (grunt) {
'uglify',
'usemin',
'htmlmin',
'compress',
'compress'
]);

grunt.registerTask('dev', [
Expand Down
7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -4,7 +4,7 @@
"description": "Oshinko Console extension",
"main": "app.js",
"scripts": {
"postinstall": "node test/upgrade-selenium.js && node_modules/grunt-protractor-runner/scripts/webdriver-manager-update"
"postinstall": "node node_modules/grunt-protractor-runner/scripts/webdriver-manager-update"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -38,16 +38,17 @@
"grunt-htmlhint": "0.4.1",
"grunt-newer": "0.7.0",
"grunt-ng-annotate": "0.3.2",
"grunt-protractor-runner": "1.2.1",
"grunt-protractor-runner": "5.0.0",
"grunt-svgmin": "0.4.0",
"grunt-usemin": "2.4.0",
"html-minifier": "1.1.1",
"imagemin": "1.0.5",
"jasmine-spec-reporter": "1.1.2",
"jasmine-spec-reporter": "4.2.0",
"jshint-stylish": "0.2.0",
"less": "2.6.1",
"load-grunt-tasks": "0.4.0",
"lodash": "3.10.1",
"protractor": "5.2.0",
"protractor-screenshot-reporter": "0.0.5",
"time-grunt": "0.3.2"
},
Expand Down
7 changes: 5 additions & 2 deletions test/integration/helpers.js
Expand Up @@ -22,9 +22,11 @@ exports.login = function(loginPageAlreadyLoaded) {
// The login page doesn't use angular, so we have to use the underlying WebDriver instance
var driver = browser.driver;
if (!loginPageAlreadyLoaded) {
browser.waitForAngularEnabled(false);
browser.get('/');
browser.refresh();
driver.wait(function() {
return driver.isElementPresent(by.name("username"));
return element(by.name("username")).isPresent();
}, 3000);
}

Expand All @@ -33,8 +35,9 @@ exports.login = function(loginPageAlreadyLoaded) {
driver.findElement(by.css("button[type='submit']")).click();

driver.wait(function() {
return driver.isElementPresent(by.css(".navbar-iconic .username"));
return element(by.css(".navbar-iconic .username")).isPresent();
}, 5000);
browser.waitForAngularEnabled(true);
};

exports.clickAndGo = function(buttonText, uri) {
Expand Down
6 changes: 3 additions & 3 deletions test/protractor.conf.js
Expand Up @@ -206,7 +206,7 @@ exports.config = {
// console.log('Executing capability', config.capabilities);
// });

var SpecReporter = require('jasmine-spec-reporter');
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
// add jasmine spec reporter
jasmine.getEnv().addReporter(new SpecReporter({
displayStacktrace: true,
Expand Down Expand Up @@ -281,7 +281,7 @@ exports.config = {
// Jasmine is fully supported as a test and assertion framework.
// Mocha and Cucumber have limited beta support. You will need to include your
// own assertion framework (such as Chai) if working with Mocha.
framework: 'jasmine',
framework: 'jasmine2',

// Options to be passed to minijasminenode.
//
Expand Down Expand Up @@ -310,7 +310,7 @@ exports.config = {
print: function() {},
// If set, only execute specs whose names match the pattern, which is
// internally compiled to a RegExp.
grep: 'pattern',
// grep: 'pattern',
// Inverts 'grep' matches
invertGrep: false
},
Expand Down

0 comments on commit 56bb7d5

Please sign in to comment.