Merge branch 'develop' into issue-197-gettin-visual-visual

This commit is contained in:
Nick Chapman 2014-01-12 22:19:38 -08:00
Родитель e8fa7c2824 2f22719983
Коммит 5f5e03aa2c
13 изменённых файлов: 124 добавлений и 83 удалений

Просмотреть файл

@ -20,10 +20,6 @@ install:
# for local developers, grunt-cli is installed globally.
# We have to install it for travis.
- npm install grunt-cli
# install intern-geezer, which is an intern compatible with old IEs
- cd node_modules/intern-geezer
- npm install --production
- cd ../..
# copy over the configuration that can be used to start the server.
- cp server/config/local.json-dist server/config/local.json
- npm start &

Просмотреть файл

@ -28,7 +28,7 @@ module.exports = function (grunt) {
// show elapsed time at the end
require('time-grunt')(grunt);
// load all grunt tasks
require('load-grunt-tasks')(grunt);
require('load-grunt-tasks')(grunt, {scope: 'dependencies'});
grunt.initConfig({
});

Просмотреть файл

@ -9,7 +9,7 @@ require.config({
jquery: '../bower_components/jquery/jquery',
backbone: '../bower_components/backbone/backbone',
underscore: '../bower_components/underscore/underscore',
fxaClient: '../bower_components/fxa-js-client/build/fxa-client',
fxaClient: '../bower_components/fxa-js-client/fxa-client',
text: '../bower_components/requirejs-text/text',
mustache: '../bower_components/mustache/mustache',
stache: '../bower_components/requirejs-mustache/stache',

Просмотреть файл

@ -7,7 +7,7 @@
"underscore": "~1.5.2",
"backbone": "~1.1.0",
"modernizr": "~2.6.2",
"fxa-js-client": "https://github.com/mozilla/fxa-js-client.git",
"fxa-js-client": "https://github.com/mozilla/fxa-js-client.git#0.1.1",
"normalize-css": "~2.1.3",
"jquery.transit": "~0.9.9",
"requirejs-mustache": "*",

Просмотреть файл

@ -4,9 +4,10 @@
"description": "Firefox Accounts Content Server",
"scripts": {
"start": "grunt server",
"postinstall": "bower install;cd app/bower_components/fxa-js-client;npm install;grunt build",
"postinstall": "bower install",
"test": "intern-runner config=tests/intern",
"test-remote": "intern-runner config=tests/intern_remote"
"test-browser": "intern-runner config=tests/intern_browser",
"test-remote": "intern-runner config=tests/intern_sauce"
},
"repository": {
"type": "git",
@ -17,6 +18,8 @@
"author": "Mozilla (https://mozilla.org/)",
"license": "MPL 2.0",
"dependencies": {
"bower": "1.2.8",
"jshint": "0.9.1",
"connect-cachify": "0.0.15",
"convict": "0.4.0",
"express": "3.3.4",
@ -24,14 +27,6 @@
"jwcrypto": "0.4.3",
"intel": "0.4.0",
"helmet": "0.1.2",
"connect-fonts": "0.0.12",
"connect-fonts-firasans": "0.0.2",
"connect-fonts-clearsans": "0.0.1"
},
"devDependencies": {
"bower": "1.2.8",
"awsbox": "0.6.2",
"jshint": "0.9.1",
"grunt": "~0.4.1",
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
@ -53,11 +48,18 @@
"grunt-requirejs": "~0.4.0",
"grunt-svgmin": "~0.2.0",
"grunt-concurrent": "~0.3.0",
"load-grunt-tasks": "~0.1.0",
"time-grunt": "~0.1.1",
"intern-geezer": "1.3.2",
"jshint-stylish": "~0.1.4",
"grunt-preprocess": "~3.0.1",
"load-grunt-tasks": "0.2.1",
"time-grunt": "~0.1.1",
"jshint-stylish": "~0.1.4",
"connect-fonts": "0.0.12",
"connect-fonts-firasans": "0.0.2",
"connect-fonts-clearsans": "0.0.1",
"grunt-cli": "0.1.11"
},
"devDependencies": {
"awsbox": "0.6.2",
"intern-geezer": "1.3.2",
"xmlhttprequest": "git://github.com/zaach/node-XMLHttpRequest.git#onerror"
},
"engines": {

Просмотреть файл

@ -44,6 +44,10 @@ git checkout 9e009e6f15f28debfb59d3d7787dfc20c50e230f
cat *.pub >> /home/ec2-user/.ssh/authorized_keys
cd ..
rm -rf identity-pubkeys
cat >> /home/ec2-user/.ssh/authorized_keys << EOF
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAvyIb/9pablSz0Bf46dpKfWfxyL1Ui5Ypo1LOdmesUYxW4kUE3eQpc7bAPP8wVEFUixQR908p94M1FORICzc8mrOG/0l8Vu+B86kYML+Z0Rjtjn+NDXyY8BUKhGapTLnyZh7BiV5RlUN/JBUYtIYzj1Y5yS58LdbFdhzt7MQmcBklfwkN7fzbpf/E1Fv5CcWnr0TvFsz8wSueoh0vepiHKVYgym3HnUTqnF8opUL3i4mrKftZi0PPg4t6YxIgu8ZKj8yGin0eNtwJhjE3dO9WBXGDYcLv8Ps7Ny9chymeJljRJ/QNtJXt6XxLGZdagehTjj3/uz14WEGr7i5bZJRjjw== trink@mozilla.com
EOF
echo "Cleaning up old logfiles"

Просмотреть файл

@ -10,4 +10,6 @@ else
nohup /usr/bin/circusd --daemon /home/app/circus.ini > /home/app/circusd.log 2>&1 &
fi
node_modules/.bin/grunt build
echo "DONE"

Просмотреть файл

@ -10,96 +10,118 @@ define([
'use strict';
var url = 'http://localhost:3030/birthday';
var ONE_DAY_IN_MS = 1000 * 60 * 60 * 24;
var NOW = new Date();
var YESTERDAY = new Date();
YESTERDAY.setTime(NOW.getTime() - ONE_DAY_IN_MS);
var TOMORROW = new Date();
TOMORROW.setTime(NOW.getTime() + ONE_DAY_IN_MS);
var MONTHS = [
'jan', 'feb', 'mar', 'apr', 'may', 'jun',
'jul', 'aug', 'sep', 'oct', 'nov', 'dec'
];
registerSuite({
name: 'sign_up',
name: 'birthday',
'pick a day that is before today - user can register': function () {
var month = MONTHS[YESTERDAY.getMonth()];
var day = YESTERDAY.getDate();
var month;
var day;
return this.get('remote')
.get(require.toUrl(url))
.waitForElementById('fxa-birthday-header')
var remote = this.get('remote')
.eval("{ day: new Date(new Date().getTime() - 1000 * 60 * 60 * 24).getDate(), month: new Date(new Date().getTime() - 1000 * 60 * 60 * 24).getMonth() }")
.then(function (result) {
day = result.day;
month = MONTHS[result.month];
.elementById('fxa-month-' + month)
.click()
.end()
remote.get(require.toUrl(url + '#yesterday'))
.waitForElementById('fxa-birthday-header')
.elementById('fxa-month-' + month)
.click()
.end()
.elementById('fxa-day-' + day)
.click()
.end()
.elementById('fxa-day-' + day)
.click()
.wait(1000)
.end()
.elementById('fxa-birthday-submit')
.click()
.end()
.elementById('fxa-birthday-submit')
.submit()
.end()
// Success is being redirected to the create account screen.
.waitForElementById('fxa-create-account-header')
// Success is being redirected to the create account screen.
.waitForElementById('fxa-create-account-header')
.end();
})
.end();
return remote;
},
'pick today - user can register': function () {
var month = MONTHS[NOW.getMonth()];
var day = NOW.getDate();
var month;
var day;
return this.get('remote')
.get(require.toUrl(url))
.waitForElementById('fxa-birthday-header')
var remote = this.get('remote')
// Get client current date, we cannot use the date of the test runner.
.eval("{ day: new Date().getDate(), month: new Date().getMonth() }")
.then(function (result) {
day = result.day;
month = MONTHS[result.month];
.elementById('fxa-month-' + month)
.click()
.end()
remote.get(require.toUrl(url + '#today'))
.waitForElementById('fxa-birthday-header')
.elementById('fxa-day-' + day)
.click()
.end()
.elementById('fxa-month-' + month)
.click()
.end()
.elementById('fxa-birthday-submit')
.click()
.end()
.elementById('fxa-day-' + day)
.click()
.wait(1000)
.end()
// Success is being redirected to the create account screen.
.waitForElementById('fxa-create-account-header')
.elementById('fxa-birthday-submit')
.submit()
.end()
// Success is being redirected to the create account screen.
.waitForElementById('fxa-create-account-header')
.end();
})
.end();
return remote;
},
'pick a day that is after today - user is too young': function () {
var month = MONTHS[TOMORROW.getMonth()];
var day = TOMORROW.getDate();
var month;
var day;
return this.get('remote')
.get(require.toUrl(url))
.waitForElementById('fxa-birthday-header')
var remote = this.get('remote')
.eval("{ day: new Date(new Date().getTime() + 1000 * 60 * 60 * 24).getDate(), month: new Date(new Date().getTime() + 1000 * 60 * 60 * 24).getMonth() }")
.then(function (result) {
day = result.day;
month = MONTHS[result.month];
.elementById('fxa-month-' + month)
.click()
.end()
remote.get(require.toUrl(url + '#tomorrow'))
.waitForElementById('fxa-birthday-header')
.elementById('fxa-month-' + month)
.click()
.end()
.elementById('fxa-day-' + day)
.click()
.end()
.elementById('fxa-day-' + day)
.click()
.wait(1000)
.end()
.elementById('fxa-birthday-submit')
.click()
.end()
.elementById('fxa-birthday-submit')
.submit()
.end()
// Success is being redirected to the cannot create account screen.
.waitForElementById('fxa-cannot-create-account-header')
// Success is being redirected to the cannot create account screen.
.waitForElementById('fxa-cannot-create-account-header')
.end();
})
.end();
return remote;
}
});
});

Просмотреть файл

@ -7,7 +7,7 @@ define([
'intern/chai!assert',
'require',
'intern/node_modules/dojo/node!xmlhttprequest',
'app/bower_components/fxa-js-client/client/FxAccountClient'
'app/bower_components/fxa-js-client/fxa-client'
], function (registerSuite, assert, require, nodeXMLHttpRequest, FxaClient) {
'use strict';
@ -33,7 +33,7 @@ define([
// the email
var token = 'token';
var uid = 'uid';
var url = PAGE_URL_ROOT + '?uid=' + uid + '&token=' + token;
var url = PAGE_URL_ROOT + '?uid=' + uid + '&code=' + token;
return this.get('remote')
.get(require.toUrl(url))

Просмотреть файл

@ -7,7 +7,7 @@ define([
'intern/chai!assert',
'require',
'intern/node_modules/dojo/node!xmlhttprequest',
'app/bower_components/fxa-js-client/client/FxAccountClient'
'app/bower_components/fxa-js-client/fxa-client'
], function (registerSuite, assert, require, nodeXMLHttpRequest, FxaClient) {
'use strict';

Просмотреть файл

@ -19,7 +19,7 @@ define({
// Note that the `build` capability will be filled in with the current commit ID from the Travis CI environment
// automatically
capabilities: {
'selenium-version': '2.35.0'
'selenium-version': '2.38.0'
},
// Browsers to run integration testing against. Note that version numbers must be strings if used with Sauce

15
tests/intern_browser.js Normal file
Просмотреть файл

@ -0,0 +1,15 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
define([
'./intern'
], function (intern) {
'use strict';
intern.environments = [
{ browserName: 'firefox', version: '25' }
];
return intern;
});

Просмотреть файл