openfoodfoundation / openfoodnetwork

Connect suppliers, distributors and consumers to trade local produce.
https://www.openfoodnetwork.org
GNU Affero General Public License v3.0
1.1k stars 714 forks source link

[Flaky] rspec ./spec/system/consumer/footer_links_spec.rb:12 #10287

Closed filipefurtad0 closed 1 year ago

filipefurtad0 commented 1 year ago

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

Failures:

  1) Footer Links policy link opens cookies policy page
     Failure/Error: expect(page).to have_content I18n.t('legal.cookies_policy.header')
       expected to find text "How We Use Cookies" in "SHOPS MAP PRODUCERS GROUPS ABOUT Español Login Cart 0 Close Your cart is empty Interested in getting on the Open Food Network? Register here × SHOP NOW Food, unincorporated. Sometimes the best way to fix the system is to start a new one… We begin from the ground up. With farmers and growers ready to tell their stories proudly and truly. With distributors ready to connect people with products fairly and honestly. With buyers who believe that better weekly shopping decisions can seriously change the world. Then we need a way to make it real. A way to empower everyone who grows, sells and buys food. A way to tell all the stories, to handle all the logistics. A way to turn transaction into transformation every day. So we build an online marketplace that levels the playing field. It’s transparent, so it creates real relationships. It’s open source, so it’s owned by everyone. It scales to regions and nations, so people start versions across the world. It works everywhere. It changes everything. We call it Open Food Network. We all love food. Now we can love our food system too. Shopping - here's how it works. 1. Search Search our diverse, independent shops for seasonal local food. Search by neighbourhood and food category, or whether you prefer delivery or pickup. 2. Shop Transform your transactions with affordable local food from diverse producers and hubs. Know the stories behind your food and the people who make it! 3. Pick-up / Delivery Hang on for your delivery, or visit your producer or hub for a more personal connection with your food. Food shopping as diverse as nature intended it. Shopping that makes the world a better place. I'M READY We're creating a new food system. 0 FOOD PRODUCERS 0 FOOD SHOPS 0 FOOD SHOPPERS 0 FOOD ORDERS Interested in getting on the Open Food Network? Register here Secure and trusted. Open Food Network uses SSL encryption (2048 bit RSA) everywhere to keep your shopping and payment information private. Our servers do not store your credit card details and payments are processed by PCI-compliant services. Keep in touch Email us Newsletter sign-up News Calendar Navigate Shops Map Producers Groups About Join us Create a listing, shop or group directory on the Open Food Network. Tell me more! Read our Terms of service | Find us on GitHub Open Food Network is a free and open source software platform. Our content is licensed with CC BY-SA 3.0 and our code with AGPL 3. We take good care of your data. See our cookies policy Cómo utilizamos las cookies Las cookies son archivos de texto muy pequeños que se almacenan en tu computadora cuando visitas algunos sitios web. En OFN somos respetuosos con tu privacidad. Utilizamos solo las cookies que son necesarias para ofrecerte el servicio de compraventa de alimentos en línea. No vendemos ninguno de tus datos. Es posible que en el futuro te propongamos que compartas alguno de tus datos para crear nuevos servicios comunes que podrían ser útiles para el ecosistema (como los servicios logísticos para sistemas alimentarios cortos), pero aún no hemos llegado a ese punto y no lo haremos sin tu autorización :-) Usamos cookies principalmente para recordar quién eres si 'inicias sesión' o para poder recordar los artículos que colocas en tu carrito, incluso si no has iniciado sesión. Si continúas navegando en el sitio web sin hacer clic en \"Aceptar cookies\" suponemos que nos das tu consentimiento para almacenar las cookies que son esenciales para el funcionamiento del sitio web. ¡Aquí está la lista de cookies que usamos! Cookies esenciales Las siguientes cookies son estrictamente necesarias para el funcionamiento de nuestro sitio web. _ofn_session_id / Establecido por: 127.0.0.1 Se usa para permitir que el sitio web recuerde a los usuarios entre las visitas a la página, por ejemplo, recordar los artículos en tu carrito. cookies_consent / Establecido por: 127.0.0.1 Se usa para mantener el estado del consentimiento del usuario para almacenar cookies remember_spree_user_token / Establecido por: 127.0.0.1 Se usa si el usuario ha solicitado que el sitio web lo recuerde. Esta cookie se elimina automáticamente después de 12 días. Si como usuario deseas que se elimine esa cookie, solo necesitas desconectarte. Si no deseas que la cookie se instale en tu computadora no debes marcar la casilla \"recordarme\" al iniciar sesión. qos_token / Establecido por: openstreetmap.org Utilizado por nuestro amigo proveedor de mapeo de código abierto (OpenStreetMap) para garantizar que no recibas demasiadas solicitudes durante un período de tiempo determinado, para evitar el abuso de sus servicios. m / Establecido por: m.stripe.com nsr / Establecido por: m.stripe.network __stripe_sid / Establecido por: 127.0.0.1 __stripe_mid / Establecido por: 127.0.0.1 Datos recopilados por nuestro procesador de pagos Stripe para detectar fraudes https://stripe.com/cookies-policy/legal. No todas las tiendas usan Stripe como método de pago pero es una buena práctica evitar fraude aplicarlo a todas las páginas. Stripe probablemente crea una imagen de cuáles de nuestras páginas generalmente interactúan con su API y luego marca cualquier cosa inusual. Por lo tanto configurar la cookie Stripe tiene una función más amplia que la simple provisión de un método de pago a un usuario. Eliminarla podría afectar la seguridad del servicio en sí. Puede obtener más información acerca de Stripe y leer su política de privacidad en https://stripe.com/privacy. La mayoría de las cookies solo contienen un identificador único, pero no otros datos, por lo que su dirección de correo electrónico y contraseña, por ejemplo, nunca se incluyen ni se exponen. Advertencia sobre la desactivación de cookies Como usuario, siempre puede permitir, bloquear o eliminar las cookies de Open Food Network o cualquier otra página web cuando lo desee a través del control de configuración de su navegador. Cada navegador tiene una operativa diferente. Aquí están los enlaces: Firefox Chrome Internet Explorer Safari Pero tenga en cuenta que si elimina o modifica las cookies esenciales utilizadas por Open Food Network, el sitio web no funcionará, no podrá agregar nada a su carrito ni realizar pedidos, por ejemplo."

     [Screenshot Image]: /home/runner/work/openfoodnetwork/openfoodnetwork/tmp/capybara/screenshots/failures_r_spec_example_groups_footer_links_policy_link_opens_cookies_policy_page_588.png

     # ./spec/system/consumer/footer_links_spec.rb:15:in `block (3 levels) in <top (required)>'
     # ./spec/system/support/cuprite_setup.rb:41:in `block (2 levels) in <top (required)>'

Context

https://github.com/openfoodfoundation/openfoodnetwork/actions/runs/3950860801/jobs/6763967077

Impact and timeline

filipefurtad0 commented 1 year ago

Another occurrence here.

mkllnk commented 1 year ago

Just failed on master again:

filipefurtad0 commented 1 year ago

Ran this one locally over a 100x, but never seen it fail. I see no reason why capybara does not wait for the modal to appear... So I guess our best bet is adding the retry option here?

jibees commented 1 year ago

Looking at the screenshot generated by Capybara and available here:

failures_r_spec_example_groups_footer_links_policy_link_opens_cookies_policy_page_946 2

Seems like we are in spanish ;)

filipefurtad0 commented 1 year ago

Hum, thanks - good point @jibees - and my bad actually, as this can be seen in the error message :+1: Food for thought. Happy to investigate it.

jibees commented 1 year ago

This part of the code seems to be very edgy, old as it use angular template (don't know why: any good reason or old code?)

engines/web/app/views/web/angular_templates/cookies_policy.html.haml engines/web/app/assets/javascripts/web/cookies_policy/cookies_policy_modal_service.js.coffee engines/web/app/assets/javascripts/web/cookies_policy/cookies_policy_modal_controller.js.coffee and engines/web/app/assets/javascripts/web/cookies_policy/cookies_policy_modal_directive.js.coffee

filipefurtad0 commented 1 year ago

old as it use angular template (don't know why: any good reason or old code?)

No idea :shrug:

jibees commented 1 year ago

Seems like I could reproduce on local as well:

Capture d’écran 2023-02-14 à 14 17 09

My interface is in German, while my browser is configured in French as first language.

Will open an issue.

jibees commented 1 year ago

I've open a draft PR that managed to reproduce the error: https://github.com/openfoodfoundation/openfoodnetwork/pull/10437

Now, we probably should solve it (I don't know the severity of this one, is this really annoying?)

mkllnk commented 1 year ago

Yes, annoying. Another fail: https://github.com/openfoodfoundation/openfoodnetwork/actions/runs/4315184265/jobs/7529208778

mkllnk commented 1 year ago

I just had another fail in master. I'm taking this one.