[英]Recommendation for automated test suite package structure for Selenium testing across multiple broswers
So, I could use a recommendation or two on what makes the most sense on how to structure my automated test package (it's java based using Selenium 2.4.5). 因此,我可以使用一两个建议,以使最有意义的方式构成如何构造自动化测试包(它是使用Selenium 2.4.5的Java)。
I've thought of two main options: 我想到了两个主要选择:
root test dir -> browser dir -> test dir -> test class in java 根测试目录->浏览器目录->测试目录-> Java中的测试类
or 要么
root test dir -> test dir -> browser dir -> test class in java 根测试目录->测试目录->浏览器目录-> Java中的测试类
I just haven't really experimented enough to know if it's more useful to be able to run the tests based off browser or the kind of tests. 我只是还没有做足够的实验就知道能够基于浏览器或测试类型运行测试是否更有用。 For example I could see the benefit of running all IE tests to verify something, but I can also see the validity of running all of the 'login' or 'sign up' based tests so I was hoping someone who has actually implemented and uses this more could give me an idea on what works for them.
例如,我可以看到运行所有IE测试以验证某些内容的好处,但是我也可以看到运行所有基于“登录”或“注册”的测试的有效性,因此我希望有人实际实施并使用此功能更多可以让我对他们的工作思路有所了解。
Ultimate Goal: Have build variants setup to run against several different environments (dev, integration, staging, and production) and with several different browser options (chrome, firefox, ie, opera, safari, or all) when a commit is pushed and Jenkins job finishes deployment. 最终目标:在推送提交和Jenkins时,具有构建变体设置以在几种不同的环境(开发,集成,分段和生产)和多种不同的浏览器选项(chrome,firefox,即Opera,safari或所有)上运行工作完成部署。
We have implemented the PageObject Model successfully. 我们已经成功实现了PageObject Model。 PageObject pattern is probably the most popular way of handling responsibility and separation of concern out there.
PageObject模式可能是处理责任和分离关注点的最流行方法。 In short, you create separate object for each pages and tests so there are clear separation of concern.
简而言之,您可以为每个页面和测试创建一个单独的对象,这样就可以清楚地将关注点分离。 As all of us know, controlling the UI in early development is a challenge for UI testing while this pattern provides a way to handle the whole framework by only modifying the page object instead of changing everything.
众所周知,在早期开发中控制UI是UI测试面临的挑战,而此模式提供了一种方法,即仅修改页面对象而不更改所有内容即可处理整个框架。
Also, the multi browser capabilities can easily be controlled with the Testing framework such as TestNG. 此外,可以使用TestNG等测试框架轻松控制多浏览器功能。 I have a public Github repo here
我在这里有一个公开的Github回购
Tests should be developed universally, so that when written for one browser - will work for all browsers and on all environments. 测试应该进行通用开发,以便在为一个浏览器编写时-适用于所有浏览器和所有环境。 This way it will require you only to handle your properties/data for different browsers/environments in resources/CLI, and the issue with package presentation will solve itself.
这样,您将只需要处理资源/ CLI中不同浏览器/环境的属性/数据,包显示的问题将自行解决。
Also you will organize your tests in suites, and this is where you can create tons of them for every setup you need. 另外,您将在套件中组织测试,在这里您可以为所需的每种设置创建大量的测试。
Thus, package structure has little to do with multibrowser testing, it is only for your convenience. 因此,包的结构与多浏览器测试无关,只是为了您的方便。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.