Setup
Add the QaModule
to your application module so that the qa
directive will be accessible.
...
import { QaModule } from '@daysmart/angular-qa-module';
...
@NgModule({
declarations: [
SomeComponent
],
imports: [
...
QaModule,
...
],
providers: []
})
export class SomeModule {}
Usage
Add the qa
directive to any element that you want to have a special data attribute added to. This helps to keep QA selectors and regular selectors separate to reduce refactoring E2E tests.
<button class="confirm" qa="submit-btn"></button>