chore(tests): fix up functional tests
This commit is contained in:
Родитель
079e21c1ce
Коммит
7cea344dab
|
@ -12,7 +12,7 @@
|
|||
<section class="top-bar-section">
|
||||
<ul class="right">
|
||||
{{#if session.email}}
|
||||
<li><a {{ action 'invalidateSession' }}>Logout</a></li>
|
||||
<li><a id="logout" {{ action 'invalidateSession' }}>Logout</a></li>
|
||||
{{/if}}
|
||||
</ul>
|
||||
</section>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
{{#if model.secret}}
|
||||
<label for="secret" >Client Secret</label>
|
||||
<pre>{{model.secret}}</pre>
|
||||
<pre id="secret">{{model.secret}}</pre>
|
||||
<p style="color:red; font-size: 20px;">Save this secret above, you will never see it again.</p>
|
||||
<h2>Sample Configuration</h2>
|
||||
<pre>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<form class="form-horizontal" role="form">
|
||||
<fieldset>
|
||||
{{#if name}}
|
||||
<legend>Client: {{name}}</legend>
|
||||
{{#if model.name}}
|
||||
<legend>Client: {{model.name}}</legend>
|
||||
{{else}}
|
||||
<legend>New Client</legend>
|
||||
{{/if}}
|
||||
|
@ -9,9 +9,9 @@
|
|||
{{partial 'client/form'}}
|
||||
</fieldset>
|
||||
</form>
|
||||
{{#unless secret}}
|
||||
{{#unless model.secret}}
|
||||
<div class="btn-group">
|
||||
<button class="button alert " {{action 'cancel' this}}>Cancel</button>
|
||||
<button class="button success" {{action 'create' this}}>Create</button>
|
||||
<button class="button alert register-cancel" {{action 'cancel' this}}>Cancel</button>
|
||||
<button class="button success register-create" {{action 'create' this}}>Create</button>
|
||||
</div>
|
||||
{{/unless}}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
<ul class="inline-list left">
|
||||
<li>
|
||||
<button {{action 'goToNewClient' }} class="small button success">+ Create a new OAuth Client</button>
|
||||
<button {{action 'goToNewClient' }} class="small button success new-client">+ Create a new OAuth Client</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<ul class="inline-list right">
|
||||
<li>
|
||||
<button {{action 'goToScopedToken' }} class="small button success">Get an OAuth Scoped Token</button>
|
||||
<button {{action 'goToScopedToken' }} class="small button success scoped-token">Get an OAuth Scoped Token</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
"jquery": ">= 1.7.0 < 2.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"blanket": "~1.1.5"
|
||||
"blanket": "~1.1.5",
|
||||
"fxa-js-client": "~0.1.27"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
"start": "./scripts/run_dev.js",
|
||||
"production": "NODE_ENV=production ember build --environment=production && node bin/server.js",
|
||||
"test": "ember test && grunt lint",
|
||||
"test-functional": "./scripts/run_functional.sh",
|
||||
"postinstall": "node_modules/.bin/bower install --config.interactive=false -s",
|
||||
"outdated": "npm outdated --depth 0",
|
||||
"contributors": "git shortlog -s | cut -c8- | sort -f > CONTRIBUTORS"
|
||||
|
@ -52,7 +53,9 @@
|
|||
"intern": "^2.2.2",
|
||||
"load-grunt-tasks": "^1.0.0",
|
||||
"nodemon": "^1.2.1",
|
||||
"opn": "^1.0.0"
|
||||
"opn": "^1.0.0",
|
||||
"selenium-standalone": "^2.44.0-1",
|
||||
"xmlhttprequest": "git://github.com/zaach/node-XMLHttpRequest.git#onerror"
|
||||
},
|
||||
"engines": {
|
||||
"node": "0.10.0",
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
node_modules/.bin/start-selenium > /dev/null 2>&1 &
|
||||
SEL=$!
|
||||
|
||||
sleep 3
|
||||
node_modules/.bin/intern-runner config=tests/functional/intern
|
||||
|
||||
kill $SEL
|
||||
wait
|
|
@ -1,5 +1,5 @@
|
|||
define([
|
||||
'./functional/all/clients'
|
||||
'./all/clients'
|
||||
], function () {
|
||||
'use strict';
|
||||
});
|
||||
});
|
||||
|
|
|
@ -6,36 +6,84 @@ define([
|
|||
'intern',
|
||||
'intern!object',
|
||||
'intern/chai!assert',
|
||||
'require'
|
||||
], function (intern, registerSuite, assert, require) {
|
||||
'require',
|
||||
'bower_components/fxa-js-client/fxa-client',
|
||||
'intern/node_modules/dojo/node!xmlhttprequest'
|
||||
], function (intern, registerSuite, assert, require, FxaClient, nodeXMLHttpRequest) {
|
||||
|
||||
var config = intern.config;
|
||||
var AUTH_SERVER_ROOT = 'http://127.0.0.1:9000/v1';
|
||||
var APP_URL = 'http://127.0.0.1:10137';
|
||||
var client = new FxaClient(AUTH_SERVER_ROOT, {
|
||||
xhr: nodeXMLHttpRequest.XMLHttpRequest
|
||||
});
|
||||
var email = 'user' + Date.now() + '@mozilla.com';
|
||||
var PASSWORD = 'password';
|
||||
|
||||
registerSuite({
|
||||
name: 'clients',
|
||||
|
||||
'login, add a client, update that client, delete it, logout': function () {
|
||||
this.timeout = 60 * 1000 * 60 * 2;
|
||||
|
||||
return this.remote
|
||||
.get(require.toUrl(APP_URL))
|
||||
.setFindTimeout(config.pageLoadTimeout)
|
||||
.then(function () {
|
||||
return client.signUp(email, PASSWORD, { preVerified: true });
|
||||
})
|
||||
|
||||
.findByCssSelector('#login')
|
||||
.click()
|
||||
.end()
|
||||
|
||||
.findByCssSelector('.sign-up')
|
||||
.click()
|
||||
.end()
|
||||
|
||||
.findByCssSelector('#fxa-signup-header')
|
||||
.findByCssSelector('#fxa-signin-header')
|
||||
.end()
|
||||
|
||||
.findByCssSelector('input.email')
|
||||
.type('')
|
||||
.type(email)
|
||||
.end()
|
||||
|
||||
.findByCssSelector('#password')
|
||||
.type(PASSWORD)
|
||||
.end()
|
||||
|
||||
.findByCssSelector('#submit-btn')
|
||||
.click()
|
||||
.end()
|
||||
|
||||
.findByCssSelector('#logout')
|
||||
.end()
|
||||
|
||||
.findByCssSelector('.new-client')
|
||||
.click()
|
||||
.end()
|
||||
|
||||
.findByCssSelector('#inputTitle')
|
||||
.type('sample')
|
||||
.end()
|
||||
|
||||
.findByCssSelector('#inputRedirect')
|
||||
.type('sample')
|
||||
.end()
|
||||
|
||||
.findByCssSelector('#inputImage')
|
||||
.type('sample')
|
||||
.end()
|
||||
|
||||
.findByCssSelector('#inputImage')
|
||||
.type('sample')
|
||||
.end()
|
||||
|
||||
.findByCssSelector('.register-create')
|
||||
.click()
|
||||
.end()
|
||||
|
||||
.findByCssSelector('#secret')
|
||||
.getVisibleText()
|
||||
.then(function (val) {
|
||||
assert.isTrue(val.length > 0);
|
||||
})
|
||||
.end();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
define({
|
||||
functionalSuites: [ 'tests/functional/all' ],
|
||||
|
||||
environments: [
|
||||
{ browserName: 'firefox' }
|
||||
],
|
||||
pageLoadTimeout: 10000,
|
||||
excludeInstrumentation: /./
|
||||
});
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче