From bd132dd853fa8ae755a40b96866426004023d7bc Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez Date: Fri, 14 Oct 2022 10:48:06 +0200 Subject: [PATCH 1/2] Add end-to-end tests for KVM & Nutanix cloud providers --- .../cypress/fixtures/host-details/selected_host.js | 6 ++++++ test/e2e/cypress/integration/host_details.js | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/test/e2e/cypress/fixtures/host-details/selected_host.js b/test/e2e/cypress/fixtures/host-details/selected_host.js index c87e51bff5..4b263bf71a 100644 --- a/test/e2e/cypress/fixtures/host-details/selected_host.js +++ b/test/e2e/cypress/fixtures/host-details/selected_host.js @@ -34,6 +34,12 @@ export const selectedHost = { zone: 'europe-west1-b', network: 'network', }, + kvmCloudDetails: { + provider: 'kvm', + }, + nutanixCloudDetails: { + provider: 'nutanix', + }, sapInstance: { id: '6c9208eb-a5bb-57ef-be5c-6422dedab602', sid: 'HDP', diff --git a/test/e2e/cypress/integration/host_details.js b/test/e2e/cypress/integration/host_details.js index b9c5593894..8f12eaadbb 100644 --- a/test/e2e/cypress/integration/host_details.js +++ b/test/e2e/cypress/integration/host_details.js @@ -168,6 +168,18 @@ context('Host Details', () => { .should('contain', selectedHost.gcpCloudDetails.network); }); + it(`should show KVM cloud details correctly`, () => { + cy.loadScenario('host-details-kvm'); + + cy.get('div').should('contain', selectedHost.kvmCloudDetails.provider); + }); + + it(`should show Nutanix cloud details correctly`, () => { + cy.loadScenario('host-details-nutanix'); + + cy.get('div').should('contain', selectedHost.nutanixCloudDetails.provider); + }); + it(`should display provider not recognized message`, () => { cy.loadScenario('host-details-unknown'); From 9a801defdfa28ca4e9f2a4d4841783be332fbcc1 Mon Sep 17 00:00:00 2001 From: Jamie Rodriguez Date: Fri, 14 Oct 2022 11:19:21 +0200 Subject: [PATCH 2/2] Make check selector more specific --- test/e2e/cypress/integration/host_details.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/e2e/cypress/integration/host_details.js b/test/e2e/cypress/integration/host_details.js index 8f12eaadbb..d374a1929f 100644 --- a/test/e2e/cypress/integration/host_details.js +++ b/test/e2e/cypress/integration/host_details.js @@ -171,13 +171,19 @@ context('Host Details', () => { it(`should show KVM cloud details correctly`, () => { cy.loadScenario('host-details-kvm'); - cy.get('div').should('contain', selectedHost.kvmCloudDetails.provider); + cy.get('div') + .contains(/^Provider$/) + .next() + .should('contain', selectedHost.kvmCloudDetails.provider); }); it(`should show Nutanix cloud details correctly`, () => { cy.loadScenario('host-details-nutanix'); - cy.get('div').should('contain', selectedHost.nutanixCloudDetails.provider); + cy.get('div') + .contains(/^Provider$/) + .next() + .should('contain', selectedHost.nutanixCloudDetails.provider); }); it(`should display provider not recognized message`, () => {