version_creation.cy.ts 975 B

123456789101112131415161718192021222324252627282930313233
  1. /**
  2. * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
  3. * SPDX-License-Identifier: AGPL-3.0-or-later
  4. */
  5. import { openVersionsPanel, uploadThreeVersions } from './filesVersionsUtils'
  6. describe('Versions creation', () => {
  7. let randomFileName = ''
  8. before(() => {
  9. randomFileName = Math.random().toString(36).replace(/[^a-z]+/g, '').substring(0, 10) + '.txt'
  10. cy.createRandomUser()
  11. .then((user) => {
  12. uploadThreeVersions(user, randomFileName)
  13. cy.login(user)
  14. cy.visit('/apps/files')
  15. openVersionsPanel(randomFileName)
  16. })
  17. })
  18. it('Opens the versions panel and sees the versions', () => {
  19. cy.visit('/apps/files')
  20. openVersionsPanel(randomFileName)
  21. cy.get('#tab-version_vue').within(() => {
  22. cy.get('[data-files-versions-version]').should('have.length', 3)
  23. cy.get('[data-files-versions-version]').eq(0).contains('Current version')
  24. cy.get('[data-files-versions-version]').eq(2).contains('Initial version')
  25. })
  26. })
  27. })