File tree Expand file tree Collapse file tree 4 files changed +15
-9
lines changed Expand file tree Collapse file tree 4 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
66and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
77
88## [ Unreleased]
9+ ### Added
10+ - Add [ data-testid] to items in the execution summary ([ #391 ] ( https://github.com/cucumber/react-components/pull/391 ) )
911
1012## [ 23.1.0] - 2025-06-15
1113### Changed
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ describe('<ExecutionSummary/>', () => {
5252 </ EnvelopesProvider >
5353 )
5454
55- expect ( screen . getByTestId ( 'setup.phrase' ) ) . to . contain . text (
55+ expect ( screen . getByTestId ( 'cucumber.summary. setup.phrase' ) ) . to . contain . text (
5656 'cucumber-js@8.0.0-rc.1 with node.js@16.13.1 on linux@5.11.0-1022-azure'
5757 )
5858 } )
Original file line number Diff line number Diff line change @@ -37,13 +37,13 @@ export const ExecutionSummary: FC = () => {
3737 < >
3838 { meta && (
3939 < HeaderSection >
40- < HeaderItem >
40+ < HeaderItem testId = "cucumber.summary.setup" >
4141 < HeaderSubItem >
4242 < ImplementationIcon implementation = { meta . implementation } />
4343 < RuntimeIcon runtime = { meta . runtime } />
4444 < OSIcon os = { meta . os } />
4545 </ HeaderSubItem >
46- < span data-testid = "setup.phrase" >
46+ < span data-testid = "cucumber.summary. setup.phrase" >
4747 < VersionedTool { ...meta . implementation } fallback = "unknown tool" />
4848 < em className = { styles . conjunction } > with </ em >
4949 < VersionedTool { ...meta . runtime } fallback = "unknown runtime" />
@@ -55,7 +55,7 @@ export const ExecutionSummary: FC = () => {
5555 </ HeaderSection >
5656 ) }
5757 < HeaderSection >
58- < HeaderItem >
58+ < HeaderItem testId = "cucumber.summary.status" >
5959 < HeaderSubItem >
6060 < HealthChart />
6161 < span >
@@ -68,7 +68,7 @@ export const ExecutionSummary: FC = () => {
6868 </ HeaderSubItem >
6969 </ HeaderItem >
7070 { startDate && (
71- < HeaderItem >
71+ < HeaderItem testId = "cucumber.summary.timing" >
7272 < HeaderSubItem >
7373 < FontAwesomeIcon aria-hidden = "true" style = { { opacity : 0.75 } } icon = { faStopwatch } />
7474 < span >
@@ -86,14 +86,14 @@ export const ExecutionSummary: FC = () => {
8686 </ HeaderItem >
8787 ) }
8888 { meta ?. ci && (
89- < HeaderItem >
89+ < HeaderItem testId = "cucumber.summary.ci" >
9090 < HeaderSubItem >
9191 < CIJobLink ci = { meta . ci } />
9292 </ HeaderSubItem >
9393 </ HeaderItem >
9494 ) }
9595 { meta ?. ci ?. git && (
96- < HeaderItem >
96+ < HeaderItem testId = "cucumber.summary.git" >
9797 < HeaderSubItem >
9898 < CICommitLink ci = { meta . ci } />
9999 </ HeaderSubItem >
Original file line number Diff line number Diff line change @@ -6,8 +6,12 @@ export const HeaderSection: FC<PropsWithChildren> = ({ children }) => {
66 return < div className = { styles . section } > { children } </ div >
77}
88
9- export const HeaderItem : FC < PropsWithChildren > = ( { children } ) => {
10- return < div className = { styles . item } > { children } </ div >
9+ export const HeaderItem : FC < PropsWithChildren < { testId ?: string } > > = ( { testId, children } ) => {
10+ return (
11+ < div data-testid = { testId } className = { styles . item } >
12+ { children }
13+ </ div >
14+ )
1115}
1216
1317export const HeaderSubItem : FC < PropsWithChildren > = ( { children } ) => {
You can’t perform that action at this time.
0 commit comments