Skip to content

Commit 72f7feb

Browse files
authored
Merge pull request #168 from nextcloud/fix/cypress-sessions
2 parents d692ccf + 7071b11 commit 72f7feb

File tree

5 files changed

+990
-1601
lines changed

5 files changed

+990
-1601
lines changed

cypress/dockerNode.ts

+12-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,18 @@ const SERVER_IMAGE = 'ghcr.io/nextcloud/continuous-integration-shallow-server'
3434
export const startNextcloud = async function (branch: string = 'master'): Promise<any> {
3535
try {
3636
// Pulling images
37-
console.log('Pulling images...')
38-
await docker.pull(SERVER_IMAGE)
37+
console.log('Pulling images... ⏳')
38+
await new Promise((resolve, reject) => docker.pull(SERVER_IMAGE, (_err, stream: Stream) => {
39+
const onFinished = function(err: Error | null) {
40+
if (!err) {
41+
return resolve(true)
42+
}
43+
reject(err)
44+
}
45+
// https://github.com/apocas/dockerode/issues/357
46+
docker.modem.followProgress(stream, onFinished)
47+
}))
48+
console.log('└─ Done')
3949

4050
// Getting latest image
4151
console.log('\nChecking running containers... 🔍')

cypress/e2e/sessions.cy.ts

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import { User } from '../../dist'
2323

2424
describe('Login and logout', function() {
25+
before(() => cy.logout())
26+
2527
it('Login and see the default files list', function() {
2628
cy.visit('/apps/files')
2729
cy.url().should('include', '/login')

cypress/e2e/users.cy.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import { User } from '../../dist'
2323
import { randHash } from '../utils'
2424

25+
beforeEach(() => cy.logout())
2526

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

9293
cy.modifyUser(user, 'displayname', 'John Doe')
9394
cy.getUserData(user).then(response => {
94-
const parser = new DOMParser();
95-
const xmlDoc = parser.parseFromString(response.body, "text/xml");
95+
const parser = new DOMParser()
96+
const xmlDoc = parser.parseFromString(response.body, 'text/xml')
9697
expect(xmlDoc.querySelector('data displayname')?.textContent).to.eq('John Doe')
9798
})
9899
})
99-
})
100+
})

0 commit comments

Comments
 (0)