Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
test(cypress): Enable test isolation
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
artonge committed May 22, 2025
commit a402e6b1caeda12e44b6b636ad7531e6e5d7f917
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
2 changes: 1 addition & 1 deletion 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
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