0
0
mirror of https://github.com/nextcloud/server.git synced 2024-12-29 16:38:28 +00:00
nextcloud_server/cypress/e2e/files_sharing/public-share/copy-move-files.cy.ts
Ferdinand Thiessen 4a90d5328c
test: Add end-to-end tests for new public share Vue UI
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2024-09-06 03:38:48 +02:00

50 lines
1.5 KiB
TypeScript

/*!
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { copyFile, getRowForFile, moveFile, navigateToFolder } from '../../files/FilesUtils.ts'
import { getShareUrl, setupPublicShare } from './setup-public-share.ts'
describe('files_sharing: Public share - copy and move files', { testIsolation: true }, () => {
beforeEach(() => {
setupPublicShare()
.then(() => cy.logout())
.then(() => cy.visit(getShareUrl()))
})
it('Can copy a file to new folder', () => {
getRowForFile('foo.txt').should('be.visible')
getRowForFile('subfolder').should('be.visible')
copyFile('foo.txt', 'subfolder')
// still visible
getRowForFile('foo.txt').should('be.visible')
navigateToFolder('subfolder')
cy.url().should('contain', 'dir=/subfolder')
getRowForFile('foo.txt').should('be.visible')
getRowForFile('bar.txt').should('be.visible')
getRowForFile('subfolder').should('not.exist')
})
it('Can move a file to new folder', () => {
getRowForFile('foo.txt').should('be.visible')
getRowForFile('subfolder').should('be.visible')
moveFile('foo.txt', 'subfolder')
// wait until visible again
getRowForFile('subfolder').should('be.visible')
// file should be moved -> not exist anymore
getRowForFile('foo.txt').should('not.exist')
navigateToFolder('subfolder')
cy.url().should('contain', 'dir=/subfolder')
getRowForFile('foo.txt').should('be.visible')
getRowForFile('subfolder').should('not.exist')
})
})