|
| 1 | +/** |
| 2 | + * --------------------------------------------------------------------- |
| 3 | + * |
| 4 | + * GLPI - Gestionnaire Libre de Parc Informatique |
| 5 | + * |
| 6 | + * http://glpi-project.org |
| 7 | + * |
| 8 | + * @copyright 2015-2024 Teclib' and contributors. |
| 9 | + * @copyright 2003-2014 by the INDEPNET Development Team. |
| 10 | + * @licence https://www.gnu.org/licenses/gpl-3.0.html |
| 11 | + * |
| 12 | + * --------------------------------------------------------------------- |
| 13 | + * |
| 14 | + * LICENSE |
| 15 | + * |
| 16 | + * This file is part of GLPI. |
| 17 | + * |
| 18 | + * This program is free software: you can redistribute it and/or modify |
| 19 | + * it under the terms of the GNU General Public License as published by |
| 20 | + * the Free Software Foundation, either version 3 of the License, or |
| 21 | + * (at your option) any later version. |
| 22 | + * |
| 23 | + * This program is distributed in the hope that it will be useful, |
| 24 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 25 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 26 | + * GNU General Public License for more details. |
| 27 | + * |
| 28 | + * You should have received a copy of the GNU General Public License |
| 29 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 30 | + * |
| 31 | + * --------------------------------------------------------------------- |
| 32 | + */ |
| 33 | + |
| 34 | +describe('Entity Selector', () => { |
| 35 | + beforeEach(() => { |
| 36 | + cy.login(); |
| 37 | + cy.changeProfile('Super-Admin'); |
| 38 | + }); |
| 39 | + it('Loads', () => { |
| 40 | + cy.visit('/'); |
| 41 | + cy.get('.user-menu-dropdown-toggle:visible').click(); |
| 42 | + cy.get('.entity-dropdown-toggle:visible').click(); |
| 43 | + cy.get('.entity-dropdown-toggle:visible').next().should('have.class', 'dropdown-menu').and('be.visible'); |
| 44 | + |
| 45 | + cy.get('.entity-dropdown-toggle:visible').next().within(() => { |
| 46 | + cy.get('h3').should('have.text', 'Select the desired entity'); |
| 47 | + cy.get('.alert').should('have.length', 2); |
| 48 | + cy.get('input[name="entsearchtext"]').should('be.visible').and('have.attr', 'placeholder', 'Search entity'); |
| 49 | + cy.get('.data_tree table tr').should('have.length.gte', 1); |
| 50 | + cy.get('.data_tree table a').contains('Root entity').should('exist'); |
| 51 | + }); |
| 52 | + }); |
| 53 | +}); |
0 commit comments