Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
Add e2e tests for the host details view
Browse files Browse the repository at this point in the history
  • Loading branch information
rtorrero committed Jan 20, 2022
1 parent 685ee23 commit 05b5973
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 0 deletions.
48 changes: 48 additions & 0 deletions test/e2e/cypress/fixtures/host-details/host_details.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Feature: Host details view
This is where the user has a detailed view of the status of one specific host in the deployed SAP System

Background:
Given an healthy SAP deployment of 27 hosts having following agent ids and hostnames
# a09d9cf3-46c1-505c-8fb8-4b0a71a9114e => vmdrbdprd01
# 927901fa-2c87-524e-b18c-3ef5187f504f => vmdrbdprd02
# 116d49bd-85e1-5e59-b820-83f66db8800c => vmnwprd01
# 4b30a6af-4b52-5bda-bccb-f2248a12c992 => vmnwprd02
# a3297d85-5e8b-5ac5-b8a3-55eebc2b8d12 => vmnwprd03
# 0fc07435-7ee2-54ca-b0de-fb27ffdc5deb => vmnwprd04
# 9cd46919-5f19-59aa-993e-cf3736c71053 => vmhdbprd01
# b767b3e9-e802-587e-a442-541d093b86b9 => vmhdbprd02
# ddcb7992-2ffb-5c10-8b39-80685f6eaaba => vmdrbdqas01
# 422686d6-b2d1-5092-93e8-a744854f5085 => vmdrbdqas02
# 25677e37-fd33-5005-896c-9275b1284534 => vmnwqas01
# 3711ea88-9ccc-5b07-8f9d-042be449d72b => vmnwqas02
# 098fc159-3ed6-58e7-91be-38fda8a833ea => vmnwqas03
# 81e9b629-c1e7-538f-bff1-47d3a6580522 => vmnwqas04
# 99cf8a3a-48d6-57a4-b302-6e4482227ab6 => vmhdbqas01
# e0c182db-32ff-55c6-a9eb-2b82dd21bc8b => vmhdbqas02
# 240f96b1-8d26-53b7-9e99-ffb0f2e735bf => vmdrbddev01
# 21de186a-e38f-5804-b643-7f4ef22fecfd => vmdrbddev02
# 7269ee51-5007-5849-aaa7-7c4a98b0c9ce => vmnwdev01
# fb2c6b8a-9915-5969-a6b7-8b5a42de1971 => vmnwdev02
# 9a3ec76a-dd4f-5013-9cf0-5eb4cf89898f => vmnwdev03
# 1b0e9297-97dd-55d6-9874-8efde4d84c90 => vmnwdev04
# 13e8c25c-3180-5a9a-95c8-51ec38e50cfc => vmhdbdev01
# 0a055c90-4cb6-54ce-ac9c-ae3fedaf40d4 => vmhdbdev02
# 69f4dcbb-efa2-5a16-8bc8-01df7dbb7384 => vmiscsi01
# f0c808b3-d869-5192-a944-20f66a6a8449 => vmiscsi01
# 9a26b6d0-6e72-597c-9fe5-152a6875f214 => vmiscsi01
And a Trento installation on this Cluster

Scenario: Detailed view of one specific host is available
When I navigate to a specific host (/hosts/9cd46919-5f19-59aa-993e-cf3736c71053)
Then the displayed host should match the one I clicked

Scenario: Host details are available in the view
Given I am in the host details view (/hosts/9cd46919-5f19-59aa-993e-cf3736c71053)
Then the displayed details should include a SAP system with SID equal to HDP
And a Cluster with name `hana_cluster` should be under the cluster label
And one entry with ID 14f65ee5b3a07a320272b47c7c5d4be6 should be present in the SAP instances list

Scenario: Cloud details are available in the view
Given I am in the host details view (/hosts/9cd46919-5f19-59aa-993e-cf3736c71053)
Then the displayed details should include a VMName matching the hostname vmhdbprd01
And a Resource group named resourceGroupName
13 changes: 13 additions & 0 deletions test/e2e/cypress/fixtures/host-details/selected_host.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const selectedHost = {
agentId: '9cd46919-5f19-59aa-993e-cf3736c71053',
hostName: 'vmhdbprd01',
sapSystem: 'HDP',
clusterName: 'hana_cluster',
resourceGroup: 'resourceGroupName',
}

export const agentId = () => selectedHost.agentId;
export const hostName = () => selectedHost.hostName;
export const sapSystem = () => selectedHost.sapSystem;
export const clusterName = () => selectedHost.clusterName;
export const resourceGroup = () => selectedHost.resourceGroup;
48 changes: 48 additions & 0 deletions test/e2e/cypress/integration/host_details.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { hostName, agentId, sapSystem, clusterName, resourceGroup } from '../fixtures/host-details/selected_host'

context('Host Details', () => {
const selectedHostName = hostName()
const selectedHostAgentId = agentId()
const selectedHostSapSystem = sapSystem()
const selectedHostClusterName = clusterName()
const selectedResourceGroup = resourceGroup()

before(() => {
cy.resetDatabase()
cy.loadScenario('healthy-27-node-SAP-cluster')

cy.visit('/');
cy.navigateToItem('Hosts')
cy.intercept('GET', `/hosts/${selectedHostAgentId}`).as('getHostDetails')
cy.get(`#host-${selectedHostName} > .tn-hostname > a`).click()
cy.wait('@getHostDetails')
cy.url().should('include', `/hosts/${selectedHostAgentId}`);
})

describe('Detailed view for a specific host should be available', () => {
it('should show the host I clicked on in the overview', () => {
cy.get('.border-top > :nth-child(1) > .col-sm-12 > .row > :nth-child(1) > .text-muted').should('contain', 'vmhdbprd01')
})
})

describe('SAP instances for this host should be displayed', () => {
it('should show `HDP` under the SAP Systems label', () => {
cy.get(':nth-child(2) > .text-muted > a').should('contain', 'HDP')
})
it('should show SAP instance with ID 1154f7678ac587e5f0f242830a5201f1', () => {
cy.get(':nth-child(11) > .table > tbody > tr > :nth-child(1)').should('contain', '1154f7678ac587e5f0f242830a5201f1')
})
it('should show Cluster with name hana_cluster', () => {
cy.get(':nth-child(3) > .text-muted > a').should('contain', 'hana_cluster')
})
})

describe('Cloud details for this host should be displayed', () => {
it('should show `vmhdbprd01` under the VM Name', () => {
cy.get(':nth-child(5) > :nth-child(1) > .col-sm-12 > :nth-child(1) > :nth-child(2) > .text-muted').should('contain', 'vmhdbprd01')
})
it('should show `resourceGroupName` under the Resource group label', () => {
cy.get(':nth-child(5) > :nth-child(1) > .col-sm-12 > :nth-child(1) > :nth-child(3) > .text-muted').should('contain', 'resourceGroupName')
})
})
});

0 comments on commit 05b5973

Please sign in to comment.