This is not supported in Testim's visual editor.
Testim ❤️ Angular, the superheroic framework. We use Angular in several of our internal codebases and testing Angular and AngularJS is a supported use case with TDK.
Adding tests should typically be done rather early in Angular and AngularJS. It is encouraged to write unit tests for the majority of your logic and use Testim to test end to end-user flows.
Without the Angular CLI you can initialize Testim like you would for any other non-angular project. You would follow the instructions shown in getting started and create a new project.
You probably have an
e2e folder in your project containing protractor and the CLI generated test configuration. We would recommend you either keep it if you have useful tests there and add a second
testim or remove it if you are not using it.
Other than that follow getting started and create a new project.
You can share code between your Angular codebase and your Testim codebase.
This has the advantage of letting you share code between the test project and the main project which has positive consequences (less code) and negative ones (you are no longer writing black box tests).
In your initialized TDK code can
require Angular code if you do the following things:
- TDK accepts a webpack config with the
- Assuming you are using TypeScript in your Angular code initialize Testim with TypeScript enabled.
- Create a
tsconfig.jsonfile in your project root that
"extends": '../tsconfig.json'to reuse all your TypeScript configuration from your Angular project.
- That should be it!
This is possible regardless of whether or not you used the Angular CLI to generate the project or not.
Updated over 2 years ago