Compare commits
30 Commits
Author | SHA1 | Date |
---|---|---|
Chakib Benziane | a2f6528268 | 10 years ago |
Richard Littauer | db89db9431 | 10 years ago |
Brian Ford | 154772b7f4 | 10 years ago |
Brian Ford | f83c7f5ca6 | 10 years ago |
Brian Ford | a219e1cdd3 | 10 years ago |
Brian Ford | 68b72bfa6f | 10 years ago |
Brian Ford | 0cf05a7588 | 10 years ago |
Brian Ford | f2a9044e3b | 10 years ago |
Brian Ford | ca0dc695e5 | 10 years ago |
Brian Ford | fce0052322 | 10 years ago |
Brian Ford | 287074b73e | 10 years ago |
Brian Ford | bd32b00172 | 10 years ago |
Brian Ford | e902ecae96 | 10 years ago |
Brian Ford | 8c67a3e77e | 10 years ago |
Brian Ford | d7008a1368 | 10 years ago |
Brian Ford | d3e7bd6ec4 | 10 years ago |
Brian Ford | 2d0e8abff0 | 10 years ago |
Brian Ford | 60bdec9949 | 10 years ago |
Brian Ford | bd2ebbfd39 | 10 years ago |
Brian Ford | bec405c8c7 | 10 years ago |
Brian Ford | 010d8b573b | 10 years ago |
Brian Ford | 738ba58e77 | 10 years ago |
Brian Ford | f745b92053 | 10 years ago |
Brian Ford | 5cee2720b7 | 10 years ago |
Brian Ford | 5fd469035a | 10 years ago |
Brian Ford | a521bb9ea3 | 10 years ago |
Brian Ford | aa1c792d1a | 10 years ago |
Brian Ford | 1e5783f848 | 10 years ago |
Brian Ford | f8e205beb6 | 10 years ago |
Brian Ford | 1cfef9bd07 | 10 years ago |
@ -0,0 +1,21 @@
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
|
||||
env:
|
||||
global:
|
||||
- BROWSER_PROVIDER_READY_FILE=/tmp/sauce-connect-ready
|
||||
- LOGS_DIR=/tmp/angular-hint-build/logs
|
||||
- SAUCE_USERNAME=angular-ci
|
||||
- SAUCE_ACCESS_KEY=9b988f434ff8-fbca-8aa4-4ae3-35442987
|
||||
|
||||
install:
|
||||
- mkdir -p $LOGS_DIR
|
||||
- ./scripts/sauce_connect_setup.sh
|
||||
- npm install
|
||||
- npm install -g gulp
|
||||
- npm install -g karma-cli
|
||||
- ./scripts/wait_for_browser_provider.sh
|
||||
|
||||
script:
|
||||
- ./scripts/test_on_sauce.sh
|
@ -1,8 +1,23 @@
|
||||
# AngularJS Batarang
|
||||
[![Build Status](https://travis-ci.org/angular/angularjs-batarang.svg)](https://travis-ci.org/angular/angularjs-batarang)
|
||||
|
||||
## Installing from the Web Store
|
||||
|
||||
https://chrome.google.com/webstore/detail/ighdmehidhipcmcojjgiloacoafjmpfk
|
||||
|
||||
## Installing Previous Versions
|
||||
|
||||
1. Download and extract one of the files from the [Batarang releases page on GitHub](https://github.com/angular/angularjs-batarang/releases)
|
||||
1. Navigate to `chrome://chrome/extensions/` in Chrome
|
||||
1. If you've installed Batarang from the web store, disable or remove that version
|
||||
1. On the top right, check the checkbox for "Developer mode"
|
||||
1. Click "Load unpacked extension..."
|
||||
1. Select the directory where you extracted the extension
|
||||
1. Close and re-open any inspected tabs
|
||||
|
||||
## Installing from Source
|
||||
|
||||
See the [instructions in the contributing guide](https://github.com/angular/angularjs-batarang/blob/master/CONTRIBUTING.md#installing-from-source)
|
||||
|
||||
## License
|
||||
MIT
|
||||
|
@ -0,0 +1,21 @@
|
||||
/*
|
||||
* karma.conf.js and karma.es5.conf.js optionally load this
|
||||
*/
|
||||
|
||||
var CUSTOM_LAUNCHERS = {
|
||||
'SL_Chrome': {
|
||||
base: 'SauceLabs',
|
||||
browserName: 'chrome',
|
||||
version: '35'
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = function(options) {
|
||||
options.sauceLabs = {
|
||||
testName: 'AngularJS Batarang Unit Tests',
|
||||
startConnect: true
|
||||
};
|
||||
options.customLaunchers = CUSTOM_LAUNCHERS;
|
||||
options.browsers = Object.keys(CUSTOM_LAUNCHERS);
|
||||
options.reporters = ['dots', 'saucelabs'];
|
||||
};
|
@ -0,0 +1,24 @@
|
||||
/*
|
||||
* karma.conf.js optionally loads this
|
||||
*/
|
||||
|
||||
module.exports = function(options) {
|
||||
if (!isTravis()) {
|
||||
return;
|
||||
} else if (!options.sauceLabs) {
|
||||
throw new Error('This should be loaded after karma.sauce config');
|
||||
}
|
||||
options.sauceLabs.build = 'TRAVIS #' + process.env.TRAVIS_BUILD_NUMBER + ' (' + process.env.TRAVIS_BUILD_ID + ')';
|
||||
options.sauceLabs.tunnelIdentifier = process.env.TRAVIS_JOB_NUMBER;
|
||||
options.sauceLabs.startConnect = false;
|
||||
|
||||
// TODO(vojta): remove once SauceLabs supports websockets.
|
||||
// This speeds up the capturing a bit, as browsers don't even try to use websocket.
|
||||
options.transports = ['xhr-polling'];
|
||||
|
||||
options.singleRun = true;
|
||||
};
|
||||
|
||||
function isTravis() {
|
||||
return !!process.env.TRAVIS;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
Binary file not shown.
After Width: | Height: | Size: 3.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 6.0 KiB |
@ -1,20 +1,28 @@
|
||||
var html = document.getElementsByTagName('html')[0];
|
||||
if (document.cookie.indexOf('__ngDebug=true') != -1) {
|
||||
bootstrapHint();
|
||||
}
|
||||
|
||||
var eventProxyElement = document.createElement('div');
|
||||
eventProxyElement.id = '__ngBatarangElement';
|
||||
eventProxyElement.style.display = 'none';
|
||||
html.appendChild(eventProxyElement);
|
||||
function bootstrapHint () {
|
||||
chrome.extension.sendMessage('refresh');
|
||||
|
||||
// inject into the application context from the content script context
|
||||
var html = document.getElementsByTagName('html')[0];
|
||||
|
||||
var script = window.document.createElement('script');
|
||||
script.src = chrome.extension.getURL('dist/hint.js');
|
||||
var eventProxyElement = document.createElement('div');
|
||||
eventProxyElement.id = '__ngBatarangElement';
|
||||
eventProxyElement.style.display = 'none';
|
||||
html.appendChild(eventProxyElement);
|
||||
|
||||
eventProxyElement.addEventListener('batarangDataEvent', function () {
|
||||
var eventData = eventProxyElement.innerText;
|
||||
chrome.extension.sendMessage(eventData);
|
||||
});
|
||||
// inject into the application context from the content script context
|
||||
|
||||
html.setAttribute('ng-hint', '');
|
||||
var script = window.document.createElement('script');
|
||||
script.src = chrome.extension.getURL('dist/hint.js');
|
||||
|
||||
html.appendChild(script);
|
||||
eventProxyElement.addEventListener('batarangDataEvent', function () {
|
||||
var eventData = eventProxyElement.innerText;
|
||||
chrome.extension.sendMessage(eventData);
|
||||
});
|
||||
|
||||
html.setAttribute('ng-hint', '');
|
||||
|
||||
html.appendChild(script);
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Switch a dependency to git repo.
|
||||
# Remove the NPM package and link it to a repo in parent directory.
|
||||
DEP_NAME=$1
|
||||
SCRIPT_DIR=$(dirname $0)
|
||||
cd $SCRIPT_DIR/..
|
||||
|
||||
if [ -L ./node_modules/$DEP_NAME ]; then
|
||||
echo "$DEP_NAME is already a symlink"
|
||||
else
|
||||
PKG_INFO=($($SCRIPT_DIR/read-pkg-url.js ./node_modules/$DEP_NAME/package.json))
|
||||
URL=${PKG_INFO[0]}
|
||||
DIR_NAME=${PKG_INFO[1]}
|
||||
|
||||
echo "Switching $DEP_NAME"
|
||||
rm -rf ./node_modules/$DEP_NAME
|
||||
|
||||
if [ -d ../$DIR_NAME ]; then
|
||||
echo "Repo already cloned in ../$DIR_NAME"
|
||||
else
|
||||
cd ..
|
||||
git clone $URL $DIR_NAME
|
||||
cd -
|
||||
fi
|
||||
|
||||
echo "Link ./node_modules/$DEP_NAME -> ../$DIR_NAME"
|
||||
ln -s ../../$DIR_NAME ./node_modules/$DEP_NAME
|
||||
fi
|
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Switch a dependency to NPM.
|
||||
# Remove the symlink and install from NPM.
|
||||
|
||||
DEP_NAME=$1
|
||||
SCRIPT_DIR=$(dirname $0)
|
||||
cd $SCRIPT_DIR/..
|
||||
|
||||
if [ ! -L ./node_modules/$DEP_NAME ]; then
|
||||
echo "$DEP_NAME is not a symlink"
|
||||
else
|
||||
rm ./node_modules/$DEP_NAME
|
||||
npm install $DEP_NAME
|
||||
fi
|
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
LOG_FILES=$LOGS_DIR/*
|
||||
|
||||
for FILE in $LOG_FILES; do
|
||||
echo -e "\n\n\n"
|
||||
echo "=================================================================="
|
||||
echo " $FILE"
|
||||
echo "=================================================================="
|
||||
cat $FILE
|
||||
done
|
@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var fs = require('fs');
|
||||
var pkg = JSON.parse(fs.readFileSync(process.argv[2]));
|
||||
var url = pkg.repository.url;
|
||||
var dirname = url.replace(/^.*\//, '').replace(/\.git$/, '');
|
||||
|
||||
console.log(url + ' ' + dirname);
|
@ -0,0 +1,50 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Setup and start Sauce Connect for your TravisCI build
|
||||
# This script requires your .travis.yml to include the following two private env variables:
|
||||
# SAUCE_USERNAME
|
||||
# SAUCE_ACCESS_KEY
|
||||
# Follow the steps at https://saucelabs.com/opensource/travis to set that up.
|
||||
#
|
||||
# Curl and run this script as part of your .travis.yml before_script section:
|
||||
# before_script:
|
||||
# - curl https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash
|
||||
|
||||
CONNECT_URL="https://saucelabs.com/downloads/sc-4.3-linux.tar.gz"
|
||||
CONNECT_DIR="/tmp/sauce-connect-$RANDOM"
|
||||
CONNECT_DOWNLOAD="sc-latest-linux.tar.gz"
|
||||
|
||||
CONNECT_LOG="$LOGS_DIR/sauce-connect"
|
||||
CONNECT_STDOUT="$LOGS_DIR/sauce-connect.stdout"
|
||||
CONNECT_STDERR="$LOGS_DIR/sauce-connect.stderr"
|
||||
|
||||
# Get Connect and start it
|
||||
mkdir -p $CONNECT_DIR
|
||||
cd $CONNECT_DIR
|
||||
curl $CONNECT_URL -o $CONNECT_DOWNLOAD 2> /dev/null 1> /dev/null
|
||||
mkdir sauce-connect
|
||||
tar --extract --file=$CONNECT_DOWNLOAD --strip-components=1 --directory=sauce-connect > /dev/null
|
||||
rm $CONNECT_DOWNLOAD
|
||||
|
||||
SAUCE_ACCESS_KEY=`echo $SAUCE_ACCESS_KEY | rev`
|
||||
|
||||
|
||||
ARGS=""
|
||||
|
||||
# Set tunnel-id only on Travis, to make local testing easier.
|
||||
if [ ! -z "$TRAVIS_JOB_NUMBER" ]; then
|
||||
ARGS="$ARGS --tunnel-identifier $TRAVIS_JOB_NUMBER"
|
||||
fi
|
||||
if [ ! -z "$BROWSER_PROVIDER_READY_FILE" ]; then
|
||||
ARGS="$ARGS --readyfile $BROWSER_PROVIDER_READY_FILE"
|
||||
fi
|
||||
|
||||
|
||||
echo "Starting Sauce Connect in the background, logging into:"
|
||||
echo " $CONNECT_LOG"
|
||||
echo " $CONNECT_STDOUT"
|
||||
echo " $CONNECT_STDERR"
|
||||
sauce-connect/bin/sc -u $SAUCE_USERNAME -k $SAUCE_ACCESS_KEY -v $ARGS \
|
||||
--logfile $CONNECT_LOG 2> $CONNECT_STDERR 1> $CONNECT_STDOUT &
|
@ -0,0 +1,8 @@
|
||||
#! /bin/bash
|
||||
SCRIPT_DIR=$(dirname $0)
|
||||
cd $SCRIPT_DIR/..
|
||||
|
||||
SAUCE_ACCESS_KEY=`echo $SAUCE_ACCESS_KEY | rev`
|
||||
|
||||
gulp
|
||||
karma start --sauce
|
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
# Wait for Connect to be ready before exiting
|
||||
while [ ! -f $BROWSER_PROVIDER_READY_FILE ]; do
|
||||
sleep .5
|
||||
done
|
Reference in New Issue