After running the example project, it is time to add UI tests to your own plugin. We are starting with a minimal example.
1. Required directory structure
Add the following directories to your plugin (<project root>/src/test/ should already exist):
2. Configuration files
You can just copy the files from the random page sources and change your project attributes (name, description, etc) in the package.json
If you already have package.json, extend it with the 'devDependencies' and 'scripts'.
3. Plugin installation spec
For you very first spec you may start by uploading your plugin via UI test. Therefore copy the uploadPlugin.spec.js (project-root/src/test/ui-tests/specs/common/) into your project and change the plugin information, meaning 'artifact id' and 'plugin name' (can be found in the pom.xml).
If you do not bundle an *.obr file, changes it to *.jar
As you only provide one spec file, remove the other specs in the protractorConfig.js
4. Run UI test
Your directory structure should now look like this
Do as documented here: Requirements
Make sure you've built the plugin before (atlas-package)
You should see a browser, where 'admin' logs-in and uploads your plugin
Congratulations you've successfully installed UI tests in your project
5. Next steps
After installing your plugin you have two options
- Add test data to your instance - Part 3: Common Spec Files
- Add you first real test - Part 4: Test Files
If you want further information about the package.json and the protractorConfig.js, have a look at Part 2: Infrastructure.
If you want to implement your tests in TypeScript, see Part 6: Implementing in TypeScript first.
- No labels