Defining what a good cafe is can be a little tricky. If you just want a nice spot to relax, people watch and drink something warm, than a nice location, big windows and comfy chairs are all you need. But if you want to really enjoy your coffee, it takes a little more looking.
For espresso, you want to find a place that's really loud from constant grinding. If the baristas aren't grinding the beans for each shot, then they've probably grinded them all ahead of time and let them sit there, loosing all their freshness and flavor. (I know, because I used to do this a long time ago, in my pre-coffee geek days, when I worked for a Seattle's Best stand on my college campus). Also, if the espresso machine has lots of buttons and doesn't require the barista to do some work to actually make the espresso and froth the milk, then you might want to steer clear.
Whenever I get espresso from these super-automatic machines, it tastes watered down, as if it's programmed to pressure more water through the grinds than necessary to fill a desired amount (instead of eyeballing the shot as it's made with a semi-automatic machine, which allows the barista to stop the flow at the right time).
Whenever I see a La Marzocco, the Ferarri of the espresso world, I get tingles. These beautiful metal machines are expensive and usually indicate some sort of consciousness on the part of the owner of what good espresso should be (of course, buying cheap beans or having unskilled workers can ruin it).
But don't be fooled by the machine itself. On a trip to Santa Clara for a tech conference I was sent to cover, I needed some espresso to wake me up. I walked into the posh hotel cafe and saw a brass Victoria Arduino Venus. Tears of joy filled my cheeks. This massive beast is just a gorgeous machine, shiny and huge, topped with an eagle with her wings spread out on top. They cost thousands of dollars, aren't easily found (in cafes) and are a symbol of craftsmanship and good espresso.
Unfortunately, the "barista" didn't grind the beans fresh, didn't look like she knew how to tamp it correctly before putting the portafilter in the device, and the beans themselves were really dark. As a result, it tasted like burnt rubber. Yum! such a disappointment.
A nice touch by baristas to show off their skills is latte art, or etching patterns on the foam with milk. Latte art doesn't add anything to the taste of the espresso drink, it's just a little reminder that this cup is something special, that a little extra effort went into making it.
As for the coffee end of things, don't drink coffee from those glass carafe makers. The coffee's been sitting in that thing for god knows how long, and the burner underneath it actually scorches the coffee. It's bad, people, don't do it.
Better - metal thermoses filled with coffee that are changed regularly (some places claim to change it every 20min, every hour, etc).
Best - each cup made fresh to order, either in a french press, or in a pour over - a simple, cheap way of getting the right temperature water (around 200 degrees) on the grinds.
It also helps when the cafe has some sort of info about the coffee itself - like where it came from, how it was produced, etc. Some places will list coffees by the estates where they were produced. This is probably your best bet of getting good coffee.
Whenever I travel, I try ahead of time to figure out where the good cafes are. I'll check CoffeeGeek's forum on cafe reviews and search it for whatever town or city I'm visiting. Googling can also work.