Merge pull request #1133 from gotdibbs/Issue1124

Fixed intermittent test errors
This commit is contained in:
Hannah Wolfe 2013-10-22 07:59:50 -07:00
commit 5d169610ce
14 changed files with 13 additions and 28 deletions

View File

@ -203,7 +203,8 @@ var path = require('path'),
mochacli: {
options: {
ui: 'bdd',
reporter: 'spec'
reporter: 'spec',
timeout: '15000'
},
all: {

View File

@ -102,7 +102,7 @@ CasperTest.begin('Title Trimming', 2, function suite(test) {
});
});
CasperTest.begin('Publish menu - new post', 11, function suite(test) {
CasperTest.begin('Publish menu - new post', 10, function suite(test) {
casper.thenOpen(url + 'ghost/editor/', function testTitleAndUrl() {
test.assertTitle("Ghost Admin", 'Ghost admin has no title');
});
@ -127,17 +127,18 @@ CasperTest.begin('Publish menu - new post', 11, function suite(test) {
});
// ... check status, label, class
casper.then(function () {
test.assertExists('.js-publish-splitbutton.splitbutton-delete', 'Publish split button should have .splitbutton-delete');
casper.waitForSelector('.js-publish-splitbutton.splitbutton-delete', function onSuccess() {
test.assertExists('.js-publish-button.button-delete', 'Publish button should have .button-delete');
test.assertSelectorHasText('.js-publish-button', 'Publish Now');
test.assertEval(function() {
return (__utils__.findOne('.js-publish-button').getAttribute('data-status') === 'published');
}, 'Publish button\'s updated status should be "published"');
}, function onTimeout() {
test.assert(false, 'Publish split button should have .splitbutton-delete');
});
});
CasperTest.begin('Publish menu - existing post', 24, function suite(test) {
CasperTest.begin('Publish menu - existing post', 22, function suite(test) {
// Create a post, save it and test refreshed editor
casper.thenOpen(url + 'ghost/editor/', function testTitleAndUrl() {
test.assertTitle("Ghost Admin", 'Ghost admin has no title');
@ -179,13 +180,14 @@ CasperTest.begin('Publish menu - existing post', 24, function suite(test) {
casper.thenClick('.js-publish-splitbutton li[data-set-status="published"]');
// ... check status, label, class
casper.then(function () {
test.assertExists('.js-publish-splitbutton.splitbutton-delete', 'Publish split button should have .splitbutton-delete');
casper.waitForSelector('.js-publish-splitbutton.splitbutton-delete', function onSuccess() {
test.assertExists('.js-publish-button.button-delete', 'Publish button should have .button-delete');
test.assertSelectorHasText('.js-publish-button', 'Publish Now');
test.assertEval(function() {
return (__utils__.findOne('.js-publish-button').getAttribute('data-status') === 'published');
}, 'Publish button\'s updated status should be "published"');
}, function onTimeout() {
test.assert(false, 'Publish split button should have .splitbutton-delete');
});
// Publish the post
@ -215,12 +217,13 @@ CasperTest.begin('Publish menu - existing post', 24, function suite(test) {
casper.thenClick('.js-publish-splitbutton li[data-set-status="draft"]');
// ... check status, label, class
casper.then(function () {
test.assertExists('.js-publish-splitbutton.splitbutton-delete', 'Publish split button should have .splitbutton-delete');
casper.waitForSelector('.js-publish-splitbutton.splitbutton-delete', function onSuccess() {
test.assertExists('.js-publish-button.button-delete', 'Publish button should have .button-delete');
test.assertSelectorHasText('.js-publish-button', 'Unpublish');
test.assertEval(function() {
return (__utils__.findOne('.js-publish-button').getAttribute('data-status') === 'draft');
}, 'Publish button\'s updated status should be "draft"');
}, function onTimeout() {
test.assert(false, 'Publish split button should have .splitbutton-delete');
});
});

View File

@ -16,7 +16,6 @@ describe('Post API', function () {
});
beforeEach(function (done) {
this.timeout(5000);
testUtils.initData()
.then(function () {
return testUtils.insertDefaultFixtures();

View File

@ -22,7 +22,6 @@ describe("Exporter", function () {
});
beforeEach(function (done) {
this.timeout(5000);
testUtils.initData().then(function () {
done();
}, done);

View File

@ -22,7 +22,6 @@ describe("Ghost API", function () {
});
beforeEach(function (done) {
this.timeout(5000);
sandbox = sinon.sandbox.create();
testUtils.initData().then(function () {

View File

@ -43,8 +43,6 @@ describe("Import", function () {
});
describe("000", function () {
this.timeout(4000);
should.exist(Importer000);
it("imports data from 000", function (done) {

View File

@ -19,7 +19,6 @@ describe("Permission Model", function () {
});
beforeEach(function (done) {
this.timeout(5000);
testUtils.initData().then(function () {
done();
}, done);

View File

@ -20,7 +20,6 @@ describe('Post Model', function () {
});
beforeEach(function (done) {
this.timeout(5000);
testUtils.initData()
.then(function () {
return testUtils.insertDefaultFixtures();
@ -84,7 +83,6 @@ describe('Post Model', function () {
});
it('can findOne, returning author and user data', function (done) {
this.timeout(5000);
var firstPost;
PostModel.findOne({}).then(function (result) {
@ -186,8 +184,6 @@ describe('Post Model', function () {
markdown: 'Test Content 1'
};
this.timeout(5000); // this is a patch to ensure it doesn't timeout.
// Create 12 posts with the same title
sequence(_.times(12, function (i) {
return function () {
@ -322,8 +318,6 @@ describe('Post Model', function () {
});
it('can fetch a paginated set, with various options', function (done) {
this.timeout(10000); // this is a patch to ensure it doesn't timeout.
testUtils.insertMorePosts().then(function () {
return PostModel.findPage({page: 2});

View File

@ -19,7 +19,6 @@ describe("Role Model", function () {
});
beforeEach(function (done) {
this.timeout(5000);
testUtils.initData().then(function () {
done();
}, done);

View File

@ -18,7 +18,6 @@ describe('Settings Model', function () {
});
beforeEach(function (done) {
this.timeout(5000);
testUtils.initData().then(function () {
done();
}, done);

View File

@ -19,7 +19,6 @@ describe('Tag Model', function () {
});
beforeEach(function (done) {
this.timeout(5000);
testUtils.initData()
.then(function () {
done();

View File

@ -26,7 +26,6 @@ describe('User Model', function run() {
describe('Registration', function runRegistration() {
beforeEach(function (done) {
this.timeout(5000);
testUtils.initData().then(function () {
done();
}, done);
@ -49,7 +48,6 @@ describe('User Model', function run() {
describe('Basic Operations', function () {
beforeEach(function (done) {
this.timeout(5000);
testUtils.initData()
.then(function () {
return when(testUtils.insertDefaultUser());

View File

@ -23,7 +23,6 @@ describe('Permissions', function () {
});
beforeEach(function (done) {
this.timeout(5000);
testUtils.initData()
.then(testUtils.insertDefaultUser)
.then(function () {

View File

@ -22,7 +22,6 @@ describe('Plugins', function () {
});
beforeEach(function (done) {
this.timeout(5000);
sandbox = sinon.sandbox.create();
testUtils.initData().then(function () {