While it certainly helped the Germans practice the ways of modern war while suffering rather light casualties, I wouldn't say they got involved purely to test their weapons.
Nazi Germany was rather fiercely anticommunist, even though they obviously cooperated with the Soviets at certain times. This was for more pragmatic reasons, but both sides certainly knew that they weren't friends.
Anyway, the Spanish Civil war was being fought by the Fascists vs the Republicans, which had many communist leanings. A victory for the Fascists would certainly help create a more sympathetic government to other Fascists in Europe. Let's be clear - the Germans did have a stake in the outcome of the war.
I wouldn't say countries really got involved just to practice, but besides Germany the Spanish Civil War featured large Soviet support for the Republican side, although this was often tied to political means. For the Soviets at least they tried to dominate the Republican side and in the case of victory create another sympathetic Communist state. Italy sided with the Fascists for similar reasons as Germany.
The German military gained lots of experience, but they were clearly "in it to win it" as you can read many letters and diary entries of von Richtoffen (Luftwaffe honcho in Spain) complaining about how the Spanish are terrible at strategy and he could win the war in X weeks or whatever if only they'd listen.
In the end of course the Fascists won, and it did create a sympathetic government in WW2 to the Axis. Although Spain remained neutral they were very much pushing the envelope on "neutral". Spain allowed German U-boats to take in supplies in their territory and even sent almost 50,000 men to fight alongside the Germans against the Soviets after Germany invaded. They also helped with intelligence work and were even in negotiations with Hitler to join the war by invading Gibraltar, but the talks broke down as Franco wanted too many guarantees of supplies and support from Hitler. Besides all that, Spain was rather exhausted and ruined by its own war and were not eager to jump straight into WW2.
Source: https://books.google.com.vn/books/about/The_Battle_for_Spain.html?id=VsGtxYCcE2MC&redir_esc=y