CI for WeChat Mini-programs?

Has anyone figured out how to do at least some minimal CI for Wechat Mini-programs? At least the ability to have a git flow that would trigger CircleCI, build the app, and push it to the “Experience User”?

Bonus points for how to actually run Selenium, Appium or some other tests against the wechat mini-program!

I am unlikely to be the right person to answer this, given that I don’t know what Wechat is. Can you outline what a Mini-program is? Is that a bundled web-app (e.g. in an executable) or a hosted service?

I wonder, given that this is rather broad at the moment, whether you could outline how you would test this thing, and give that thing a try? If you get stuck on something in particular, that problem may not be specific to your use-case, and someone may be able to help even if they have not used Wechat.

WeChat is the Chinese equivalent of Facebook, Instagram, WhatsApp, PayPal, Venmo, Craigslist etc all in one app. Its used by nearly 1 Billion people on a daily basis. It is used instead of Credit Cards and Cash for most businesses in China.

WeChat started out as a kind of closed garden Mobile App which user content was mainly created with HTML / Javascript and used WeChat APIs. But then they added the concept of Mini-Programs that run inside of the WeChat App. It uses a specialized sub/superset of HTML / Javascript / CSS and requires approval by WeChat to be added to the App Store.

QR Code scans are used to authenticate almost every aspect of WeChat usage. From payments, to logging in to the app, to logging in to each different management console for developers, to logging in to their IDE.

This need to QR Scan to login to tools and software lifecycle stages makes it very difficult to automate any aspect of the software development cycle. There doesn’t seem to be much published practices on how to automate the testing of its UI ether.

I find it hard to believe that there is no way to automate the lifecycle and testing of WeChat apps so I was hoping to find someone who had some success on CircleCI of doing this.

Agreed, it sounds like an enormous ecosystem :open_mouth:

I guess the QR codes is going to be the tricky bit, but sounds like a general CI problem, rather than a challenge specific to CircleCI. Could you submit a support ticket to Wechat to ask? Maybe QR code scanning can be mocked in a test environment.

Updates

This Stack Overflow answer indicates there are some Wechat Developer Tools - could they have any test tools integrated?

Is it possible to build the app from a console command? If there is an IDE normally involved here, I wonder if that would just run a command in the background, so that manual intervention is not required.

Finally, if the main application is HTML/JS, then you could have a special mode that mocks out WeChat-specific calls/pages, and tests everything else (i.e. everything that can be tested). In general, you don’t want to be making calls out from any CI system to WeChat-specific hosts.

Hi @rberger.

Does https://github.com/Chatie/wechaty help you any?

I am using the Wechat Developer Tools. That is one of the things that requires a QR code scan to log into the devtool! Also it is a GUI app.

You can run the GUI app on the Mac or Windows (no Linux) and it has to be running to be able to use the CLI! The CLI has the QR code you need to scan to do anything else with the CLI sent to the ASCII terminal!!! (or a file)

You can only do 4 things with the CLI. One of them is a thing I want to do from CI: promote to WeChat upload so “Experience Users” (i.e. QA) can then do manual tests.

There seems to be no way to script the tool to do any kind of testing.

I’m wondering if one could use Appium to test the WeChat mini-programs.

Applications are not written in exactly an HTML/JS. Its a sub/superset of HTML/JS and needs to run in the context of the Wechat Mini-Program to do any real testing as far as I can tell.

Thanks for your suggestions. I and my colleagues have done extensive googling both in Chinese and English as well as talking to whatever contacts we can find in Tencent/WeChat and so far haven’t found anything beyond some hacks that allow you to pass the login QR code to Slack for a human to scan (each time the CI is run!) But NOTHING on how to have automated tests against the WeChat Mini-Program.

I’m still hoping to find something beyond https://xkcd.com/979/

Thanks for the link, but as far as I can tell this is server code and is stand-alone from the WeChat environment (only talks to WeChat thru public Internet API).

But it is a very cool ChatBot program / ecosystem that may be use to us for other stuff!