Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .photofinish.toml
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,32 @@ files = [
"./test/fixtures/scenarios/hana-cluster-details/4b67842f-ccf7-46a4-a344-9e918648b117_ha_cluster_discovery_angi_failover.json",
]

[cluster-state-idle]

files = [
"./test/fixtures/scenarios/healthy-27-node-SAP-cluster/b767b3e9-e802-587e-a442-541d093b86b9_ha_cluster_discovery.json",
"./test/fixtures/scenarios/healthy-27-node-SAP-cluster/9cd46919-5f19-59aa-993e-cf3736c71053_ha_cluster_discovery.json",
]

[cluster-state-transition-engine]

files = [
"./test/fixtures/scenarios/hana-cluster-details/b767b3e9-e802-587e-a442-541d093b86b9_ha_cluster_discovery_transition_engine.json",
]

[cluster-state-policy-engine]

files = [
"./test/fixtures/scenarios/hana-cluster-details/b767b3e9-e802-587e-a442-541d093b86b9_ha_cluster_discovery_policy_engine.json",
]

[cluster-state-stopped]

files = [
"./test/fixtures/scenarios/hana-cluster-details/b767b3e9-e802-587e-a442-541d093b86b9_ha_cluster_discovery_offline.json",
"./test/fixtures/scenarios/hana-cluster-details/9cd46919-5f19-59aa-993e-cf3736c71053_ha_cluster_discovery_offline.json",
]

[host-details-vmhdbprd01]

files = [
Expand Down
13 changes: 13 additions & 0 deletions test/e2e/cypress/e2e/hana_cluster_details.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ context('HANA cluster details', () => {
});
});

describe('Cluster state', () => {
const states = ['stopped', 'transition-engine', 'policy-engine', 'idle'];

before(() => hanaClusterDetailsPage.visitAvailableHanaCluster());

states.forEach((state) => {
it(`should show the expected cluster ${state} state`, () => {
hanaClusterDetailsPage.loadScenario(`cluster-state-${state}`);
hanaClusterDetailsPage.expectedClusterStateIsDisplayed(state);
});
});
});

describe('Cluster sites should have the expected hosts', () => {
beforeEach(() => {
hanaClusterDetailsPage.interceptLastExecutionRequestMocked();
Expand Down
19 changes: 19 additions & 0 deletions test/e2e/cypress/pageObject/hana_cluster_details_po.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ const hostToDeregister = {

const catalog = catalogCheckFactory.buildList(5);

const clusterStates = {
idle: { displayedText: 'Idle', icon: 'jungle-green' },
stopped: { displayedText: 'Stopped', icon: 'gray' },
'transition-engine': { displayedText: 'Transition Engine', icon: 'red' },
'policy-engine': { displayedText: 'Policy Engine', icon: 'yellow' },
};

//Attributes

const url = '/clusters';
Expand Down Expand Up @@ -87,6 +94,8 @@ const checkName = (checkNameText) =>
`div[aria-label="accordion-header"] h3:contains("${checkNameText}")`;
const resourcesTable = 'tbody:eq(2)';
const resourcesRowCollapsibleCell = `${resourcesTable} td:nth-child(1)`;
const clusterStateLabel = 'span:contains("State:")';
const clusterStateBadge = `${clusterStateLabel} svg`;

// UI Interactions

Expand Down Expand Up @@ -387,6 +396,16 @@ export const expectedResourcesDisplayed = () => {
});
};

export const expectedClusterStateIsDisplayed = (state) => {
const { displayedText, icon } = clusterStates[state];
cy.get(clusterStateLabel).contains(displayedText);
cy.get(clusterStateBadge)
.invoke('attr', 'class')
.then((classAttr) => {
expect(classAttr).to.contain(icon);
});
};

export const sbdClusterHasExpectedNameAndStatus = () => {
availableHanaCluster.sbd.forEach((item) => {
cy.get('.tn-sbd-details')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"agent_id": "9cd46919-5f19-59aa-993e-cf3736c71053",
"discovery_type": "ha_cluster_discovery",
"payload": {
"Name": "hana_cluster_3",
"Id": "9c832998801e28cd70ad77380e82a5c0",
"Online": false
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"agent_id": "b767b3e9-e802-587e-a442-541d093b86b9",
"discovery_type": "ha_cluster_discovery",
"payload": {
"Name": "hana_cluster_3",
"Id": "9c832998801e28cd70ad77380e82a5c0",
"Online": false
}
}
Loading
Loading