Hamas dominated recent parliamentary elections , and the naming of Ismail Haniyeh as prime minister is a formality .