0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Adjust about page tests

No Issue
- Wait for list item element to appear before starting tests
  to make sure template partial has been rendered.
- Remove test for 20 list items as it's possible that there
  could be fewer than 20 contributors for during the window.
  Instead just test to make sure the list has at least one item.
This commit is contained in:
Jason Williams 2014-12-25 17:35:11 +00:00
parent ddaf19c5c5
commit 730e7ebcfa

View file

@ -3,7 +3,7 @@
/*globals CasperTest, casper */
CasperTest.begin('About screen is correct', 10, function suite(test) {
CasperTest.begin('About screen is correct', 9, function suite(test) {
casper.thenOpenAndWaitForPageLoad('settings.about', function testTitleAndUrl() {
test.assertTitle('Settings - About - Test Blog', 'Ghost admin has incorrect title');
test.assertUrlMatch(/ghost\/settings\/about\/$/, 'Landed on the correct URL');
@ -19,11 +19,9 @@ CasperTest.begin('About screen is correct', 10, function suite(test) {
test.assertMatch(databaseTypeText, /sqlite3|mysql|pg/gi, 'Database is an allowed type');
});
casper.then(function testContributors() {
casper.waitForSelector('.top-contributors li', function testContributors() {
var firstContribImageSrc = casper.getElementAttribute('.top-contributors li:nth-child(1) a img', 'src');
test.assertElementCount('.top-contributors li', 20, '20 contributors are shown');
// Check first contributor image tag is on the page
test.assertExist('.top-contributors li:nth-child(1) img', 'First contributor image is in place');