Edinburgh head coach Richard Cockerill was pleased with his side's fitness two weeks before their Pro14 campaign begins despite a warm-up loss to Bath.
Wing Duhan van der Merwe and new fly-half Simon Hickey were both forced off by half-time, as the English side led 5-3 via Nathan Catt's try.
Hickey's replacement, Jason Baggott, slotted a penalty and converted Chris Dean's try on the resumption.
But Wales centre Jamie Roberts powered over on the hour for a decisive score.
Bath fly-half Rhys Priestland converted the try to seal a 12-10 win for the West Country outfit in front of 4,200 fans at Boroughmuir's Meggetland ground.
"It was a good hit-out for us tonight," said Cockerill, who changed 13 players at half-time.
"There was a bit of rustiness from both teams, but physically I thought we were really good."
Edinburgh, who reached the Pro14 play-offs last season, begin their league campaign away to Ospreys on Friday, 31 August.