Ride-hailing firm Lyft Inc said on Tuesday it was testing an earnings algorithm that will allow drivers in 18 U.S. cities to see destination and pay details before accepting a request.

The test follows a similar move by bigger rival Uber Technologies Inc and underlines how the companies are going the extra mile to fix driver shortages to take advantage of a demand surge brought on by a return to office and travel since the pandemic.

Lyft drivers will have access to details such as drop-off locations, estimated distance and time, as well as fare details before accepting a ride. The company plans to expand this service to more cities through 2022.

It is also investing to test filters that will allow drivers to set a preferred driving radius and give them the option to choose their rider.

Drivers for ride-hailing firms have been struggling with higher fuel and maintenance costs and have long demanded the access to such details.

"We'll also design Upfront Pay over time to include bonuses and incentives," Lyft President John Zimmer said.

Meanwhile, Uber's upfront pay system has drawn criticism from drivers.

California-based driver Jude Wolfe says Uber is taking a bigger percentage of drivers' earnings, prompting more to quit and forcing others to travel long distances for pick ups when gas prices are already high.

"A lot of this problem can be alleviated, if we did not have the demand on us to accept the last five out of 10 rides in order to keep our upfront details," she said in a campaign demanding fair share from Uber.

Looking to launch upfront pay "without limitations", Lyft said a survey of over 1,000 drivers showed more than 70% preferred the upfront pay model to the previous pay models.

(Reporting by Nivedita Balu in Bengaluru; Editing by Shinjini Ganguli)