HP listed a number of different configurations for that model number. As near as I can tell (and the name "slimline" is a pretty good clue) the case is only about 4.4" wide (112mm).
HP Pavilion Slimline s5300 Desktop PC series specifications - HP Home & Home Office products
(Note: This is from HPs UK website, so double-check to make sure you are looking up the exact model you have.)
Under "Slots" it mentions "Low Profile" so I'd be sure about how much room you actually have in the case before ordering anything. The length of the card could be an issue as well, since some of the latest and greatest cards are about as long as your forearm.
Personally, I would shut down the computer, take the side off it and look inside. Find a free PCIx slot and actually measure how much room there is from the slot out to the side of the case and how much room you have from the back of the case to whatever point you'll start bumping into things on the front end. Keep in mind that any good card is going to need an extra power connector or two to run and that they often plug in at the end of the card opposite the mounting bracket. Allow a little extra space for the power connector(s).
The other big thing with video cards is that it's possible to spend just about as much money on one as you can imagine. To make specific recommendations we would need the measurements and also an idea of your budget.
Is this the graphics test you were referring to?
FINAL FANTASY XIV Official Benchmark
It looks like a DirectX9.0c game, so you probably won't need anything too extravagant to run it. Buying more card than you need will help future-proof your computer for when Final Fantasy XV is out. (Sooner or later one of them may actually be the
Final Final Fantasy.)