Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make sure sessions are cleared between tests #168

Merged
merged 2 commits into from
Mar 3, 2023
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
14 changes: 12 additions & 2 deletions cypress/dockerNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,18 @@ const SERVER_IMAGE = 'ghcr.io/nextcloud/continuous-integration-shallow-server'
export const startNextcloud = async function (branch: string = 'master'): Promise<any> {
try {
// Pulling images
console.log('Pulling images...')
await docker.pull(SERVER_IMAGE)
console.log('Pulling images... ⏳')
await new Promise((resolve, reject) => docker.pull(SERVER_IMAGE, (_err, stream: Stream) => {
const onFinished = function(err: Error | null) {
if (!err) {
return resolve(true)
}
reject(err)
}
// https://github.com/apocas/dockerode/issues/357
docker.modem.followProgress(stream, onFinished)
}))
console.log('└─ Done')

// Getting latest image
console.log('\nChecking running containers... 🔍')
Expand Down
2 changes: 2 additions & 0 deletions cypress/e2e/sessions.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import { User } from '../../dist'

describe('Login and logout', function() {
before(() => cy.logout())

it('Login and see the default files list', function() {
cy.visit('/apps/files')
cy.url().should('include', '/login')
Expand Down
7 changes: 4 additions & 3 deletions cypress/e2e/users.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import { User } from '../../dist'
import { randHash } from '../utils'

beforeEach(() => cy.logout())

describe('Create user and login', function() {
it('Create random user and log in', function() {
Expand Down Expand Up @@ -91,9 +92,9 @@ describe('Write and read user metadata', () => {

cy.modifyUser(user, 'displayname', 'John Doe')
cy.getUserData(user).then(response => {
const parser = new DOMParser();
const xmlDoc = parser.parseFromString(response.body, "text/xml");
const parser = new DOMParser()
const xmlDoc = parser.parseFromString(response.body, 'text/xml')
expect(xmlDoc.querySelector('data displayname')?.textContent).to.eq('John Doe')
})
})
})
})
Loading