How to speed up the build to run tests locally and see the report - dn0000001/test-automation GitHub Wiki
The project test-automation consists of 2 modules. The taf module that contains only framework specific code and the automation-tests module that contains the test specific code. The taf module should rarely have changes as it has the framework code. However, the automation-tests module will change constantly as tests are added or modified. So, only building the modified module can save time once the project gets large when you need to see the report locally. Since, the project is using maven the following Maven configurations can be created to do this.
Maven configurations that are needed
App Install
Needs to have been run previously to ensure dependencies are available in your local maven repo. It is recommended to run when there are any changes to TAF. However, it is possible to only build the TAF in this case as well.
Working Directory: /workspace/test-automation Command Line: clean install
Note: The screenshot has package which was found to be redundant and it was removed.
TAF Only
Any changes to TAF and run this (or App Install)
Working Directory: /workspace/test-automation/taf Command Line: clean install
Note: The screenshot has package which does work but to be safe it was changed to install.
Weave Tests Only
Needs to be run every time there are code changes to automation-tests to weave the steps for the report and create the JAR to be run. This is assuming IntelliJ has already compiled the code which it does by default automatically on any change.
Working Directory: /workspace/test-automation/automation-tests Command Line: resources:resources aspectj:compile jar:jar
Application configurations that are needed
RunTests - No Maven
This is application configuration runs all the tests (without building anything.)
-cp automation-tests Target Class: com.automation.common.ui.run.RunTests Working Directory: /workspace/test-automation
Usage of the configurations
Only automation-tests module code changes
Run the configurations in order:
- Weave Tests Only
- RunTests - No Maven
TAF module code changes - Fast Way
Run the configurations in order:
- TAF Only
- Weave Tests Only
- RunTests - No Maven
TAF module code changes - Slow Way (but ensures no issues)
Run the configurations in order:
- App Install
- RunTests - No Maven