mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 08:50:06 +02:00
all casper tests fixed weee
This commit is contained in:
parent
5a1953aa25
commit
51220f6cdd
17 changed files with 35 additions and 17 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -11,4 +11,5 @@ index.html
|
|||
*.sw*
|
||||
npm-debug.log
|
||||
src/__tests__/casperjs/screenshots/*.png
|
||||
src/__tests__/casperjs/*.js-e
|
||||
|
||||
|
|
|
@ -10,6 +10,10 @@ var CasperUtils = {
|
|||
casper.echo('Error: ' + msg, 'ERROR');
|
||||
casper.echo('Stack: ' + JSON.stringify(trace));
|
||||
});
|
||||
casper.on('remote.error', function(msg) {
|
||||
casper.echo('Console Warn: ' + msg, 'ERROR');
|
||||
});
|
||||
|
||||
casper.options.logLevel ="debug";
|
||||
casper.start(url, callback);
|
||||
return casper;
|
||||
|
@ -106,6 +110,9 @@ var CasperUtils = {
|
|||
selectorContainsText: function(selector, text) {
|
||||
return function then() {
|
||||
this.test.assertEvalEquals(function(selector) {
|
||||
if (!document.querySelector(selector)) {
|
||||
return 'Query selector ' + selector + ' did not match!!';
|
||||
}
|
||||
return document.querySelector(selector).innerText
|
||||
.replace(/^\s+/g, '').replace(/\s+$/g, '');
|
||||
},
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||
|
||||
casper.start(
|
||||
CasperUtils.start(casper,
|
||||
CasperUtils.getUrl(),
|
||||
function() {
|
||||
this.test.assertTitle('Learn Git Branching');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||
|
||||
casper.start(
|
||||
CasperUtils.start(casper,
|
||||
CasperUtils.getUrl(),
|
||||
function() {
|
||||
this.test.assertTitle('Learn Git Branching');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||
|
||||
casper.start(
|
||||
CasperUtils.start(casper,
|
||||
CasperUtils.getUrl(),
|
||||
function() {
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||
|
||||
casper.start(
|
||||
CasperUtils.start(casper,
|
||||
CasperUtils.getUrl(),
|
||||
function() {
|
||||
this.test.assertTitle('Learn Git Branching');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||
|
||||
casper.start(
|
||||
CasperUtils.start(casper,
|
||||
CasperUtils.getUrl(),
|
||||
function() {
|
||||
this.test.assertTitle('Learn Git Branching');
|
||||
|
@ -51,7 +51,7 @@ casper.start(
|
|||
.then(function() {
|
||||
this.page.sendEvent('keypress', this.page.event.key.Enter);
|
||||
})
|
||||
.wait(1700)
|
||||
.wait(700)
|
||||
.then(CasperUtils.screenshot.entirePage)
|
||||
.then(CasperUtils.asserts.selectorContainsText(
|
||||
'div.levelNameWrapper',
|
||||
|
|
|
@ -23,7 +23,7 @@ var levelIconIDsForPages = function(start, end) {
|
|||
.reduce(flattenArray);
|
||||
};
|
||||
|
||||
casper.start(
|
||||
CasperUtils.start(casper,
|
||||
CasperUtils.getUrlForCommands([
|
||||
'levels',
|
||||
]),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||
|
||||
casper.start(
|
||||
CasperUtils.start(casper,
|
||||
CasperUtils.getUrlForCommands([
|
||||
'level intro1 --noIntroDialog --noStartCommand',
|
||||
]),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||
|
||||
casper.start(
|
||||
CasperUtils.start(casper,
|
||||
CasperUtils.getUrlForCommands([
|
||||
'level intro1 --noIntroDialog --noStartCommand',
|
||||
]),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||
|
||||
casper.start(
|
||||
CasperUtils.start(casper,
|
||||
CasperUtils.getUrlForCommands([
|
||||
'level intro1 --noIntroDialog --noStartCommand',
|
||||
'show goal',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||
|
||||
casper.start(
|
||||
CasperUtils.start(casper,
|
||||
CasperUtils.getUrlForCommands([
|
||||
'locale fr_FR',
|
||||
]),
|
||||
|
|
|
@ -21,7 +21,7 @@ var headerLocaleMap = {
|
|||
'pt-BR': 'pt_BR'
|
||||
};
|
||||
|
||||
casper.start(
|
||||
CasperUtils.start(casper,
|
||||
CasperUtils.getUrl(),
|
||||
function() {
|
||||
this.test.assertTitle('Learn Git Branching');
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||
|
||||
casper.start(
|
||||
CasperUtils.start(casper,
|
||||
CasperUtils.getUrlWithQueryParams({
|
||||
locale: 'fr_FR',
|
||||
}),
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
var CasperUtils = require('./casperUtils').CasperUtils;
|
||||
|
||||
casper.start(
|
||||
CasperUtils.start(casper,
|
||||
CasperUtils.getUrlForCommands([
|
||||
'git commit',
|
||||
]),
|
||||
|
|
|
@ -28,6 +28,15 @@ var CommandView = React.createClass({
|
|||
},
|
||||
|
||||
onModelDestroy: function() {
|
||||
if (!this.isMounted()) {
|
||||
return;
|
||||
}
|
||||
if (!this.getDOMNode) {
|
||||
// WTF -- only happens in casperjs tests weirdly
|
||||
console.error('this.getDOMNode not a function?');
|
||||
return;
|
||||
}
|
||||
|
||||
React.unmountComponentAtNode(this.getDOMNode().parentNode);
|
||||
},
|
||||
|
||||
|
|
|
@ -94,9 +94,6 @@
|
|||
</a>
|
||||
|
||||
<!-- Dependencies -->
|
||||
{{jsDependencies}}
|
||||
|
||||
<script src="lib/jquery-ui-1.9.0.custom.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
// PhantomJS doesn't support bind yet LOL. polyfill
|
||||
Function.prototype.bind = Function.prototype.bind || function (thisp) {
|
||||
|
@ -107,6 +104,10 @@
|
|||
};
|
||||
</script>
|
||||
|
||||
{{jsDependencies}}
|
||||
|
||||
<script src="lib/jquery-ui-1.9.0.custom.min.js"></script>
|
||||
|
||||
<!-- Templates from here on out. Someone seriously needs to fix template
|
||||
management for node.js apps. I know there is the text plugin
|
||||
for requireJS but that's lame. For now, they are all listed here... -->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue