简体   繁体   English

跨多个浏览器进行硒测试的自动化测试套件软件包结构的建议

[英]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.

相关问题 PL / SQL包自动化测试 - PL/SQL package automated testing 跨RSpec测试套件对ActiveRecord进行存根验证 - Stubbing validation on an ActiveRecord across the RSpec test suite 如何在 Python Selenium 中实现类似 TestNG 的功能或在一个测试套件中添加多个单元测试? - How to achieve TestNG like feature in Python Selenium or add multiple unit test in one test suite? 从自动化测试套件中排除一些JUnit测试 - Exclude some JUnit tests from automated test suite 如何使用单元测试在 Python 的单个测试套件中运行多个类? - How do I run multiple Classes in a single test suite in Python using unit testing? 停止测试套件执行 python selenium - Stop Test suite Execution python selenium Android单元测试:-找不到类“程序包名称”空的测试套件 - Android Unit Test :- Class not found “package name ” Empty test suite Xcode 10并行测试套件的测试速度较慢,且测试数量较少 - Xcode 10 parallel test suite testing is slower with a low number of tests 用1个测试测试多个类 - Testing multiple classes with 1 test 意外的 afterAll 在 Jest/Testing Library 测试套件中执行 - Unexpected afterAll execution in Jest/Testing Library test suite
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM