diff --git a/frontend/public/locales/en.json b/frontend/public/locales/en.json index 8cdfa2b3..3e0edcd7 100644 --- a/frontend/public/locales/en.json +++ b/frontend/public/locales/en.json @@ -27,6 +27,7 @@ "skipped": "Skipped", "skip": "Skip", "undefined": "Undefined", + "copy": "Copy", "steps": "Steps", "backgroundSteps": "Background Steps", "skipAllSteps": "Skip All Steps", @@ -66,4 +67,4 @@ "blocked": "This tag cannot be assigned", "unassigned": "Unassigned" } -} \ No newline at end of file +} diff --git a/frontend/src/modules/report/ScenarioDisplay/components/PopperMenu.tsx b/frontend/src/modules/report/ScenarioDisplay/components/PopperMenu.tsx index 996b9b68..ae3ee15f 100644 --- a/frontend/src/modules/report/ScenarioDisplay/components/PopperMenu.tsx +++ b/frontend/src/modules/report/ScenarioDisplay/components/PopperMenu.tsx @@ -22,11 +22,12 @@ const useStyles = makeStyles(() => interface Props { stepId: number; + stepName: string; status: Status; onStepStatusChange(e: MouseEvent, stepId: number, status: Status, newStatus: Status): void; } -const PopperMenu: FC = ({ stepId, status, onStepStatusChange }) => { +const PopperMenu: FC = ({ stepId, stepName, status, onStepStatusChange }) => { const classes = useStyles(); const { t } = useTranslation(); const ref = useRef(null); @@ -45,6 +46,11 @@ const PopperMenu: FC = ({ stepId, status, onStepStatusChange }) => { ); + const copyStepNameToClipboard = (event: MouseEvent): void => { + event.stopPropagation(); + navigator.clipboard.writeText(stepName); + }; + return ( setOpen(true)} onMouseLeave={(): void => setOpen(false)}> @@ -59,6 +65,9 @@ const PopperMenu: FC = ({ stepId, status, onStepStatusChange }) => { {renderListItem(Failed)} {renderListItem(Skipped)} {renderListItem(Undefined)} + ): void => copyStepNameToClipboard(e)}> + {t('report.copy')} + diff --git a/frontend/src/modules/report/ScenarioDisplay/components/ScenarioStep.tsx b/frontend/src/modules/report/ScenarioDisplay/components/ScenarioStep.tsx index e219e00a..15e73fd5 100644 --- a/frontend/src/modules/report/ScenarioDisplay/components/ScenarioStep.tsx +++ b/frontend/src/modules/report/ScenarioDisplay/components/ScenarioStep.tsx @@ -69,7 +69,7 @@ const ScenarioStep: FC = ({ scenarioId, build, title, steps, classes }) =
{step.keyword} {`${step.name} `} - +
{step.rows ? : null}