square / spoon

Distributing instrumentation tests to all your Androids.
https://square.github.io/spoon/
Apache License 2.0
2.7k stars 476 forks source link

Encoding issues with non-english cucumber-tests #435

Open christopherfrieler opened 7 years ago

christopherfrieler commented 7 years ago

We're struggeling with special characters in our spoon-reports.

Our setup:

We're using spoon with cucumber, but with german test-cases. Hence we have german umlauts such as 'ä' in our tests, espacially in the german translation for "Feature", which is "Funktionalität".

At the same time we have a subclass of android.support.test.runner.AndroidJUnitRunner as our test-runner instead of the default cucumber.api.android.CucumberInstrumentation. Hence, the default TestIdentifierAdapter for junit is chosen, which doesn't handle any special characters.

As the result test-names and paths to screenshots are broken due to encoding problems.

If we could choose the TestIdentifierAdapter explicitly or even inject our own, I think that would resolve the issue, since special characters could be removed or handled in a custom way.

JakeWharton commented 7 years ago

Honestly I've been thinking of just removing this feature. Sure it's nice to see human-readable names but I'd argue that what we're doing is worse than case mapping, and we don't like case mapping. Would you be offended if we just displayed the names verbatim?

edenman commented 7 years ago

👍 to removing this feature

JakeWharton commented 7 years ago

We should be able to solve any encoding problems separately. It shouldn't matter what your test is called, we should support it and render it properly everywhere.

christopherfrieler commented 7 years ago

Removing the feature won't affect us, because right now the TestIdentifierAdapter for junit is used anyway and it doesn't adapt anything.

And yes, resolving encoding issues shouldn't depend on the test-runner. That's why I originally suggested to make the TestIdentifierAdapter configurable. A completely different solution is appreciated as well.

Be aware that cucumber also allows things like cyrillic or arabian characters, so a global solution should handle all that.