diff --git a/app/cdap/components/PipelineDetails/RunLevelInfo/CurrentRunIndex.tsx b/app/cdap/components/PipelineDetails/RunLevelInfo/CurrentRunIndex.tsx index e1847eb5219..97b9adc69ed 100644 --- a/app/cdap/components/PipelineDetails/RunLevelInfo/CurrentRunIndex.tsx +++ b/app/cdap/components/PipelineDetails/RunLevelInfo/CurrentRunIndex.tsx @@ -31,8 +31,10 @@ import { getCurrentNamespace } from 'services/NamespaceStore'; import { getHydratorUrl } from 'services/UiUtils/UrlGenerator'; import Popover from 'components/shared/Popover'; import { GLOBALS } from 'services/global-constants'; +import { getDataTestid } from '@cdap-ui/testids/TestidsProvider'; const PREFIX = 'features.PipelineDetails.RunLevel'; +const TESTID_PREFIX = 'features.pipelineDetails.runLevel'; const StyledNoRunsHeader = styled.div` display: flex; @@ -203,6 +205,7 @@ const CurrentRunIndex = ({ }).toString() : '' } + data-testid={getDataTestid(`${TESTID_PREFIX}.currentRunIndex`)} > {T.translate(`${PREFIX}.currentRunIndex`, { currentRunIndex: runIndexInTotalRunsCount + 1, diff --git a/app/cdap/testids/TestidsProvider.tsx b/app/cdap/testids/TestidsProvider.tsx index 9d91c42a65a..3de961c2e46 100644 --- a/app/cdap/testids/TestidsProvider.tsx +++ b/app/cdap/testids/TestidsProvider.tsx @@ -18,6 +18,7 @@ import React, { useContext } from 'react'; import _get from 'lodash/get'; import testids from './testids.yaml'; import { DataTestIdGetter, TestidContext } from './TestidContext'; +import { objectQuery } from 'services/helpers'; interface ITestidProviderProps { children: React.ReactNode; @@ -30,7 +31,7 @@ function getDataTestidInternal(prefixPath: string, siblingKey?: string | number) // previously hardcoded testid values), for all newly added data-testids the value at the leaf node // should be null. - const actualTestidPrefix = _get(testids, prefixPath); + const actualTestidPrefix = objectQuery(testids, ...prefixPath.split('.')); // actualTestidPrefix is the value at the node of the prefix tree pointed by the prefixPath provided. // We need to ensure that the prefix path provided points to a leaf node. This can be ensured by checking diff --git a/app/cdap/testids/testids.yaml b/app/cdap/testids/testids.yaml index cb4094ff6c8..29ef6e64920 100644 --- a/app/cdap/testids/testids.yaml +++ b/app/cdap/testids/testids.yaml @@ -333,3 +333,6 @@ features: home: wrangler: pageLink: ~ + pipelineDetails: + runLevel: + currentRunIndex: ~