1 import { HostsPageHelper } from '../cluster/hosts.po';
3 describe('Hosts page', () => {
4 const hosts = new HostsPageHelper();
8 Cypress.Cookies.preserveOnce('token');
12 describe('when Orchestrator is available', () => {
13 beforeEach(function () {
14 cy.fixture('orchestrator/inventory.json').as('hosts');
15 cy.fixture('orchestrator/services.json').as('services');
18 it('should force enter host into maintenance', function () {
19 const hostname = Cypress._.sample(this.hosts).name;
20 const serviceList = new Array();
21 this.services.forEach((service: any) => {
22 if (hostname === service.hostname) {
23 serviceList.push(service.daemon_type);
27 let enterMaintenance = true;
28 serviceList.forEach((service: string) => {
29 if (service === 'mgr' || service === 'alertmanager') {
30 enterMaintenance = false;
34 if (enterMaintenance) {
35 hosts.maintenance(hostname, true, true);