add delay and trivial 200 code check
This commit is contained in:
parent
012941ea62
commit
97ceea8878
|
@ -6,7 +6,17 @@ task "smoke:test" => :environment do
|
||||||
phantom_path = phantom_path || 'phantomjs'
|
phantom_path = phantom_path || 'phantomjs'
|
||||||
|
|
||||||
url = ENV["URL"] || Discourse.base_url
|
url = ENV["URL"] || Discourse.base_url
|
||||||
|
|
||||||
puts "Testing: #{url}"
|
puts "Testing: #{url}"
|
||||||
|
|
||||||
|
require 'open-uri'
|
||||||
|
require 'net/http'
|
||||||
|
|
||||||
|
res = Net::HTTP.get_response(URI.parse(url))
|
||||||
|
if res.code != "200"
|
||||||
|
raise "TRIVIAL GET FAILED WITH #{res.code}"
|
||||||
|
end
|
||||||
|
|
||||||
results = `#{phantom_path} #{Rails.root}/spec/phantom_js/smoke_test.js #{url}`
|
results = `#{phantom_path} #{Rails.root}/spec/phantom_js/smoke_test.js #{url}`
|
||||||
|
|
||||||
puts results
|
puts results
|
||||||
|
|
|
@ -98,9 +98,9 @@ page.runTests = function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
navigate("navigate to first topic", function(){
|
navigate("navigate to first topic", function(){
|
||||||
Em.run.next(function(){
|
Em.run.later(function(){
|
||||||
$('.main-link a:first').click();
|
$('.main-link a:first').click();
|
||||||
});
|
}, 500);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("at least one post body", function(){
|
test("at least one post body", function(){
|
||||||
|
@ -108,9 +108,11 @@ page.runTests = function(){
|
||||||
});
|
});
|
||||||
|
|
||||||
navigate("navigate to first user", function(){
|
navigate("navigate to first user", function(){
|
||||||
Em.run.next(function(){
|
// for whatever reason the clicks do not respond at the begining
|
||||||
|
// defering
|
||||||
|
Em.run.later(function(){
|
||||||
$('.topic-meta-data a:first').focus().click();
|
$('.topic-meta-data a:first').focus().click();
|
||||||
});
|
},500);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("has about me section",function(){
|
test("has about me section",function(){
|
||||||
|
|
Loading…
Reference in New Issue