Before writing real tests, it might be helpful to add some helper files to provide test data and upload your plugin. You must not understand all elements of the files at this point, simply copy/paste them into your plugin and customize them.
Upload your plugin
First of all you might want to upload your plugin. Therefore you can use helper methods from the CPB. The UniversalPluginManager page object provides everything you need. Simple change the pluginPath and the pluginName.
If something fails while preparation, the tests will stop immediately. This is why we recommend not to something worth testing in this file.
Clean up Your Instance
After running all tests, you might want your instance to be clean again. Therefore you can implement all cleanup tasks in this file and run it after all.
As specs (as well as unit tests) should not have any dependencies on each other, every spec should cleanup its own data. This is why the cleanupTestSetup.spec.js should only remove the data produced in the prepareTestSetup.spec.js.
This content hasn't been updated in a while. That doesn't have to be a problem.
Some of our pages live for years without becoming obsolete.
Please click this link if you want us to update this page.
Old content can be incorrect, misleading or outdated. Please get in contact with us
via a form on this page, our live chat or via email with
email@example.com if you are
in doubt, have a question, suggestion, or want changes from us.