Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cypress.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ export default defineConfig({
viewportWidth: 1280,
viewportHeight: 720,

requestTimeout: 20000,

retries: {
runMode: 5,
runMode: 0,
// do not retry in `cypress open`
openMode: 0,
},
Expand All @@ -36,8 +38,6 @@ export default defineConfig({
trashAssetsBeforeRuns: true,

e2e: {
testIsolation: false,

// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
async setupNodeEvents(on, config) {
Expand Down Expand Up @@ -84,7 +84,7 @@ export default defineConfig({

// Before the browser launches
// starting Nextcloud testing container
const ip = await startNextcloud(process.env.BRANCH || 'master')
const ip = await startNextcloud(process.env.BRANCH || 'master', undefined, { exposePort: 8080 })
// Setting container's IP as base Url
config.baseUrl = `http://${ip}/index.php`
await waitOnNextcloud(ip)
Expand Down
14 changes: 10 additions & 4 deletions cypress/e2e/settings.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

import type { User } from "@nextcloud/cypress"

describe('Check that user\'s settings survive a reload', () => {
let user: User

before(() => {
cy.createRandomUser()
.then((user) => {
cy.login(user)
cy.visit('/settings/user/notifications')
})
.then(_user => user = _user)
})

beforeEach(() => {
cy.login(user)
cy.visit('/settings/user/notifications')
})

it('Form survive a reload', () => {
Expand Down
5 changes: 3 additions & 2 deletions cypress/e2e/sidebar.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

import { createFolder, getFileListRow, navigateToFolder, moveFile, renameFile } from './filesUtils'
import { addComment, addTag, createPublicShare, toggleFavorite, showActivityTab } from './sidebarUtils'
import { addComment, addTag, createPublicShare, toggleFavorite, showActivityTab, randHash } from './sidebarUtils'

describe('Check activity listing in the sidebar', { testIsolation: true }, () => {
beforeEach(function() {
Expand Down Expand Up @@ -39,6 +39,7 @@ describe('Check activity listing in the sidebar', { testIsolation: true }, () =>
it('Has share activity', () => {
createPublicShare('welcome.txt')
cy.visit('/apps/files')
getFileListRow('welcome.txt').should('be.visible')

showActivityTab('welcome.txt')
cy.get('.activity-entry').first().should('contains.text', 'Shared as public link')
Expand All @@ -62,7 +63,7 @@ describe('Check activity listing in the sidebar', { testIsolation: true }, () =>
})

it('Has tag activity', () => {
addTag('welcome.txt', 'my_tag')
addTag('welcome.txt', `my_tag_${randHash()}`)
cy.visit('/apps/files')

showActivityTab('welcome.txt')
Expand Down
4 changes: 4 additions & 0 deletions cypress/e2e/sidebarUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,7 @@ export function addComment(fileName: string, comment: string) {

cy.wait('@comment')
}

export function randHash() {
return Math.random().toString(36).replace(/[^a-z]+/g, '').slice(0, 10)
}
Loading