adds locators

This commit is contained in:
Alex Corey
2021-08-10 10:18:25 -04:00
parent b4243c6f03
commit 34d0595bab
3 changed files with 11 additions and 2 deletions

View File

@@ -85,6 +85,7 @@ function HostListItem({
<ExpandableRowContent> <ExpandableRowContent>
<DetailList gutter="sm"> <DetailList gutter="sm">
<Detail <Detail
dataCy={`${host.name}-activity`}
label={t`Activity`} label={t`Activity`}
value={ value={
recentJobs.length > 0 ? ( recentJobs.length > 0 ? (

View File

@@ -12,6 +12,7 @@ const surveyData = {
description: 'description for survey', description: 'description for survey',
spec: [ spec: [
{ question_name: 'Foo', type: 'text', default: 'Bar', variable: 'foo' }, { question_name: 'Foo', type: 'text', default: 'Bar', variable: 'foo' },
{ question_name: 'Bizz', type: 'text', default: 'bazz', variable: 'bizz' },
], ],
}; };

View File

@@ -25,6 +25,7 @@ function SurveyListItem({ canEdit, question, isChecked, onSelect, rowIndex }) {
return ( return (
<Tr> <Tr>
<Td <Td
data-cy={`${question.variable}-select`}
select={{ select={{
rowIndex, rowIndex,
isSelected: isChecked, isSelected: isChecked,
@@ -32,7 +33,11 @@ function SurveyListItem({ canEdit, question, isChecked, onSelect, rowIndex }) {
}} }}
dataLabel={t`Selected`} dataLabel={t`Selected`}
/> />
<Td id={`survey-list-item-${question.variable}`} dataLabel={t`Name`}> <Td
data-cy={`${question.variable}-name`}
id={`survey-list-item-${question.variable}`}
dataLabel={t`Name`}
>
<> <>
<Link <Link
to={`survey/edit?question_variable=${encodeURIComponent( to={`survey/edit?question_variable=${encodeURIComponent(
@@ -52,7 +57,9 @@ function SurveyListItem({ canEdit, question, isChecked, onSelect, rowIndex }) {
)} )}
</> </>
</Td> </Td>
<Td dataLabel={t`Type`}>{question.type}</Td> <Td data-cy={`${question.variable}-type`} dataLabel={t`Type`}>
{question.type}
</Td>
<Td dataLabel={t`Default`}> <Td dataLabel={t`Default`}>
{[question.type].includes('password') && ( {[question.type].includes('password') && (
<span>{t`encrypted`.toUpperCase()}</span> <span>{t`encrypted`.toUpperCase()}</span>