简体   繁体   English

如何在Github中建立自动化框架?

[英]How to set up an automation framework in Github?

I currently have 3 git repos: One for a UI test framework, one for an API, and the other for Mobile. 我目前有3个git repos:一个用于UI测试框架,一个用于API,另一个用于Mobile。 The problem I have is that, for mobile, we have e2e testcases that first need to trigger some UI and API test cases. 我的问题是,对于移动设备,我们拥有e2e测试用例,首先需要触发一些UI和API测试用例。

Is there any way I can define UI and API code as dependencies in my mobile test cases so that when I do run a e2e mobile testcase which has UI and API pre-conditions, it will run successfully. 有什么方法可以将UI和API代码定义为我的移动测试用例中的依赖项,以便当我运行具有UI和API前提条件的e2e移动测试用例时,它将成功运行。

I am looking at gradle to handle these dependencies now, but I want to know that I am on the right track. 我正在查看gradle来处理这些依赖关系,但是我想知道自己处在正确的轨道上。

The common approach for this is the following: 常见的方法如下:

  • Each project needs to define its own dependencies. 每个项目都需要定义自己的依赖项。 You use a tool like Maven (for Java projects), npm (for server-side JavaScript) or Bower (for client-side JavaScript/Web) for this. 为此,您可以使用Maven(用于Java项目),npm(用于服务器端JavaScript)或Bower(用于客户端JavaScript / Web)之类的工具。
  • Each project is built on its own, using just its own dependencies. 每个项目都使用自己的依赖项独立构建。
  • Each project has its own test cases, which are run when the project is built. 每个项目都有自己的测试用例,这些用例在构建项目时运行。

So in your case, a build process could look like this: 因此,在您的情况下,构建过程可能如下所示:

  • Build the UI Test Framework and run its test cases. 构建UI测试框架并运行其测试用例。
  • If the UI Test Framework build succeeds, build the API and run its test cases. 如果UI测试框架构建成功,则构建API并运行其测试用例。
  • If the API build succeeds, build the Mobile project and run its (unit) test cases. 如果API构建成功,则构建Mobile项目并运行其(单元)测试用例。
  • If all of the builds succeeded, deploy the application to a test server and run the e2e test cases. 如果所有构建都成功,则将应用程序部署到测试服务器并运行e2e测试用例。

This way, you have a separation of concerns, and your dependencies are set up in a clean and consistent way. 这样,您就可以将关注点分离,并且您的依赖项将以一种干净一致的方式进行设置。

Knowing more details about your tooling and dependency management would allow a more fully featured answer. 了解有关您的工具和依赖性管理的更多详细信息将提供功能更全面的答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM