This might not be the best place to ask this question, since I don't see much on nonparametric statistics here, but let me try :

I am considering the standard test for randomness based on runs([Wald–Wolfowitz runs test][1]). In it, you basically take a sequence of 1's and 2's, having length $n$, $n_1$ 1's, $n_2$ 2's  and you want to test:  

$H_{0}:$ there is no trend (i.e. each element in the sequence is independently drawn from the same distribution)

To test $H_{0}$, you use test statistic:

TS = total number of runs of 1's and 2's;

----------------------------------------------
Example:  $n=12$, $n_{1} =6$ , $n_{2} = 6$.
    
Sequence: 1 2 2 1 1 1 2 1 1 2 2 2

number of Runs - R= 6,  $\mathbb{P}(R\geq 6)$ = 0.392 , so we do not reject $H_{0}$. The sequence seems to be random.

However, this test does not "catch" seasonal patterns. For example, when I have sequence: 1 1 2 2 1 1 2 2 1 1 2 2 , the test will give the same result(I have the same number of runs, R=6) and the null hypothesis won't be rejected, eventhough an obvious pattern exists.

Do you know about a modifications of this test based on runs, which can "catch" such cyclic patterns? I know that some tests for seasonality exist, but what I want is variation of Wald–Wolfowitz.




  [1]: https://en.wikipedia.org/wiki/Wald%E2%80%93Wolfowitz_runs_test