Skip to content

Commit

Permalink
Fix functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
miltonhultgren committed Jun 3, 2022
1 parent a46b3d6 commit 21a4c73
Show file tree
Hide file tree
Showing 16 changed files with 22 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export function HealthStatusIndicator(props) {
return (
<EuiFlexGroup alignItems="center" gutterSize="s">
<EuiFlexItem grow={false}>
<EuiHealth color={statusColor} data-test-subj="statusIcon">
<EuiHealth color={statusColor} data-test-subj="status">
<HealthLabel {...props} />
</EuiHealth>
</EuiFlexItem>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ function statusIndicator(status, someStatusIsStale, instancesHref, staleStatusTh
<>
<div style={{ marginBottom: '8px' }}>
<EuiToolTip position="top" content={staleMessage}>
<EuiBadge iconType="alert" color="warning">
<EuiBadge iconType="alert" color="warning" data-test-subj="status">
{i18n.translate('xpack.monitoring.cluster.overview.kibanaPanel.staleStatusLabel', {
defaultMessage: 'Stale',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ function OverviewPageStatusIndicator({ staleMessage }) {

return (
<EuiStat
data-test-subj="status"
description={i18n.translate('xpack.monitoring.kibana.clusterStatus.overview.statusLabel', {
defaultMessage: 'Status',
})}
Expand Down Expand Up @@ -160,6 +161,7 @@ function InstancesPageStatusIndicator({ staleMessage }) {

return (
<EuiStat
data-test-subj="status"
description={i18n.translate('xpack.monitoring.kibana.clusterStatus.instances.statusLabel', {
defaultMessage: 'Status',
})}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export function DetailStatus({ stats }) {

return (
<EuiStat
data-test-subj="status"
description={description}
title={title}
titleSize="xxxs"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const getColumns = (
field: 'status',
render: (status: string) => {
return (
<EuiHealth color={statusIconColor(status)} data-test-subj="statusIcon">
<EuiHealth color={statusIconColor(status)} data-test-subj="status">
{capitalize(status)}
</EuiHealth>
);
Expand All @@ -140,7 +140,7 @@ const getColumns = (
},
});
return (
<span>
<span data-test-subj="lastSeen">
{lastSeenTimestamp}
{kibana.statusIsStale && (
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ export const DefaultStatusIndicator = ({ status, isOnline, IconComponent }) => {

return (
<EuiStat
data-test-subj="status"
title={
<Fragment>
<>
<IconComponent status={status} isOnline={isOnline} />
&nbsp;
{capitalize(status)}
</Fragment>
</>
}
titleSize="xxxs"
textAlign="left"
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/apps/monitoring/cluster/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default function ({ getService, getPageObjects }) {
});

it('shows kibana panel', async () => {
expect(await overview.getKbnStatus()).to.be('Healthy');
expect(await overview.getKbnStatus()).to.be('Stale');
expect(await overview.getKbnRequests()).to.be('174');
expect(await overview.getKbnMaxResponseTime()).to.be('2203 ms');
expect(await overview.getKbnInstances()).to.be('Instances: 1');
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/apps/monitoring/kibana/instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default function ({ getService, getPageObjects }) {
osFreeMemory: 'OS Free Memory\n1.5 GB',
version: 'Version\n7.0.0-alpha1',
uptime: 'Uptime\n3 minutes',
health: 'Health: green',
health: 'Last Reported Status\n Green\nStale',
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function ({ getService, getPageObjects }) {
osFreeMemory: 'OS Free Memory\n1.5 GB',
version: 'Version\n7.0.0-alpha1',
uptime: 'Uptime\n3 minutes',
health: 'Health: green',
health: 'Last Reported Status\n Green\nStale',
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/apps/monitoring/kibana/instances.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function ({ getService, getPageObjects }) {
requests: 'Requests\n174',
connections: 'Connections\n174',
maxResponseTime: 'Max. Response Time\n2203 ms',
health: 'Health: green',
health: 'Status\nStale',
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function ({ getService, getPageObjects }) {
requests: 'Requests\n174',
connections: 'Connections\n174',
maxResponseTime: 'Max. Response Time\n2203 ms',
health: 'Health: green',
health: 'Status\nStale',
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion x-pack/test/functional/apps/monitoring/kibana/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export default function ({ getService, getPageObjects }) {
requests: 'Requests\n174',
connections: 'Connections\n174',
maxResponseTime: 'Max. Response Time\n2203 ms',
health: 'Health: green',
health: 'Status\nStale\nView all instances',
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export default function ({ getService, getPageObjects }) {
requests: 'Requests\n174',
connections: 'Connections\n174',
maxResponseTime: 'Max. Response Time\n2203 ms',
health: 'Health: green',
health: 'Status\nStale\nView all instances',
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export function MonitoringClusterOverviewProvider({ getService }) {
const SUBJ_ES_ML_JOBS = `${SUBJ_ES_PANEL} > esMlJobs`;

const SUBJ_KBN_PANEL = `${SUBJ_CLUSTER_ITEM_CONTAINER_PREFIX}Kibana`;
const SUBJ_KBN_STATUS = `${SUBJ_KBN_PANEL} > statusIcon`;
const SUBJ_KBN_STATUS = `${SUBJ_KBN_PANEL} > status`;
const SUBJ_KBN_REQUESTS = `${SUBJ_KBN_PANEL} > kbnRequests`;
const SUBJ_KBN_MAX_RESPONSE_TIME = `${SUBJ_KBN_PANEL} > kbnMaxResponseTime`;
const SUBJ_KBN_CONNECTIONS = `${SUBJ_KBN_PANEL} > kbnConnections`;
Expand Down
4 changes: 2 additions & 2 deletions x-pack/test/functional/services/monitoring/kibana_instance.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function MonitoringKibanaInstanceProvider({ getService }) {
const SUBJ_SUMMARY_OS_FREE_MEMORY = `${SUBJ_SUMMARY} > osFreeMemory`;
const SUBJ_SUMMARY_VERSION = `${SUBJ_SUMMARY} > version`;
const SUBJ_SUMMARY_UPTIME = `${SUBJ_SUMMARY} > uptime`;
const SUBJ_SUMMARY_HEALTH = `${SUBJ_SUMMARY} > statusIcon`;
const SUBJ_SUMMARY_HEALTH = `${SUBJ_SUMMARY} > status`;

return new (class KibanaInstance {
async isOnInstance() {
Expand All @@ -30,7 +30,7 @@ export function MonitoringKibanaInstanceProvider({ getService }) {
osFreeMemory: await testSubjects.getVisibleText(SUBJ_SUMMARY_OS_FREE_MEMORY),
version: await testSubjects.getVisibleText(SUBJ_SUMMARY_VERSION),
uptime: await testSubjects.getVisibleText(SUBJ_SUMMARY_UPTIME),
health: await testSubjects.getAttribute(SUBJ_SUMMARY_HEALTH, 'alt'),
health: await testSubjects.getVisibleText(SUBJ_SUMMARY_HEALTH),
};
}
})();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function MonitoringKibanaSummaryStatusProvider({ getService }) {
const SUBJ_SUMMARY_REQUESTS = `${SUBJ_SUMMARY} > requests`;
const SUBJ_SUMMARY_CONNECTIONS = `${SUBJ_SUMMARY} > connections`;
const SUBJ_SUMMARY_MAX_RESPONSE_TIME = `${SUBJ_SUMMARY} > maxResponseTime`;
const SUBJ_SUMMARY_HEALTH = `${SUBJ_SUMMARY} > statusIcon`;
const SUBJ_SUMMARY_HEALTH = `${SUBJ_SUMMARY} > status`;

return new (class KibanaSummaryStatus {
async getContent() {
Expand All @@ -24,7 +24,7 @@ export function MonitoringKibanaSummaryStatusProvider({ getService }) {
requests: await testSubjects.getVisibleText(SUBJ_SUMMARY_REQUESTS),
connections: await testSubjects.getVisibleText(SUBJ_SUMMARY_CONNECTIONS),
maxResponseTime: await testSubjects.getVisibleText(SUBJ_SUMMARY_MAX_RESPONSE_TIME),
health: await testSubjects.getAttribute(SUBJ_SUMMARY_HEALTH, 'alt'),
health: await testSubjects.getVisibleText(SUBJ_SUMMARY_HEALTH),
};
}
})();
Expand Down

0 comments on commit 21a4c73

Please sign in to comment.