FIX: PhantomJS was crashing

This commit is contained in:
Robin Ward 2016-12-15 12:30:20 -05:00
parent 250ca11416
commit ba8c6fd840

View File

@ -139,7 +139,7 @@ var runTests = function() {
}); });
test("at least one topic shows up", function() { test("at least one topic shows up", function() {
return document.querySelector(".topic-list tbody tr"); return $(".topic-list tbody tr").length;
}); });
execAsync("navigate to 1st topic", 500, function() { execAsync("navigate to 1st topic", 500, function() {
@ -147,7 +147,7 @@ var runTests = function() {
}); });
test("at least one post body", function() { test("at least one post body", function() {
return document.querySelector(".topic-post"); return $(".topic-post").length;
}); });
execAsync("click on the 1st user", 500, function() { execAsync("click on the 1st user", 500, function() {
@ -157,7 +157,7 @@ var runTests = function() {
}); });
test("user has details", function() { test("user has details", function() {
return document.querySelector("#user-card .names"); return $("#user-card .names").length;
}); });
exec("open login modal", function() { exec("open login modal", function() {
@ -165,7 +165,7 @@ var runTests = function() {
}); });
test("login modal is open", function() { test("login modal is open", function() {
return document.querySelector(".login-modal"); return $(".login-modal").length;
}); });
exec("type in credentials & log in", function() { exec("type in credentials & log in", function() {
@ -175,7 +175,7 @@ var runTests = function() {
}); });
test("is logged in", function() { test("is logged in", function() {
return document.querySelector(".current-user"); return $(".current-user").length;
}); });
exec("go home", function() { exec("go home", function() {
@ -183,11 +183,11 @@ var runTests = function() {
}); });
test("it shows a topic list", function() { test("it shows a topic list", function() {
return document.querySelector(".topic-list"); return $(".topic-list").length;
}); });
test('we have a create topic button', function() { test('we have a create topic button', function() {
return document.querySelector("#create-topic"); return $("#create-topic").length;
}); });
exec("open composer", function() { exec("open composer", function() {
@ -195,7 +195,7 @@ var runTests = function() {
}); });
test('the editor is visible', function() { test('the editor is visible', function() {
return document.querySelector(".d-editor"); return $(".d-editor").length;
}); });
exec("compose new topic", function() { exec("compose new topic", function() {
@ -209,7 +209,7 @@ var runTests = function() {
}); });
test("updates preview", function() { test("updates preview", function() {
return document.querySelector(".d-editor-preview p"); return $(".d-editor-preview p").length;
}); });
exec("open upload modal", function() { exec("open upload modal", function() {
@ -217,7 +217,7 @@ var runTests = function() {
}); });
test("upload modal is open", function() { test("upload modal is open", function() {
return document.querySelector("#filename-input"); return $("#filename-input").length;
}); });
// TODO: Looks like PhantomJS 2.0.0 has a bug with `uploadFile` // TODO: Looks like PhantomJS 2.0.0 has a bug with `uploadFile`
@ -246,7 +246,7 @@ var runTests = function() {
}); });
test("topic is created", function() { test("topic is created", function() {
return document.querySelector(".fancy-title"); return $(".fancy-title").length;
}); });
exec("click reply button", function() { exec("click reply button", function() {
@ -254,7 +254,7 @@ var runTests = function() {
}); });
test("composer is open", function() { test("composer is open", function() {
return document.querySelector("#reply-control .d-editor-input"); return $("#reply-control .d-editor-input").length;
}); });
exec("compose reply", function() { exec("compose reply", function() {