当前位置:   article > 正文

wpf ui github_在github action ci上进行快速ui测试

ui自动化测试比对平台 github

wpf ui github

This is an ongoing article to chronicle my adventures with continuous integration UI testing for my Swift iOS app. Scroll down for codes and details, read the beginning for the primer and the whys.

这是一篇持续不断的文章,通过对我的Swift iOS应用进行持续集成的UI测试来记录我的冒险经历。 向下滚动以获取代码和详细信息,阅读底漆的开头和原因。

Updated May 2020!

2020年5月更新!

GitHub Actions CI (GitHub Actions CI)

So my app is rather small, but since I’m a solo dev show, I like having a CI to back me up and check my work. And for some strange reason I find CI’s and auto UI testing oddly satisfying (well, when it works…)

所以我的应用程序很小,但是由于我是个开发秀,所以我喜欢用CI来备份并检查我的工作。 出于某种奇怪的原因,我发现CI和自动UI测试令人满足( 很好,当它起作用时…)

Some bits of automated UI testing are great when you get tired of manually re-testing everything, especially as your app grows.

当您厌倦了手动重新测试所有内容时 (尤其是随着应用程序的增长),一些自动化的UI测试非常有用。

BUT if you do any amount of Googling on Swift UI testing, it’s contentious at best and at worst it just fails constantly and/or is horribly flaky. StackOverflow is abound in questions and problems with it.

但是,如果您在Swift UI测试中进行了大量谷歌搜索,那么它充其量是有争议的,而在最坏的情况下,它只会不断失败和/或令人恐惧。 StackOverflow上存在很多问题。

Refer to the man Paul for expert advice on setting it up (rather than trying to figure it out yourself, its painful).

向Paul咨询有关设置的专家建议(而不是自己弄清楚,这很痛苦)。

So, UI testing in hand, now you can invoke a CI to do more than just build.

因此,在进行UI测试之后,现在您可以调用CI来完成不仅仅是构建的任务。

The newly out of beta and IMO badass GitHub Actions capability. Check it out if you haven’t. My app builds are in the order of ~12–14 minutes per, which is not much slower than my MacBook Pro local build time.

最新的beta版本和IMO badass GitHub Actions功能。 如果还没有,请检查一下。 我的应用程序构建时间约为12至14分钟,这并不比MacBook Pro本地构建时间慢多少。

Sidenote: I really like https://www.bitrise.io/ but for my app I’ve found build times are 3x slower than GitHub (aka >30 minutes which exceeds bitrise’s free developer plan) so unfortunately it won’t work for my purposes (it aborts at 30 mins). Bummer!

旁注:我真的很喜欢https://www.bitrise.io/,但是对于我的应用程序,我发现其构建时间比GitHub慢3倍(也就是30分钟,这超过了bitrise的免费开发者计划),因此很遗憾,它不适用于我的目的(在30分钟时终止)。 mm!

适用于iOS的Handy Dandy启动脚本 (Handy Dandy Start Script for iOS)

All right so here’s my GitHub Actions special secret sauce script (not that secret actually). It’s pretty simple, which I prefer because more scripts and macros = more places for shit to break. Simplicity is beautiful. Feel free to amp it up to meet your needs.

好的,这是我的GitHub Actions特殊秘密酱脚本( 实际上不是那个秘密) 。 这很简单,我更喜欢,因为更多的脚本和宏=更多的地方可以打破。 简单就是美丽。 随意放大以满足您的需求。

您可能遇到的问题 (Problems You May Encounter)

相同的确切UI测试根据目的地具有3种不同的行为。 (The same exact UI test has 3 different behaviors based on destination.)

  1. Your local simulators (These seem to always work the best)

    您的本地模拟器(这些模拟器似乎总是工作得最好)
  2. Your local on-device tests

    您的本地设备上测试
  3. Your remote CI server, which is running the command line versions of the xcbuild and xctests (or other things).

    您的远程CI服务器,该服务器正在运行xcbuildxctests (或其他东西)的命令行版本。

The remote CI loves to fail when your local simulator runs just fine. Even running the local command line tools works for my tests, but then fails constantly on the remote. So those are somehow different. GitHub Actions doesn’t tell you much about why, at least not why it’s different than your local.

当本地模拟器运行良好时,远程CI会失败。 甚至运行本地命令行工具都可以进行我的测试,但是随后在远程上经常失败。 所以这些有所不同。 GitHub Actions没有告诉您很多原因,至少没有告诉您为什么它与您的本地用户不同。

Handy Trick: I discovered that the local on-device can sometimes mirror the issues that the remote CI server is having. Swap out #2 and #3 to help get your tests passing and looking green in no time!

Handy Trick:我发现本地设备有时可以反映远程CI服务器遇到的问题。 交换#2和#3可以帮助您的测试通过并立即变成绿色!

超时…超时…为什么总是超时? (Timeouts…timeouts…why is it always timeouts?!)

You’ll notice right away your UI tests will timeout. There are reasons why, beyond the scope of this article, so suffice to say its something we must pay the price of to have such a nice testing capability at all

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/weixin_40725706/article/detail/905322
推荐阅读
相关标签