Skip to content

Commit

Permalink
Add additional e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
arbulu89 committed Nov 7, 2024
1 parent 756ad20 commit 905cd11
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions test/e2e/cypress/e2e/hosts_overview.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,28 +354,39 @@ context('Hosts Overview', () => {
});

describe('Movement of application instances on hosts', () => {
const sapSystemHostToDeregister = {
id: '7269ee51-5007-5849-aaa7-7c4a98b0c9ce',
const sapSystemHostsToDeregister = {
sid: 'NWD',
hostname: 'vmnwdev01',
movedHostId: 'fb2c6b8a-9915-5969-a6b7-8b5a42de1971',
initialHostId: '7269ee51-5007-5849-aaa7-7c4a98b0c9ce',
initialHostname: 'vmnwdev01',
};

before(() => {
cy.visit('/hosts');
cy.url().should('include', '/hosts');
cy.loadScenario(`sapsystem-${sapSystemHostToDeregister.sid}-restore`);
cy.loadScenario(
`sapsystem-${sapSystemHostsToDeregister.sid}-restore`
);
cy.loadScenario('sap-systems-overview-moved');
});

after(() => {
cy.loadScenario(`sapsystem-${sapSystemHostToDeregister.sid}-restore`);
cy.loadScenario(
`sapsystem-${sapSystemHostsToDeregister.sid}-restore`
);
});

it('should not impact host deregistration', () => {
cy.loadScenario('sap-systems-overview-moved');
it('should associate instances to the correct host during deregistration', () => {
cy.get(NEXT_PAGE_SELECTOR).click();
cy.contains('a', sapSystemHostToDeregister.hostname).should('exist');
cy.deregisterHost(sapSystemHostToDeregister.id);
cy.contains('a', sapSystemHostToDeregister.hostname).should(
cy.contains('a', sapSystemHostsToDeregister.sid).should('exist');
cy.deregisterHost(sapSystemHostsToDeregister.movedHostId);
cy.contains('a', sapSystemHostsToDeregister.sid).should('not.exist');
});

it('should complete host deregistration when all instances are moved out', () => {
cy.contains('a', sapSystemHostsToDeregister.hostname).should('exist');
cy.deregisterHost(sapSystemHostsToDeregister.initialHostId);
cy.contains('a', sapSystemHostsToDeregister.initialHostname).should(
'not.exist'
);
});
Expand Down

0 comments on commit 905cd11

Please sign in to comment.