The bill, backed by opposition lawmakers and Conservative rebels, compels Johnson to ask the EU to postpone Brexit if no divorce agreement is in place by Oct. 19.
It passed the House of Commons earlier this week and is expected to become law in the next few days, following approval from the monarch.
Johnson has been arguing in Parliament this week that the U.K. must leave the EU even if there is no deal.
Johnson became prime minister in July after promising Conservatives that he would complete Brexit and break the impasse that has paralyzed Britain's politics since voters decided in June 2016 to leave the bloc and which brought down his predecessor, Theresa May.
The Associated Press contributed to this report.