👷 e2e tests for dashboard

Including test for signing/singup, projects, files, teams, and misc
This commit is contained in:
Pablo Alba 2022-01-25 09:33:52 +01:00
parent 26e5d57ced
commit 5103624fe0
32 changed files with 1285 additions and 127 deletions

View file

@ -88,7 +88,7 @@ Cypress.Commands.add('clickMultiInViewport', (coords) => {
Cypress.Commands.add('clearViewport', () => {
cy.get(".viewport-controls").type('{ctrl}a');
cy.get(".viewport-controls").type('{del}');
cy.window().its("debug").invoke('reset_viewport')
cy.window().its("debug").invoke('reset_viewport');
})
Cypress.Commands.add('getBySel', (selector, ...args) => {
@ -97,4 +97,18 @@ Cypress.Commands.add('getBySel', (selector, ...args) => {
Cypress.Commands.add('getBySelLike', (selector, ...args) => {
return cy.get(`[data-test*=${selector}]`, ...args)
})
})
Cypress.Commands.add('uploadBinaryFile', (fileInputSelector, fileName) => {
cy.fixture(fileName, "binary")
.then(Cypress.Blob.binaryStringToBlob)
.then(fileContent => {
cy.get(fileInputSelector).attachFile({
fileContent,
filePath: fileName,
encoding: 'utf-8',
lastModified: new Date().getTime()
});
});
})