What would Shopify suggest regarding e2e tests?

End-to-end testing is a critical component of development reliable applications. It would seem to be in Shopify’s best interest to encourage app developers to add automated tests as to avoid regression/flaky behavior upon iteration.

There are some obvious reasons why this is difficult to do on the Shopify platform:

  • Logging into Shopify admin carries problems regarding captcha
  • Storefront testing could result in 429s
  • Probably more I’m not thinking about. The new customer account portal?

I’m not aware of any official documentation regarding best practices for automating e2e tests on Shopify, across Admin and storefront. My current approach has been to save a Chrome profile that already has auth cookies and that has been working pretty well, but I don’t know how long it will last before I have to replace that profile?

Is there a strategy that Shopify would prefer the community to adopt? This all feels vague and ambiguous, and I’m sure the community in general would appreciate some “official” guidance :slight_smile:

Hi @Kyle_K_Helium,

For End-to-end testing, we recommend taking the same approach described for crawling a shop.

One huge benefit of Web Bot Auth is no 429 responses.

Let me know if that information is sufficient, or if you’re looking for more detailed guidance :slight_smile:

That looks great for testing on the online store. Thanks for providing that info :slight_smile: That seems plug-and-play with Playwright’s extraHTTPHeaders option.

Another big thing is that I want to be able to test my embedded app in Shopify Admin. I’m sure that’s a whole can of worms that probably doesn’t have an official solution. Does Shopify have any opinions on that?

Take a look at:

Thanks to @Dylan

1 Like

Mock bridge does look very promising! I actually contributed to that project. :wink:

However I’m worried that there will be things that Mock Bridge won’t be able to do (i.e. Admin intents requiring considerable effort, who knows what else.) It’s my opinion that every feature should be able to have automated e2e tests, we’re feeling quite the QA stress in our team to ensure that we’re iterating safely.

1 Like

Yup agreed with @Kyle_K_Helium

Mock Bridge has to play catch up with AppBridge / Polaris changes. It’s not an official Shopify project.

But that said, I personally use it quite a bit so I’ll continue to push it forward because there’s not a native solution currently.

2 Likes

Hey folks - Mock bridge is the best option for testing right now, but our internal teams are aware of the need from the community for better E2E testing for apps!

1 Like