For Italian Fascism (and probably even more for German National Socialism - but I'll leave that one to someone who can possibly provide a more detailed overview) WW2 was not an accident on their way. Both regimes were aware that an European conflict - and likely a general European conflict - was a likely consequence of their political choices; at least since the conclusion of the Sudeten crisis of 1938.
In October 1938, the German Foreign Ministry von Ribbentrop had visited Rome and met with Mussolini - the Italian Foreign Ministry Galeazzo Ciano had noted in his personal records how:
The Duce agrees that there will be war within a few year between the Axis and France and Great Britain. That's a natural part of historical dynamism. An insanable fracture between the two worlds has taken place.
While the Italian attitude oscillated during the months building up to the conflict - including a few misgivings about the German conduct in the Czech crisis of 1939, this general groundwork remined more or less a constant: the Italians appeared more concerned with the perspective of delaying the general conflict, or limiting the immediate consequences of a German military action to a local conflict, only to meet with the unavoidable eventual escalation when Italy had fully prepared.
In parallel, much of the Italo-German relations focused on how to ensure the respect of the respective spheres of influence (for Italy, for instance, the Adriatic ut to the old region of Croatia) in light of the possible future expansion - an expansion that was taken as inevitable.
On April 16^th 1939, Mussolini had met with Göring and agreed with him that "a general war was inevitable". Italy had to prepare.
Italy hoped that Germany would "refrain from any gesture that would cause an acceleration of this process" - meanwhile though (as noted by the German Ministry) the motto of the two countries was going to be "talk of peace and prepare for war".
And this same quote appeared in Mussolini's memorandum to Ciano of May 4^th - where he explained that Italy needed a period of preparation of "at least three years" to be fully ready for war. And listed a series of arguments in favor of what in his mind was a cautious policy to prevent escalation:
Italy does not desire to anticipate a European war, despite being convinced that it is inevitable.
In light of this, the preparations included:
the military sistemation of Libya
renovation of artillery
autarchy, to prevent the effect of an Allied blockade
to recall the Italians resident in France
acquire values reserves
transfer military industries to southern Italy
As you can see, most of the immediate provisions and plans of the Regime - as well as many others more general, like the development of autarchy policies and the increasing attention towards heavy industry - relate to a general perspective of upcoming conflict.
This idea that war was going to happen; and that the development of the Italo-German relations, and more so of the Italian and German growth in face of the supposed French and British weakness, were going to produce it almost organically, was a core element of the Fascist policy in the late 1930s.
Not that everybody agreed on this matter; but broadly speaking, Italy did not foresee general plans which not involved war.