Merge pull request #4314 from sebgie/test

Test improvements
This commit is contained in:
Jason Williams 2014-10-20 15:29:28 -05:00
commit e3abfd9955
2 changed files with 15 additions and 22 deletions

View File

@ -109,7 +109,7 @@ CasperTest.begin('Content list shows correct post status', 5, function testStati
// });
// });
CasperTest.begin('Posts can be marked as featured', 8, function suite(test) {
CasperTest.begin('Posts can be marked as featured', 6, function suite(test) {
// Create a sample post
CasperTest.Routines.createTestPost.run(false);
@ -140,14 +140,9 @@ CasperTest.begin('Posts can be marked as featured', 8, function suite(test) {
// Mark as not featured
casper.thenClick('.content-preview .featured');
casper.waitForResource(/\/posts\/\d+\/\?include=tags/, function waitForSuccess(resource) {
test.assert(resource.status < 400);
});
casper.then(function untoggledFeaturedTest() {
test.assertDoesntExist('.content-preview .featured', 'Untoggled featured.');
casper.waitWhileSelector('.content-preview .featured', function onSuccess() {
test.assertDoesntExist('.content-list-content li.featured:first-of-type');
}, function onTimeout() {
test.assert(false, 'Couldn\'t unfeature post.');
});
casper.test.fail('Couldn\'t unfeature post.');
}, 2000);
});

View File

@ -117,7 +117,7 @@ CasperTest.begin('Post published date can be changed', 4, function suite(test) {
});
});
CasperTest.begin('Post can be changed to static page', 6, function suite(test) {
CasperTest.begin('Post can be changed to static page', 2, function suite(test) {
// Create a sample post
CasperTest.Routines.createTestPost.run(false);
@ -135,19 +135,17 @@ CasperTest.begin('Post can be changed to static page', 6, function suite(test) {
casper.thenClick('label[for=static-page]');
casper.waitForResource(/\/posts\/\d+\/\?include=tags/, function waitForSuccess(resource) {
test.assert(resource.status < 400);
casper.waitForSelector('.post-setting-static-page:checked', function onSuccess() {
casper.click('label[for=static-page]');
}, function onTimeout() {
casper.test.fail('Post was not changed to static page.');
}, 2000);
test.assertExists('.post-setting-static-page:checked', 'can turn on static page');
});
casper.thenClick('label[for=static-page]');
casper.waitForResource(/\/posts\/\d+\/\?include=tags/, function waitForSuccess(resource) {
test.assert(resource.status < 400);
test.assertDoesntExist('.post-setting-static-page:checked', 'can turn off static page');
});
casper.waitForSelector('.post-setting-static-page:not(checked)', function onSuccess() {
return;
}, function onTimeout() {
casper.test.fail('Static page was not changed to post.');
}, 2000);
});
CasperTest.begin('Post url input is reset from all whitespace back to original value', 3, function suite(test) {