Dear tiffany-I, a good question.
Most people just tend to see ''The Alchemist'' as a simple fable, where Santiago is the hero/protagonist and he has to grow and develop during the course of the novel, in order, utimately, to achieve his 'treasure' at the pyramids. If we also look at this novel just at this level, even then we can justify your question-statement: ''The Alchemist'' is a novel of 'progression' , of evolution, whereby the hero/protagonist has to cross or undergo several challenges and dangers and tests, each harder than the other/previous, in order to finally triumph. So, going through the bedouins' tribal wars and the chaos and confusion in te desert is also a test in a way-- and at the same time, also a technical device, a way of making the hero pass through the desert quickly and queitly whilst the bedouins are mostly engaged in fighting each other.
But this is only a basic level of understanding. At a deeper level, ''The Alchemist'' is a mystic work, a book or volume which contains mystic and 'spiritual lessons', and as such, it is also a work where we witness a mystical progression or evolution- in various mystical/spiritual systems around the world e.g Kabbalah, Sufism, Zen, Tao, Vedanta etc-- an 'apprentice' or 'learner' or 'seeker' has to embark on a 'quest' and in this quest there are several stages, each stage or level (rather like a video game!) representing or symbolising the achievement of yet another dimension of expertise and self-development, towards the achievement of the final/ultimate goal, or 'treasure'. So, by this standard, too, Santiago is 'tested' in his faith and commitment to the mystic path or way, by having to run the gamut of the bedouin tribal wars, in order to reach his destination i.e. the 'pyramids' (figuratively).
I hope this is helpful? Good luck!