github.com/rancher/elemental/tests@v0.0.0-20240517125144-ae048c615b3f/cypress/latest/e2e/unit_tests/menu.spec.ts (about) 1 /* 2 Copyright © 2022 - 2024 SUSE LLC 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 http://www.apache.org/licenses/LICENSE-2.0 8 Unless required by applicable law or agreed to in writing, software 9 distributed under the License is distributed on an "AS IS" BASIS, 10 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 See the License for the specific language governing permissions and 12 limitations under the License. 13 */ 14 15 import { Elemental } from '~/support/elemental'; 16 import '~/support/commands'; 17 import filterTests from '~/support/filterTests.js'; 18 import * as cypressLib from '@rancher-ecp-qa/cypress-library'; 19 import { qase } from 'cypress-qase-reporter/dist/mocha'; 20 21 filterTests(['main'], () => { 22 Cypress.config(); 23 describe('Menu testing', () => { 24 const elemental = new Elemental(); 25 const elementalUser = "elemental-user" 26 const uiAccount = Cypress.env('ui_account'); 27 const uiPassword = "rancherpassword" 28 29 beforeEach(() => { 30 (uiAccount == "user") ? cy.login(elementalUser, uiPassword) : cy.login(); 31 cy.visit('/'); 32 cypressLib.burgerMenuToggle(); 33 }); 34 35 qase(2, 36 it('Check Elemental logo', () => { 37 // Elemental's icon should appear in the side menu 38 cypressLib.checkNavIcon('elemental') 39 .should('exist'); 40 }) 41 ); 42 43 qase(3, 44 it('Check Elemental menu', () => { 45 // Elemental's icon should appear in the side menu 46 cypressLib.checkNavIcon('elemental') 47 .should('exist'); 48 49 // Click on the Elemental's icon 50 cypressLib.accesMenu('OS Management'); 51 52 // Check Elemental's side menu 53 elemental.checkElementalNav(); 54 }) 55 ); 56 }); 57 });