diff --git a/core/test/functional/base.js b/core/test/functional/base.js index 1ae99bfbad..fdf930f23c 100644 --- a/core/test/functional/base.js +++ b/core/test/functional/base.js @@ -469,8 +469,9 @@ CasperTest.Routines = (function () { casper.thenOpenAndWaitForPageLoad('editor', function createTestPost() { casper.sendKeys('#entry-title', testPost.title); casper.writeContentToEditor(testPost.html); - casper.sendKeys('#entry-tags input.tag-input', 'TestTag'); - casper.sendKeys('#entry-tags input.tag-input', casper.page.event.key.Enter); + // TODO move these into psm tests when tags have been added there + // casper.sendKeys('#entry-tags input.tag-input', 'TestTag'); + // casper.sendKeys('#entry-tags input.tag-input', casper.page.event.key.Enter); }); casper.waitForSelectorTextChange('.entry-preview .rendered-markdown'); diff --git a/core/test/functional/client/content_test.js b/core/test/functional/client/content_test.js index 74292327d0..5cddcea53c 100644 --- a/core/test/functional/client/content_test.js +++ b/core/test/functional/client/content_test.js @@ -1,9 +1,9 @@ // # Content Test // Test the content screen, uses the editor to create dummy content -/*globals CasperTest, casper, testPost, newUser */ +/*globals CasperTest, casper, testPost */ -CasperTest.begin('Content screen is correct', 17, function suite(test) { +CasperTest.begin('Content screen is correct', 15, function suite(test) { // First, create a sample post for testing (this should probably be a routine) CasperTest.Routines.createTestPost.run(false); @@ -29,12 +29,6 @@ CasperTest.begin('Content screen is correct', 17, function suite(test) { '.content-list-content li:first-of-type .entry-meta .status .draft', 'Draft', 'correct status is present' ); test.assertExists('.content-preview', 'Content preview is present'); - test.assertSelectorHasText( - '.content-preview header .status', 'Written', 'preview header contains "Written" when post is a draft' - ); - test.assertSelectorHasText( - '.content-preview header .author', newUser.name, 'preview header contains author name' - ); }); casper.then(function testEditPostButton() { @@ -52,7 +46,7 @@ CasperTest.begin('Content screen is correct', 17, function suite(test) { }); }); -CasperTest.begin('Content list shows correct post status', 5, function testStaticPageStatus(test) { +CasperTest.begin('Content list shows correct post status', 3, function testStaticPageStatus(test) { CasperTest.Routines.createTestPost.run(true); // Begin test @@ -70,16 +64,6 @@ CasperTest.begin('Content list shows correct post status', 5, function testStati 'status is present and labeled as published'); }); - // Test for 'Published' in header - casper.then(function testHeader() { - test.assertSelectorHasText( - '.content-preview header .status', 'Published', 'preview header contains "Published" when post is published' - ); - test.assertSelectorHasText( - '.content-preview header .author', newUser.name, 'preview header contains author name' - ); - }); - casper.thenClick('.post-edit'); casper.waitForSelector('#entry-title'); @@ -108,41 +92,3 @@ CasperTest.begin('Content list shows correct post status', 5, function testStati // test.assertUrlMatch(/ghost\/\d+\/$/, 'Landed on the correct URL'); // }); // }); - -CasperTest.begin('Posts can be marked as featured', 6, function suite(test) { - // Create a sample post - CasperTest.Routines.createTestPost.run(false); - - // Begin test - casper.thenOpenAndWaitForPageLoad('content', function testTitleAndUrl() { - test.assertTitle('Content - Test Blog', 'Title is "Content - Test Blog"'); - test.assertUrlMatch(/ghost\/\d+\/$/, 'Landed on the correct URL'); - }); - - // Mark as featured - casper.waitForSelector('.content-preview .unfeatured', function () { - this.click('.content-preview .unfeatured'); - }, function onTimeOut() { - test.assert(false, 'The first post can\'t be marked as featured'); - }); - - casper.waitForResource(/\/posts\/\d+\/\?include=tags/, function (resource) { - test.assert(resource.status < 400, 'resource.status < 400'); - }); - - casper.waitForSelector('.content-list-content li.featured:first-of-type', function () { - test.assertExists('.content-preview .featured', 'preview pane gets featured class'); - test.assertExists('.content-list-content li.featured:first-of-type', 'content list got a featured star'); - }, function onTimeout() { - test.assert(false, 'No featured star appeared in the left pane'); - }); - - // Mark as not featured - casper.thenClick('.content-preview .featured'); - - casper.waitWhileSelector('.content-preview .featured', function onSuccess() { - test.assertDoesntExist('.content-list-content li.featured:first-of-type', '.content-list-content li.featured:first-of-type does not exist'); - }, function onTimeout() { - casper.test.fail('Couldn\'t unfeature post.'); - }, 2000); -}); diff --git a/core/test/functional/client/editor_test.js b/core/test/functional/client/editor_test.js index 6633c65f15..09c5d6badb 100644 --- a/core/test/functional/client/editor_test.js +++ b/core/test/functional/client/editor_test.js @@ -249,40 +249,6 @@ CasperTest.begin('Image Uploads', 23, function suite(test) { // }, casper.failOnTimeout(test, 'Editor did not load')); }); -CasperTest.begin('Tag editor', 7, function suite(test) { - casper.thenOpenAndWaitForPageLoad('editor', function testTitleAndUrl() { - test.assertTitle('Editor - Test Blog', 'Ghost admin has incorrect title'); - test.assertUrlMatch(/ghost\/editor\/$/, 'Landed on the correct URL'); - }); - - var tagName = 'someTagName', - createdTagSelector = '#entry-tags .tags .tag'; - - casper.then(function () { - test.assertExists('#entry-tags', 'should have tag label area'); - test.assertExists('#entry-tags .tag-label', 'should have tag label icon'); - test.assertExists('#entry-tags input.tag-input', 'should have tag input area'); - }); - - casper.thenClick('#entry-tags input.tag-input'); - casper.then(function () { - casper.sendKeys('#entry-tags input.tag-input', tagName, {keepFocus: true}); - }); - casper.then(function () { - casper.sendKeys('#entry-tags input.tag-input', casper.page.event.key.Enter); - }); - - casper.waitForSelector(createdTagSelector, function onSuccess() { - test.assertSelectorHasText(createdTagSelector, tagName, 'typing enter after tag name should create tag'); - }); - - casper.thenClick(createdTagSelector); - - casper.waitWhileSelector(createdTagSelector, function onSuccess() { - test.assert(true, 'clicking the tag should delete the tag'); - }); -}); - CasperTest.begin('Publish menu - new post', 10, function suite(test) { casper.thenOpenAndWaitForPageLoad('editor', function testTitleAndUrl() { test.assertTitle('Editor - Test Blog', 'Ghost admin has incorrect title'); diff --git a/core/test/functional/client/psm_test.js b/core/test/functional/client/psm_test.js index a5a8396090..c77db3cb5a 100644 --- a/core/test/functional/client/psm_test.js +++ b/core/test/functional/client/psm_test.js @@ -190,3 +190,37 @@ CasperTest.begin('Post url input is reset from all whitespace back to original v test.assertEquals(slugVal, originalSlug, 'slug gets reset to original value'); }); }); +// TODO this test is from editor_test and needs to come back in some form when tags are moved into PSM +// CasperTest.begin('Tag editor', 7, function suite(test) { +// casper.thenOpenAndWaitForPageLoad('editor', function testTitleAndUrl() { +// test.assertTitle('Editor - Test Blog', 'Ghost admin has incorrect title'); +// test.assertUrlMatch(/ghost\/editor\/$/, 'Landed on the correct URL'); +// }); +// +// var tagName = 'someTagName', +// createdTagSelector = '#entry-tags .tags .tag'; +// +// casper.then(function () { +// test.assertExists('#entry-tags', 'should have tag label area'); +// test.assertExists('#entry-tags .tag-label', 'should have tag label icon'); +// test.assertExists('#entry-tags input.tag-input', 'should have tag input area'); +// }); +// +// casper.thenClick('#entry-tags input.tag-input'); +// casper.then(function () { +// casper.sendKeys('#entry-tags input.tag-input', tagName, {keepFocus: true}); +// }); +// casper.then(function () { +// casper.sendKeys('#entry-tags input.tag-input', casper.page.event.key.Enter); +// }); +// +// casper.waitForSelector(createdTagSelector, function onSuccess() { +// test.assertSelectorHasText(createdTagSelector, tagName, 'typing enter after tag name should create tag'); +// }); +// +// casper.thenClick(createdTagSelector); +// +// casper.waitWhileSelector(createdTagSelector, function onSuccess() { +// test.assert(true, 'clicking the tag should delete the tag'); +// }); +// });