LONDON — With only months to go until Britain leaves the European Union, Prime Minister Theresa May faces a showdown with critics that could further undermine her fragile grip on power ahead of crucial negotiations.

The House of Commons will vote on Tuesday on legislation underpinning Brexit — a crucial test of May's ability to end a deadlock that has exasperated voters and business leaders.

It has been almost two years since Britain voted unexpectedly, and by a narrow margin, to quit the 28-nation bloc.

Yet with 292 days to go as of Sunday until its membership ends, nothing has been agreed on in terms of what future relations between the U.K. and Europe will look like.

Not even May’s own ministers can agree on fundamental issues such as how new customs and border checks would operate, or whether they should exist at all.

The political crisis became so deep on Thursday that the minister tasked with delivering Brexit threatened to quit, while the foreign secretary openly criticized the government’s lack of progress.

If President Donald Trump was in charge of Brexit, Boris Johnson said admiringly in a leaked recording, “you might get somewhere.”

Even supporters of Brexit are rattled, fearing concessions that could keep Britain in a de facto customs union but without any political influence.

Indeed, the only buttress supporting May’s minority Conservative government is that polls suggest wearied voters oppose yet another general election and would in any case be unlikely to elect a different Parliament than they did 12 months ago.

Anna Soubry, a former minister and a prominent anti-Brexit dissenter in May’s party, on Wednesday said the crisis was of “a proportion and scale we’ve never seen before.”

“Brexit has been a steep learning curve for all involved,” said Tim Oliver, director of research at Brexit Analytics and an associate at the London School of Economics think-thank IDEAS. “British politicians especially were caught unprepared. Even pro-Brexit ones had little grasp of the scale of what they’d taken on.”

He added: “Britain wants to quickly leave the E.U. but retain for the long-term the links it likes. That’s not how any club works.”

What happens this week?

Britain’s unelected upper chamber of Parliament, the House of Lords, has infuriated the government by making 15 separate changes to a key piece of Brexit legislation despite ministers’ efforts to block them.

The E.U. withdrawal bill will repeal the legislation underpinning the UK's existing relationship with Europe and lay the groundwork for what Brexit could look like. It has thus become the battleground for debate over core issues such as whether Britain should completely leave the E.U.’s single market, which guarantees free movement of goods and people, and the customs union.

Many anti-Brexit rebels in May’s party want Britain to remain in the customs union even after it leaves the E.U., in order to avoid checks at Britain’s borders that they fear would bring chaos to essential imports such as food.

The government will ask lawmakers in the directly elected House of Commons to overturn some of the changes proposed by the unelected Lords — changes intended to guide the U.K. toward a so-called 'softer' Brexit — during a potentially dramatic debate on Tuesday that is expected to run on into Wednesday.

“I would hope that everybody across the House of Commons will see the importance of ensuring that that bill is not frustrated,” May told reporters at a news conference in Canada on Saturday, where she was attending the G-7 summit.

What’s the problem with border controls?

Reintroducing immigration and customs controls between the U.K. and its E.U. neighbors would be problematic because the only land border between the two, with the Irish Republic, is kept open under the terms of a 1998 peace agreement that ended decades of deadly sectarian conflict in U.K.-administered Northern Ireland.

The Irish government, and a majority of people in Northern Ireland, say any return of border controls would invalidate the peace agreement and could lead to a return to violence.

Again, no permanent solution has been agreed upon; May’s government has proposed various compromises, including an open border patrolled using technology including drones, or even a 10-mile buffer zone either side of the border that would allow local residents and traders to cross without checks.

None of the compromises appear acceptable to all sides.

The director-general of the Northern Ireland Chamber of Commerce said the buffer zone idea was “bonkers” and “has no substance in terms of being able to deliver practicable solutions.”

Irish Times columnist Kathy Sheridan said Thursday that Britain’s Brexit debate was “basically a stupid mongrel, feverishly eating its own tail.”

The view from County Fermanagh, Northern Ireland into County Donegal in the Irish Republic. The border, marked by small pillars, splits the small village of Pettigo in two. Paul McErlane / EPA

Uncontested border checks could also prove problematic. Britain’s truckers warned last week that stores could face food shortages and empty shelves within days of Brexit if full checks were reintroduced on the E.U. side, which the bloc has not ruled out.

Even pro-Brexit lawmakers now agree long lines are a real possibility at British ports such as Dover, which last year saw 2.7 million trucks cross the English Channel to France. Former Home Secretary and Conservative Party leader Iain Duncan Smith told the BBC on Wednesday the government “should anyway plan for delays,” including the possibility of using a stretch of a major highway as a truck parking lot.

James Hookham, the deputy chief executive of the Freight Transport Association, accused the government of “playing chicken” with the E.U. as Brexit deadlines loom.

“The industry’s frustration with the lack of progress is building daily,” he said. “Logistics businesses simply cannot answer their customers’ questions about how they will move goods after Brexit. Manufacturers and retailers are losing faith.”

He said that of eight demands made to the government at the beginning of the year, “not a single one has been progressed.”

In a final attempt to break the deadlock, May has proposed a back-stop transition arrangement that keeps the whole of the U.K. in the customs union until a longer-term deal can be hammered out. But lawmakers have argued over the length of the transition arrangement and whether there should be a time limit at all, leading to the drama over whether Brexit Minister David Davis would quit — he didn't, after apparently securing concessions from May.

For its part, the E.U. criticized May's compromise proposal, saying it "raises more questions than it answers."

What is the Brexit timetable?

Assuming May makes some kind of progress in the upcoming fight in Parliament, her government will participate in an E.U. meeting on June 28 that may include a Northern Ireland border discussion. The biggest test comes October 18, with a key summit at which both sides hope to agree on an outline for future relations that can be ratified by Britain and other E.U. members.

Deal or no deal, Britain will leave the bloc on March 29, 2019 — but transition deals could keep existing border and trade arrangements in place for another year or more until a permanent agreement can take effect.

Will Britain have another general election or reverse Brexit?

Brexit cannot be reversed, according to E.U. rules — although some anti-Brexit campaigners believe the E.U. might be willing to compromise if Britain changed its mind.

But despite the mess surrounding Brexit, there is little sign of “Bregret” among British voters. While a small majority now thinks Brexit was wrong, a much clearer majority think the 2016 decision should be respected and Brexit should continue, according to the latest national YouGov survey.

While there is little appetite for reversing the decision, there also appears to be increasingly little optimism about Britain's future.

The same survey also found that twice as many Brits think Brexit will make the economy worse than think things will be better, and most believe it will harm employment and the public health care system. Only 10 percent still read news items about Brexit, and a majority of both anti- and pro-Brexit voters now find the whole topic boring.

YouGov found 46 percent of Brits who expected Brexit to go badly think it is indeed going badly so far, while 27 percent think it's going badly even though they hoped it would go well.

Against this grim backdrop, there was speculation last week that May could call another general election, possibly in the fall, to break some of the political deadlock.

But opinion polls suggest the result would be little different from her disastrous 2017 snap election, in which she hoped to gain a stronger mandate for Brexit talks but instead ended up losing votes and seats to the opposition Labour Party.

And there is little public desire for another campaign, following on from the 2016 Brexit referendum, the 2015 general election and the 2014 Scottish independence vote.

Britain is like the opposite of a swan: on the surface we are thrashing around all over the place, a picture of instability. Yet, underneath we glide on as if nothing changed in 2017, moving steadily towards the rapids. pic.twitter.com/MEW4uA8uaW — Tom McTague (@TomMcTague) June 8, 2018

Even if Labour won an election, it is itself broadly divided on Brexit and now favors pushing ahead with E.U. withdrawal but maintaining much of the existing economic relationship.

Neither is there agreement among experts about the imminent economic impact of Brexit. Property prices are flatlining until Brexit is done, one way or another.

"There is a lot of uncertainty in the market as to where we are with Brexit negotiations. That has really kept a lid on further growth. There is a wait-and-see attitude," said Oliver Knight, associate at upscale realtors Knight Frank.

Brexit progress to date summarised in one tweet https://t.co/GqpvzBktll — Will Steward (@Will4Privacy) June 7, 2018

Others have already made a call.

David Blanchflower, professor of economics at Dartmouth College in New Hampshire, and a former British policy adviser, concluded simply: “Brexit is a disaster.”