|
| 1 | +/** |
| 2 | + * @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com> |
| 3 | + * |
| 4 | + * @author John Molakvoæ <skjnldsv@protonmail.com> |
| 5 | + * |
| 6 | + * @license AGPL-3.0-or-later |
| 7 | + * |
| 8 | + * This program is free software: you can redistribute it and/or modify |
| 9 | + * it under the terms of the GNU Affero General Public License as |
| 10 | + * published by the Free Software Foundation, either version 3 of the |
| 11 | + * License, or (at your option) any later version. |
| 12 | + * |
| 13 | + * This program is distributed in the hope that it will be useful, |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | + * GNU Affero General Public License for more details. |
| 17 | + * |
| 18 | + * You should have received a copy of the GNU Affero General Public License |
| 19 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 20 | + * |
| 21 | + */ |
| 22 | + |
| 23 | +import { randHash } from '../utils/' |
| 24 | +const randUser = randHash() |
| 25 | + |
| 26 | +describe('Open image-apng.png in viewer', function() { |
| 27 | + before(function() { |
| 28 | + // Init user |
| 29 | + cy.nextcloudCreateUser(randUser, 'password') |
| 30 | + cy.login(randUser, 'password') |
| 31 | + |
| 32 | + // Upload test files |
| 33 | + cy.uploadFile('image-apng.png', 'image/png') |
| 34 | + cy.visit('/apps/files') |
| 35 | + |
| 36 | + // wait a bit for things to be settled |
| 37 | + cy.wait(1000) |
| 38 | + }) |
| 39 | + after(function() { |
| 40 | + cy.logout() |
| 41 | + }) |
| 42 | + |
| 43 | + it('See image-apng.png in the list', function() { |
| 44 | + cy.get('#fileList tr[data-file="image-apng.png"]', { timeout: 10000 }) |
| 45 | + .should('contain', 'image-apng.png') |
| 46 | + }) |
| 47 | + |
| 48 | + it('Open the viewer on file click', function() { |
| 49 | + cy.openFile('image-apng.png') |
| 50 | + cy.get('body > .viewer').should('be.visible') |
| 51 | + }) |
| 52 | + |
| 53 | + it('Does not see a loading animation', function() { |
| 54 | + cy.get('body > .viewer', { timeout: 10000 }) |
| 55 | + .should('be.visible') |
| 56 | + .and('have.class', 'modal-mask') |
| 57 | + .and('not.have.class', 'icon-loading') |
| 58 | + }) |
| 59 | + |
| 60 | + it('See the menu icon and title on the viewer header', function() { |
| 61 | + cy.get('body > .viewer .modal-title').should('contain', 'image-apng.png') |
| 62 | + cy.get('body > .viewer .modal-header button.action-item__menutoggle').should('be.visible') |
| 63 | + cy.get('body > .viewer .modal-header button.header-close').should('be.visible') |
| 64 | + }) |
| 65 | + |
| 66 | + it('Does not see navigation arrows', function() { |
| 67 | + cy.get('body > .viewer a.prev').should('not.be.visible') |
| 68 | + cy.get('body > .viewer a.next').should('not.be.visible') |
| 69 | + }) |
| 70 | +}) |
0 commit comments