上节介绍完我们框架的3层, 下面来介绍其他部分:
1.log用的是log4j2,测试数据是以json的格式组织的,项目是以maven组织的,另外封装了很多的工具类: 连接redis取验证码,(对了, 我们做的是iOS和Android端, 还有windows端 UI, 还有API自动化测试, 我们甚至还研究了把mac端APP的UI自动化加入到我们的框架中, 关于mac端APP ui自动化, 这种小众需求, 后来理论上确实不支持, 可惜)
说到这里, 我觉得有必要把我们这个框架能干的事,隆重的介绍一下:😝
- Android端APP UI自动化
- iOS端APP UI自动化
- Window10端APP UI自动化
- Web UI自动化
- API 自动化
我这里所阐述的并不是说我们的框架可以写Android APP UI自动化, 然后也可以改写成iOS APP UI自动化. 而是我们的框架把上面这些东西都集成进去了, 可以同时写上面的这些东西, 当然这样确实有一个比较大的诟病, 就是integrate so many functions, it is confusion. And if we change a step, will impact more codes.
But , as our old leader, he said, our goal is becoming expert in APP UI automation, so the framework is friendly to us. certainly, the framework is an all-round and perfect. by the way, I want to introduce my a partner in the framework and current job: Lucas__liu
sorry, I suddenly want to practice my English. )
above link is Lucas blog, if our old leader has blog, I will also link him: @Harley, my English name is Ivan, 😁
so continue to introduce our package tools class: To connect MongoDB to reset testing env. ; deal all kinds files(json\File\properties\Image); common appium functions and so on.
-
运行某一条自动化测试用例, 这里有hook定义前置和后置做的事, 比如前置要启动appium server, knowledge: 这里我们可以take Command Line style to start appium server. the way is stabler. we also use DriverEventListener to get clearer log output when we run our script.
-
when we run all testcases, we run by cucumber-jvm, we can configure some tags cases to run,
the tag is a property of test case, is powerful. by tag, we can select cases that we want to run. and tag also is a index when we count in report.
Another property of test case is Transfer parameters:
we usually use above two kinds way, and the second way has some means: data to drive. I believe you can find many blogs about Transferring parameters in gerkin.
- our report is cucumber-reporting,
so beautiful, I believe when you first meet the report. of course, allure also is pretty.
the report apply some editable for our user, for example, add log for every cases.
so pretty.