From ba8c6fd8401376966c1851414009fc982435da9f Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 15 Dec 2016 12:30:20 -0500 Subject: [PATCH] FIX: PhantomJS was crashing --- spec/phantom_js/smoke_test.js | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/spec/phantom_js/smoke_test.js b/spec/phantom_js/smoke_test.js index f703257fa82..6cac5534f5c 100644 --- a/spec/phantom_js/smoke_test.js +++ b/spec/phantom_js/smoke_test.js @@ -139,7 +139,7 @@ var runTests = 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() { @@ -147,7 +147,7 @@ var runTests = 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() { @@ -157,7 +157,7 @@ var runTests = function() { }); test("user has details", function() { - return document.querySelector("#user-card .names"); + return $("#user-card .names").length; }); exec("open login modal", function() { @@ -165,7 +165,7 @@ var runTests = function() { }); test("login modal is open", function() { - return document.querySelector(".login-modal"); + return $(".login-modal").length; }); exec("type in credentials & log in", function() { @@ -175,7 +175,7 @@ var runTests = function() { }); test("is logged in", function() { - return document.querySelector(".current-user"); + return $(".current-user").length; }); exec("go home", function() { @@ -183,11 +183,11 @@ var runTests = 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() { - return document.querySelector("#create-topic"); + return $("#create-topic").length; }); exec("open composer", function() { @@ -195,7 +195,7 @@ var runTests = function() { }); test('the editor is visible', function() { - return document.querySelector(".d-editor"); + return $(".d-editor").length; }); exec("compose new topic", function() { @@ -209,7 +209,7 @@ var runTests = function() { }); test("updates preview", function() { - return document.querySelector(".d-editor-preview p"); + return $(".d-editor-preview p").length; }); exec("open upload modal", function() { @@ -217,7 +217,7 @@ var runTests = 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` @@ -246,7 +246,7 @@ var runTests = function() { }); test("topic is created", function() { - return document.querySelector(".fancy-title"); + return $(".fancy-title").length; }); exec("click reply button", function() { @@ -254,7 +254,7 @@ var runTests = 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() {