* fix reconnect and limit bands 3 test

This commit is contained in:
Seth Call 2014-05-29 20:58:40 -05:00
parent 6ad607cd24
commit 7d246ef817
5 changed files with 26 additions and 6 deletions

View File

@ -34,6 +34,7 @@
var $currentScore = null;
var $scoredClients = null;
var $subscore = null;
var backendGuardTimeout = null;
var serverClientId = '';
var isScoring = false;
@ -113,6 +114,10 @@
context.JK.alertSupportedNeeded("JamKazam is experiencing technical difficulties.");
renderStopTest('', '');
}
else if(reason == 'backend_gone') {
context.JK.alertSupportedNeeded("The JamKazam client is experiencing technical difficulties.");
renderStopTest('', '');
}
else if(reason == "invalid_response") {
context.JK.alertSupportedNeeded("The JamKazam client software had an unexpected problem while scoring your Internet connection. Reason=" + attempt.backend_data.reason + '.');
renderStopTest('', '');
@ -151,6 +156,11 @@
return testSummary.attempts[testSummary.attempts.length - 1];
}
function backendTimedOut() {
testSummary.final = {reason: 'backend_gone'}
testFinished();
}
function attemptTestPass() {
@ -170,6 +180,8 @@
updateProgress(0, false);
backendGuardTimeout = setTimeout(function(){backendTimedOut()}, 10000);
context.jamClient.TestNetworkPktBwRate(serverClientId, TEST_SUCCESS_CALLBACK, TEST_TIMEOUT_CALLBACK,
NETWORK_TEST_TYPES.PktTest400LowLatency,
gon.ftue_network_test_duration,
@ -410,6 +422,10 @@
reset();
}
function afterHide() {
}
function initialize(_$step) {
$step = _$step;
@ -427,6 +443,7 @@
}
this.newSession = newSession;
this.afterHide = afterHide;
this.beforeShow = beforeShow;
this.initialize = initialize;

View File

@ -1056,7 +1056,8 @@
clearOutputPorts();
resetFrameBuffers();
}
function beforeHide() {
function afterHide() {
logger.debug("unregistering focus watch")
$(window).off('focus', onFocus);
}
@ -1098,7 +1099,7 @@
this.handleNext = handleNext;
this.beforeShow = beforeShow;
this.beforeHide = beforeHide;
this.afterHide = afterHide;
this.initialize = initialize;
self = this;

View File

@ -201,11 +201,13 @@
}
function renderNotConnected() {
console.log("RENDER NOT CONNECTED!!!!!!!!!")
$interactionBlocker.addClass('active');
$disconnectedMsg.addClass('active');
}
function renderConnected() {
console.log("RENDER CONNECTED!!!!!!!!!")
$interactionBlocker.removeClass('active');
$disconnectedMsg.removeClass('active');
}

View File

@ -253,7 +253,7 @@
}
JK.app = JK.JamKazam();
var jamServer = new JK.JamServer(JK.app, function(event_type) {});
var jamServer = new JK.JamServer(JK.app, function(event_type) {JK.app.activeElementEvent(event_type)});
jamServer.initialize();
JK.initJamClient();

View File

@ -88,15 +88,15 @@ describe "Bands", :js => true, :type => :feature, :capybara_feature => true do
end
it "limits genres to 3" do
genres = Genre.limit(4)
navigate_band_setup
within('#band-setup-form') do
fill_in 'band-name', with: "whatever"
fill_in 'band-biography', with: "a good story"
all('#band-genres input[type="checkbox"]').each_with_index do |cb, i|
cb.trigger(:click) unless i > 3
genres.each do |genre|
find("#band-genres input[value='#{genre.id}']").trigger(:click)
end
end
sleep 1
find('#btn-band-setup-next').trigger(:click)
expect(page).to have_selector('#tdBandGenres .error-text li', text: "No more than 3 genres are allowed.")
end