mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
add schedule integration test locators
This commit is contained in:
parent
1e952bab95
commit
16da9b784a
@ -83,6 +83,8 @@ export default function FrequencyDetails({
|
||||
6: t`Sunday`,
|
||||
};
|
||||
|
||||
const prefix = isException ? `exception-${type}` : `frequency-${type}`;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Label>{label}</Label>
|
||||
@ -90,6 +92,7 @@ export default function FrequencyDetails({
|
||||
<Detail
|
||||
label={isException ? t`Skip every` : t`Run every`}
|
||||
value={getRunEveryLabel()}
|
||||
dataCy={`${prefix}-run-every`}
|
||||
/>
|
||||
{type === 'week' ? (
|
||||
<Detail
|
||||
@ -98,10 +101,15 @@ export default function FrequencyDetails({
|
||||
.sort(sortWeekday)
|
||||
.map((d) => weekdays[d.weekday])
|
||||
.join(', ')}
|
||||
dataCy={`${prefix}-days-of-week`}
|
||||
/>
|
||||
) : null}
|
||||
<RunOnDetail type={type} options={options} />
|
||||
<Detail label={t`End`} value={getEndValue(type, options, timezone)} />
|
||||
<RunOnDetail type={type} options={options} prefix={prefix} />
|
||||
<Detail
|
||||
label={t`End`}
|
||||
value={getEndValue(type, options, timezone)}
|
||||
dataCy={`${prefix}-end`}
|
||||
/>
|
||||
</DetailList>
|
||||
</div>
|
||||
);
|
||||
@ -113,11 +121,15 @@ function sortWeekday(a, b) {
|
||||
return a.weekday - b.weekday;
|
||||
}
|
||||
|
||||
function RunOnDetail({ type, options }) {
|
||||
function RunOnDetail({ type, options, prefix }) {
|
||||
if (type === 'month') {
|
||||
if (options.runOn === 'day') {
|
||||
return (
|
||||
<Detail label={t`Run on`} value={t`Day ${options.runOnDayNumber}`} />
|
||||
<Detail
|
||||
label={t`Run on`}
|
||||
value={t`Day ${options.runOnDayNumber}`}
|
||||
dataCy={`${prefix}-run-on-day`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
const dayOfWeek = options.runOnTheDay;
|
||||
@ -138,6 +150,7 @@ function RunOnDetail({ type, options }) {
|
||||
/>
|
||||
)
|
||||
}
|
||||
dataCy={`${prefix}-run-on-day`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -161,6 +174,7 @@ function RunOnDetail({ type, options }) {
|
||||
<Detail
|
||||
label={t`Run on`}
|
||||
value={`${months[options.runOnTheMonth]} ${options.runOnDayMonth}`}
|
||||
dataCy={`${prefix}-run-on-day`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -195,6 +209,7 @@ function RunOnDetail({ type, options }) {
|
||||
/>
|
||||
)
|
||||
}
|
||||
dataCy={`${prefix}-run-on-day`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
@ -278,64 +278,84 @@ function ScheduleDetail({ hasDaysToKeepField, schedule, surveyConfig }) {
|
||||
isDisabled={isDisabled}
|
||||
/>
|
||||
<DetailList gutter="sm">
|
||||
<Detail label={t`Name`} value={name} />
|
||||
<Detail label={t`Description`} value={description} />
|
||||
<Detail label={t`Name`} value={name} dataCy="schedule-name" />
|
||||
<Detail
|
||||
label={t`Description`}
|
||||
value={description}
|
||||
dataCy="schedule-description"
|
||||
/>
|
||||
<Detail
|
||||
label={t`First Run`}
|
||||
value={formatDateString(dtstart, timezone)}
|
||||
dataCy="schedule-first-run"
|
||||
/>
|
||||
<Detail
|
||||
label={t`Next Run`}
|
||||
value={formatDateString(next_run, timezone)}
|
||||
dataCy="schedule-next-run"
|
||||
/>
|
||||
<Detail label={t`Last Run`} value={formatDateString(dtend, timezone)} />
|
||||
<Detail
|
||||
label={t`Local Time Zone`}
|
||||
value={timezone}
|
||||
helpText={helpText.localTimeZone(config)}
|
||||
dataCy="schedule-timezone"
|
||||
/>
|
||||
<Detail
|
||||
label={t`Repeat Frequency`}
|
||||
value={repeatFrequency}
|
||||
dataCy="schedule-repeat-frequency"
|
||||
/>
|
||||
<Detail label={t`Repeat Frequency`} value={repeatFrequency} />
|
||||
<Detail
|
||||
label={t`Exception Frequency`}
|
||||
value={exceptionRepeatFrequency}
|
||||
dataCy="schedule-exception-frequency"
|
||||
/>
|
||||
</DetailList>
|
||||
{frequency.length ? (
|
||||
<FrequencyDetailsContainer>
|
||||
<p>
|
||||
<strong>{t`Frequency Details`}</strong>
|
||||
</p>
|
||||
{frequency.map((freq) => (
|
||||
<FrequencyDetails
|
||||
key={freq}
|
||||
type={freq}
|
||||
label={frequencies[freq]}
|
||||
options={frequencyOptions[freq]}
|
||||
timezone={timezone}
|
||||
/>
|
||||
))}
|
||||
<div ouia-component-id="schedule-frequency-details">
|
||||
<p>
|
||||
<strong>{t`Frequency Details`}</strong>
|
||||
</p>
|
||||
{frequency.map((freq) => (
|
||||
<FrequencyDetails
|
||||
key={freq}
|
||||
type={freq}
|
||||
label={frequencies[freq]}
|
||||
options={frequencyOptions[freq]}
|
||||
timezone={timezone}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</FrequencyDetailsContainer>
|
||||
) : null}
|
||||
{exceptionFrequency.length ? (
|
||||
<FrequencyDetailsContainer>
|
||||
<p css="border-top: 0">
|
||||
<strong>{t`Frequency Exception Details`}</strong>
|
||||
</p>
|
||||
{exceptionFrequency.map((freq) => (
|
||||
<FrequencyDetails
|
||||
key={freq}
|
||||
type={freq}
|
||||
label={frequencies[freq]}
|
||||
options={exceptionOptions[freq]}
|
||||
timezone={timezone}
|
||||
isException
|
||||
/>
|
||||
))}
|
||||
<div ouia-component-id="schedule-exception-details">
|
||||
<p css="border-top: 0">
|
||||
<strong>{t`Frequency Exception Details`}</strong>
|
||||
</p>
|
||||
{exceptionFrequency.map((freq) => (
|
||||
<FrequencyDetails
|
||||
key={freq}
|
||||
type={freq}
|
||||
label={frequencies[freq]}
|
||||
options={exceptionOptions[freq]}
|
||||
timezone={timezone}
|
||||
isException
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
</FrequencyDetailsContainer>
|
||||
) : null}
|
||||
<DetailList gutter="sm">
|
||||
{hasDaysToKeepField ? (
|
||||
<Detail label={t`Days of Data to Keep`} value={daysToKeep} />
|
||||
<Detail
|
||||
label={t`Days of Data to Keep`}
|
||||
value={daysToKeep}
|
||||
dataCy="schedule-days-to-keep"
|
||||
/>
|
||||
) : null}
|
||||
<ScheduleOccurrences preview={preview} tz={timezone} />
|
||||
<UserDateDetail
|
||||
@ -355,7 +375,11 @@ function ScheduleDetail({ hasDaysToKeepField, schedule, surveyConfig }) {
|
||||
<PromptDivider />
|
||||
<PromptDetailList>
|
||||
{ask_job_type_on_launch && (
|
||||
<Detail label={t`Job Type`} value={job_type} />
|
||||
<Detail
|
||||
label={t`Job Type`}
|
||||
value={job_type}
|
||||
dataCy="shedule-job-type"
|
||||
/>
|
||||
)}
|
||||
{showInventoryDetail && (
|
||||
<Detail
|
||||
@ -375,19 +399,31 @@ function ScheduleDetail({ hasDaysToKeepField, schedule, surveyConfig }) {
|
||||
' '
|
||||
)
|
||||
}
|
||||
dataCy="schedule-inventory"
|
||||
/>
|
||||
)}
|
||||
{ask_verbosity_on_launch && (
|
||||
<Detail label={t`Verbosity`} value={VERBOSITY()[verbosity]} />
|
||||
<Detail
|
||||
label={t`Verbosity`}
|
||||
value={VERBOSITY()[verbosity]}
|
||||
dataCy="schedule-verbosity"
|
||||
/>
|
||||
)}
|
||||
{ask_scm_branch_on_launch && (
|
||||
<Detail label={t`Source Control Branch`} value={scm_branch} />
|
||||
<Detail
|
||||
label={t`Source Control Branch`}
|
||||
value={scm_branch}
|
||||
dataCy="schedule-scm-branch"
|
||||
/>
|
||||
)}
|
||||
{ask_limit_on_launch && (
|
||||
<Detail label={t`Limit`} value={limit} dataCy="schedule-limit" />
|
||||
)}
|
||||
{ask_limit_on_launch && <Detail label={t`Limit`} value={limit} />}
|
||||
{showDiffModeDetail && (
|
||||
<Detail
|
||||
label={t`Show Changes`}
|
||||
value={diff_mode ? t`On` : t`Off`}
|
||||
dataCy="schedule-show-changes"
|
||||
/>
|
||||
)}
|
||||
{showCredentialsDetail && (
|
||||
@ -410,6 +446,7 @@ function ScheduleDetail({ hasDaysToKeepField, schedule, surveyConfig }) {
|
||||
))}
|
||||
</ChipGroup>
|
||||
}
|
||||
dataCy="schedule-credentials"
|
||||
/>
|
||||
)}
|
||||
{showTagsDetail && (
|
||||
@ -433,6 +470,7 @@ function ScheduleDetail({ hasDaysToKeepField, schedule, surveyConfig }) {
|
||||
))}
|
||||
</ChipGroup>
|
||||
}
|
||||
dataCy="schedule-job-tags"
|
||||
/>
|
||||
)}
|
||||
{showSkipTagsDetail && (
|
||||
@ -456,6 +494,7 @@ function ScheduleDetail({ hasDaysToKeepField, schedule, surveyConfig }) {
|
||||
))}
|
||||
</ChipGroup>
|
||||
}
|
||||
dataCy="schedule-skip-tags"
|
||||
/>
|
||||
)}
|
||||
{showVariablesDetail && (
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user