diff options
author | Louis Chemineau <louis@chmn.me> | 2023-05-24 11:54:47 +0200 |
---|---|---|
committer | Louis Chemineau <louis@chmn.me> | 2023-06-05 18:12:50 +0200 |
commit | 5e50009b4451fc50ca3c0321d91d2e98fee75aaa (patch) | |
tree | d7461fccff43ebed53fce0365a53127af0edf5ab /cypress | |
parent | fedd3aebcf64fbcf3348a0b71f5c6940e8b01a8c (diff) |
Test adding files to a shared album from timeline
Signed-off-by: Louis Chemineau <louis@chmn.me>
Diffstat (limited to 'cypress')
-rw-r--r-- | cypress/e2e/timelines.cy.js | 48 |
1 files changed, 41 insertions, 7 deletions
diff --git a/cypress/e2e/timelines.cy.js b/cypress/e2e/timelines.cy.js index 25a3bb2f..be219c09 100644 --- a/cypress/e2e/timelines.cy.js +++ b/cypress/e2e/timelines.cy.js @@ -19,8 +19,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * */ +import { User } from '@nextcloud/cypress' import { + addCollaborators, addFilesToAlbumFromTimeline, + createAnAlbumFromAlbums, createAnAlbumFromTimeline, deleteAnAlbumFromAlbumContent, goToAlbum, @@ -35,6 +38,12 @@ import { unselectMedia, uploadTestMedia, } from './photosUtils' +import { + goToSharedAlbum, +} from './sharedAlbumUtils' +import { + randHash, +} from '../utils/index.js' const resizeObserverLoopErrRe = /^[^(ResizeObserver loop limit exceeded)]/ Cypress.on('uncaught:exception', (err) => { @@ -44,18 +53,22 @@ Cypress.on('uncaught:exception', (err) => { } }) +const alice = new User(`alice_${randHash()}`) +const bob = new User(`bob_${randHash()}`) + describe('View list of photos in the main timeline', () => { before(() => { - cy.createRandomUser() - .then((user) => { - uploadTestMedia(user) - cy.login(user) - cy.visit('/apps/photos') - }) + cy.createUser(alice).then(() => { + uploadTestMedia(alice) + }) + cy.createUser(bob).then(() => { + uploadTestMedia(bob) + }) + cy.login(alice) }) beforeEach(() => { - cy.visit(`${Cypress.env('baseUrl')}/index.php/apps/photos`) + cy.visit('/apps/photos') }) it('Favorite a file from a timeline', () => { @@ -107,6 +120,27 @@ describe('View list of photos in the main timeline', () => { deleteAnAlbumFromAlbumContent() }) + it('Add file to a shared album from a timeline', () => { + cy.visit('apps/photos/albums') + createAnAlbumFromAlbums('timeline_test_shared_album') + addCollaborators([bob.userId]) + cy.login(bob) + cy.visit('apps/photos') + selectMedia([0]) + addFilesToAlbumFromTimeline('timeline_test_shared_album') + goToSharedAlbum('timeline_test_shared_album') + cy.get('[data-test="media"]').should('have.length', 1) + }) + + it('Add multiple files to a shared album from a timeline', () => { + cy.login(bob) + cy.visit('apps/photos') + selectMedia([1, 2]) + addFilesToAlbumFromTimeline('timeline_test_shared_album') + goToSharedAlbum('timeline_test_shared_album') + cy.get('[data-test="media"]').should('have.length', 3) + }) + it('Delete a file from photos', () => { cy.get('[data-test="media"]').should('have.length', 5) selectMedia([0]) |