angular-shepherd icon indicating copy to clipboard operation
angular-shepherd copied to clipboard

Add `attributes` on `StepOptionsButton`

Open loriepisicchio opened this issue 4 years ago • 3 comments

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 ?

loriepisicchio avatar May 10 '21 08:05 loriepisicchio

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?

RobbieTheWagner avatar May 12 '21 14:05 RobbieTheWagner

@rwwagner90 This one still up for grabs?

avramz avatar Oct 16 '21 00:10 avramz

@avramz yeah, but it would need to be done in Shepherd itself.

RobbieTheWagner avatar Oct 16 '21 01:10 RobbieTheWagner