diff options
author | Vinicius Reis <vinicius.reis@nextcloud.com> | 2022-09-26 17:57:11 +0300 |
---|---|---|
committer | Jonas <jonas@nextcloud.com> | 2022-09-27 12:29:51 +0300 |
commit | 06baa6748a91b2f8be3e3d3aeed29256a3df095a (patch) | |
tree | fbcd5a829ca3e3259c3e4efc2409d9b7fa5d9751 /cypress | |
parent | 4cb2da3408ee6ec5a2f8a81845768b41630912ed (diff) |
🐛 (#2910): add mobile tests
formatting modal help
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
Diffstat (limited to 'cypress')
-rw-r--r-- | cypress/e2e/mobile.spec.js | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/cypress/e2e/mobile.spec.js b/cypress/e2e/mobile.spec.js new file mode 100644 index 000000000..b816bf528 --- /dev/null +++ b/cypress/e2e/mobile.spec.js @@ -0,0 +1,67 @@ +/** + * @copyright Copyright (c) 2019 Vinicius Reis <vinicius@nextcloud.com> + * + * @author Vinicius Reis <vinicius@nextcloud.com> + * + * @license AGPL-3.0-or-later + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +import { randHash } from '../utils/index.js' + +const currentUser = randHash() + +const getRemainItem = (name) => { + cy.getActionEntry('remain').click() + return cy.get('.v-popper__wrapper .open').getActionEntry(name) +} + +describe('Mobile actions', { + // moto g4 + viewportWidth: 360, + viewportHeight: 640, +}, () => { + before(() => { + cy.nextcloudCreateUser(currentUser, 'password') + }) + + beforeEach(function() { + cy.login(currentUser, 'password').then(() => { + // isolate tests - each happens in its own folder + const retry = cy.state('test').currentRetry() + const folderName = retry + ? `${Cypress.currentTest.title} (${retry})` + : Cypress.currentTest.title + cy.createFolder(folderName) + cy.uploadFile('test.md', 'text/markdown', `${encodeURIComponent(folderName)}/text.md`) + cy.visit(`apps/files?dir=/${encodeURIComponent(folderName)}`) + + cy.get('.files-controls .crumb:not(.hidden) a') + .last() + .click({ force: true }) + + cy.openFile('text.md', { force: true }) + }) + }) + + it('formatting modal help', () => { + getRemainItem('formatting-help').click() + + cy.get('[data-text-el="formatting-help"]').should('be.visible') + cy.get('[data-text-el="formatting-help"]').find('button[aria-label="Close modal"]').click() + cy.get('[data-text-el="formatting-help"]').should('not.exist') + }) +}) |