Openfoodnetwork: Add feature test(s) to Unit price feature

Created on 24 Feb 2021  路  6Comments  路  Source: openfoodfoundation/openfoodnetwork

What we should change and why (this is tech debt)

We need to consider feature tests when introducing changes in the UI.

Context

This came up in the context of this issue and comment.

Impact and timeline

Makes further changes more resilient against possible regressions.

Most helpful comment

This is out of scope as far as Unit prices go IMO. Introducing a new visual testing tool to catch misplacements while the feature is still functional (at least by a robot) is a totally unrelated topic.

Unit prices are already covered at feature-spec level on spec/features/admin/unit_price_spec.rb and spec/features/consumer/shopping/unit_price_spec.rb

All 6 comments

IMO this is not a tech debt to be dealt with later on but part of the epic, as it should have been included in https://github.com/openfoodfoundation/openfoodnetwork/pull/6905. It's just that this time, and because JB is not yet that familiar with feature specs, that we moved on.

Were you planning to do work on it yourself? My initial idea was to use this to onboard JB into this kind of test.

Great - thanks for your feedback on this @sauloperez ,

I've removed that label now, and added the issue to the to the unit prices epic :+1:
Also, please go ahead with on-boarding JB on this. It's relevant to be able to keep track of these visual changes.

Should we consider adding something like Percy https://www.browserstack.com/percy, to our CI?

I don't think we need Percy at all for this. That's what our current feature specs can already do: check that the question mark is there, it's clickable and doing so shows a tooltip with the right text.

Yes, I agree that feature specs would nicely cover the test case you describe :+1:

I'm wondering though, if feature specs could catch regressions like the misplacement of elements on the page, while not breaking the functionality of that page.

I don't advocate for Percy though. I'm rather trying to understand the limitations of feature specs, when visual tests are needed.

I'm wondering though, if feature specs could catch regressions like the misplacement of elements on the page, while not breaking the functionality of that page.

exactly. They wouldn't catch that.

This is out of scope as far as Unit prices go IMO. Introducing a new visual testing tool to catch misplacements while the feature is still functional (at least by a robot) is a totally unrelated topic.

Unit prices are already covered at feature-spec level on spec/features/admin/unit_price_spec.rb and spec/features/consumer/shopping/unit_price_spec.rb

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kirstenalarsen picture kirstenalarsen  路  3Comments

andrewpbrett picture andrewpbrett  路  3Comments

myriamboure picture myriamboure  路  3Comments

HugsDaniel picture HugsDaniel  路  3Comments

filipefurtad0 picture filipefurtad0  路  3Comments