angular-shepherd
angular-shepherd copied to clipboard
Add `attributes` on `StepOptionsButton`
Hello !
I would like to be able to add a data-testid attribute on the generated buttons for the tour, in order to ease the E2E tests of my application.
My code would look like
const steps: Step.StepOptions[] = [
{
id: TourService.STEP_0_WELCOME,
text: `<h1>Welcome !</h1>
<div>Let us take you on a quick tour.</div>`,
buttons: [
{
classes: 'tour-button-secondary',
text: 'Skip tutorial',
attributes: {'data-testid', 'tutorial-button-skip'},
action: skip,
},
{
classes: 'tour-button-primary',
text: 'Next',
attributes: {'data-testid', 'tutorial-button-next'},
action: next,
},
],
},
}
Do you think this is a feature you could add ?
Hi @loriepisicchio, this seems like a good addition! I think this is something we would want to add in Shepherd itself. Would you be interested in submitting a PR for this?
@rwwagner90 This one still up for grabs?
@avramz yeah, but it would need to be done in Shepherd itself.