diff --git a/ui/src/reusable_ui/components/wizard/WizardButtonBar.tsx b/ui/src/reusable_ui/components/wizard/WizardButtonBar.tsx index 0de4392d9..6956f24e1 100644 --- a/ui/src/reusable_ui/components/wizard/WizardButtonBar.tsx +++ b/ui/src/reusable_ui/components/wizard/WizardButtonBar.tsx @@ -10,6 +10,7 @@ interface Props { lastStep?: boolean onClickPrevious: () => void onClickNext: () => void + testId?: {previousLabel: string; nextLabel: string} } @ErrorHandling @@ -26,17 +27,23 @@ class WizardButtonBar extends PureComponent { nextLabel, onClickPrevious, onClickNext, + testId, } = this.props return (
{decrement && ( - )} diff --git a/ui/src/reusable_ui/components/wizard/WizardStep.tsx b/ui/src/reusable_ui/components/wizard/WizardStep.tsx index 0bb38c451..7ebeece44 100644 --- a/ui/src/reusable_ui/components/wizard/WizardStep.tsx +++ b/ui/src/reusable_ui/components/wizard/WizardStep.tsx @@ -26,6 +26,7 @@ export interface WizardStepProps { nextLabel?: string previousLabel?: string lastStep?: boolean + testId?: {previousLabel: string; nextLabel: string} } @ErrorHandling @@ -38,7 +39,14 @@ class WizardStep extends PureComponent { private scrollMaxHeight = window.innerHeight * 0.45 public render() { - const {children, decrement, nextLabel, previousLabel, lastStep} = this.props + const { + children, + decrement, + nextLabel, + previousLabel, + lastStep, + testId, + } = this.props return ( <> @@ -59,6 +67,7 @@ class WizardStep extends PureComponent { onClickPrevious={this.handleClickPrevious} onClickNext={this.handleClickNext} lastStep={lastStep} + testId={testId} /> ) diff --git a/ui/src/sources/components/ConnectionWizard.tsx b/ui/src/sources/components/ConnectionWizard.tsx index 0f558063f..28eb2af48 100644 --- a/ui/src/sources/components/ConnectionWizard.tsx +++ b/ui/src/sources/components/ConnectionWizard.tsx @@ -93,6 +93,10 @@ class ConnectionWizard extends PureComponent { onNext={this.handleSourceNext} nextLabel={source ? 'Update Connection' : 'Add Connection'} previousLabel="Cancel" + testId={{ + previousLabel: 'cancel--button', + nextLabel: source ? 'update-connection--button' : 'add-connection--button', + }} > (this.sourceStepRef = c)} @@ -109,6 +113,7 @@ class ConnectionWizard extends PureComponent { nextLabel={this.dashboardNextLabel} onNext={this.handleDashboardNext} previousLabel="Go Back" + testId={{previousLabel: 'go-back--button', nextLabel: 'next--button'}} > (this.dashboardStepRef = c)} @@ -127,6 +132,10 @@ class ConnectionWizard extends PureComponent { onPrevious={this.handleKapacitorPrev} nextLabel="Continue" previousLabel="Go Back" + testId={{ + previousLabel: 'go-back--button', + nextLabel: 'continue--button', + }} > (this.kapacitorStepRef = c)} @@ -147,6 +156,10 @@ class ConnectionWizard extends PureComponent { onPrevious={this.handleCompletionPrev} nextLabel="Finish" previousLabel="Go Back" + testId={{ + previousLabel: 'go-back--button', + nextLabel: 'finish--button', + }} > (this.completionStepRef = c)} /> diff --git a/ui/src/sources/components/InfluxTable.tsx b/ui/src/sources/components/InfluxTable.tsx index 705dd90b9..d203b2951 100644 --- a/ui/src/sources/components/InfluxTable.tsx +++ b/ui/src/sources/components/InfluxTable.tsx @@ -54,6 +54,7 @@ class InfluxTable extends PureComponent { deleteKapacitor={deleteKapacitor} setActiveKapacitor={setActiveKapacitor} toggleWizard={toggleWizard} + testId="connection-row" /> ) })} diff --git a/ui/src/sources/components/InfluxTableRow.tsx b/ui/src/sources/components/InfluxTableRow.tsx index 6cf71b2bc..2d3499c39 100644 --- a/ui/src/sources/components/InfluxTableRow.tsx +++ b/ui/src/sources/components/InfluxTableRow.tsx @@ -18,6 +18,7 @@ interface Props { setActiveKapacitor: (kapacitor: Kapacitor) => void deleteKapacitor: (kapacitor: Kapacitor) => void toggleWizard: ToggleWizard + testId?: string } class InfluxTableRow extends PureComponent { @@ -36,10 +37,11 @@ class InfluxTableRow extends PureComponent { setActiveKapacitor, deleteKapacitor, toggleWizard, + testId, } = this.props return ( - + {this.connectButton}