"Navigation" testcase can be problematic #4936

newrachael opened this Issue Sep 4, 2012 · 1 comment

2 participants


I have a question about "Navigation" Testcase.
If page transition is set to "Fade", it operate asynchronously.

but navigation testcase checks the async function synchronously.

e.g. : last entry choosen amongst multiple identical url history stack entries on hash change test ->

-> page transition is set to flip or fade.
function(){ $("#dup-history-first a").click(); },
function(){ $("#dup-history-second a:first").click(); },
function(){ $("#dup-history-first a").click(); },
function(){ $("#dup-history-second a:last").click(); },
function(){ $("#dup-history-dialog a:contains('Close')").click(); },
-> same($.mobile.urlHistory.activeIndex, 3, "should be the fourth page in the stack"); // it can be problematic, I think.


The sequence of functions in that test is evaluated asynchronously, because we're using $.testHelper.pageSequence, which basically operates like this:

Evaluate function 1 and wait for pagechange
Evaluate function 2 and wait for pagechange
Evaluate function 3 and wait for pagechange

So, the evaluation is asynchronous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment