mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Merge pull request #1559 from sebgie/failing-tests
Fix failing casper tests
This commit is contained in:
commit
71ddd73a00
2 changed files with 11 additions and 10 deletions
|
@ -67,7 +67,7 @@ CasperTest.begin('Infinite scrolling', 1, function suite(test) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
CasperTest.begin("Posts can be marked as featured", 4, function suite(test) {
|
CasperTest.begin("Posts can be marked as featured", 6, function suite(test) {
|
||||||
// Create a sample post
|
// Create a sample post
|
||||||
casper.thenOpen(url + 'ghost/editor/', function testTitleAndUrl() {
|
casper.thenOpen(url + 'ghost/editor/', function testTitleAndUrl() {
|
||||||
test.assertTitle('Ghost Admin', 'Ghost admin has no title');
|
test.assertTitle('Ghost Admin', 'Ghost admin has no title');
|
||||||
|
@ -80,8 +80,9 @@ CasperTest.begin("Posts can be marked as featured", 4, function suite(test) {
|
||||||
|
|
||||||
casper.thenClick('.js-publish-button');
|
casper.thenClick('.js-publish-button');
|
||||||
|
|
||||||
casper.waitForResource(/posts/, function checkPostWasCreated() {
|
casper.waitForSelector('.notification-success', function () {
|
||||||
test.assertExists('.notification-success', 'got success notification');
|
test.assert(true, 'got success notification');
|
||||||
|
test.assertSelectorHasText('.notification-success', 'Your post has been saved as a draft.');
|
||||||
});
|
});
|
||||||
|
|
||||||
// Begin test
|
// Begin test
|
||||||
|
@ -99,7 +100,8 @@ CasperTest.begin("Posts can be marked as featured", 4, function suite(test) {
|
||||||
this.click('.featured');
|
this.click('.featured');
|
||||||
});
|
});
|
||||||
|
|
||||||
casper.waitForResource(/posts/, function checkPostWasMarkedAsFeatured() {
|
casper.waitForSelector('.notification-success', function () {
|
||||||
test.assertExists('.notification-success', 'got success notification');
|
test.assert(true, 'got success notification');
|
||||||
|
test.assertSelectorHasText('.notification-success', 'Post successfully marked as featured.');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -45,7 +45,7 @@ CasperTest.begin('Redirects login to signin', 2, function suite(test) {
|
||||||
});
|
});
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
CasperTest.begin("Can't spam it", 4, function suite(test) {
|
CasperTest.begin("Can't spam it", 3, function suite(test) {
|
||||||
casper.thenOpen(url + "ghost/signin/", function testTitle() {
|
casper.thenOpen(url + "ghost/signin/", function testTitle() {
|
||||||
test.assertTitle("Ghost Admin", "Ghost admin has no title");
|
test.assertTitle("Ghost Admin", "Ghost admin has no title");
|
||||||
});
|
});
|
||||||
|
@ -62,17 +62,16 @@ CasperTest.begin("Can't spam it", 4, function suite(test) {
|
||||||
this.fill("#login", falseUser, true);
|
this.fill("#login", falseUser, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
casper.waitForSelector('.notification-error', function onSuccess() {
|
casper.waitForText('Slow down, there are way too many login attempts!', function onSuccess() {
|
||||||
test.assert(true, 'Save without title results in error notification as expected');
|
test.assert(true, 'Spamming the login did result in an error notification');
|
||||||
test.assertSelectorDoesntHaveText('.notification-error', '[object Object]');
|
test.assertSelectorDoesntHaveText('.notification-error', '[object Object]');
|
||||||
test.assertSelectorHasText('.notification-error', 'Slow down, there are way too many login attempts!');
|
|
||||||
}, function onTimeout() {
|
}, function onTimeout() {
|
||||||
test.assert(false, 'Spamming the login did not result in an error notification');
|
test.assert(false, 'Spamming the login did not result in an error notification');
|
||||||
});
|
});
|
||||||
|
|
||||||
// This test causes the spam notification
|
// This test causes the spam notification
|
||||||
// add a wait to ensure future tests don't get tripped up by this.
|
// add a wait to ensure future tests don't get tripped up by this.
|
||||||
casper.wait(1000);
|
casper.wait(2000);
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
CasperTest.begin("Can login to Ghost", 4, function suite(test) {
|
CasperTest.begin("Can login to Ghost", 4, function suite(test) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue