Skip to content

Commit

Permalink
remove redundant cypress plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
cstns committed Aug 28, 2024
1 parent 78470d9 commit d173842
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 43 deletions.
20 changes: 0 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@
"cross-env": "^7.0.3",
"css-loader": "^6.8.1",
"cypress": "^13.2.0",
"cypress-file-upload": "^5.0.8",
"cypress-mailpit": "^0.0.4",
"dotenv-webpack": "^8.0.1",
"eslint": "^8.48.0",
Expand Down
14 changes: 0 additions & 14 deletions test/e2e/frontend/cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'cypress-mailpit'
import 'cypress-file-upload'

// ***********************************************
// This example commands.js shows you how to
Expand Down Expand Up @@ -269,16 +268,3 @@ Cypress.Commands.add('adminGetAllBlueprints', () => {
cy.logout()
cy.clearBrowserData()
})

Cypress.Commands.add('upload_file', (fileName, fileType = ' ', selector) => {
// eslint-disable-next-line cypress/require-data-selectors
cy.get(selector).then(subject => {
cy.fixture(fileName, 'base64').then(content => {
const el = subject[0]
const testFile = new File([content], fileName, { type: fileType })
const dataTransfer = new DataTransfer()
dataTransfer.items.add(testFile)
el.files = dataTransfer.files
})
})
})
10 changes: 2 additions & 8 deletions test/e2e/frontend/cypress/tests-ee/instances/assets.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,8 @@ describe('FlowForge - Instance - Assets', () => {
cy.get('[data-el="upload-file-dialog"]').should('be.visible')

cy.get('[data-el="upload-input"]').as('fileInput')

cy.fixture('files/rick.png').then(fileContent => {
cy.get('@fileInput').attachFile({
fileContent: fileContent.toString(),
fileName: 'rick.png',
mimeType: 'image/png'
})
})
cy.fixture('files/rick.png').as('file')
cy.get('@fileInput').selectFile({ contents: '@file' }, { force: true }) // force because the input is hidden

cy.intercept('POST', '/api/*/projects/*/files/_/*', '').as('uploadFile')
interceptFiles(
Expand Down

0 comments on commit d173842

Please sign in to comment.