Hamas was never supposed to launch such attack on Israel, to be honest. Did they believe it would end up well for them and the people in the Gaza strip? If they thought so, then they are simply idiots. Specially since they aimed at civilians, they exchanged the future and the life of thousands of innocent people in order to brag for a successful and short attack in Israel territory.
To me, whoever was in charge of this attack had no sense of strategy or military actions in the long term. Unless Hamas expected Israel to get scared and surrender that attacked territory to Hamas? It would be pretty foolish to even consider that was a possibily... They have the support of USA...