diff --git a/.github/workflows/validating.yml b/.github/workflows/validating.yml index 0fce21aad..609f6733c 100644 --- a/.github/workflows/validating.yml +++ b/.github/workflows/validating.yml @@ -33,7 +33,6 @@ jobs: # fix issue with "Cannot find module 'cypress'" # https://github.com/cypress-io/github-action/issues/430#issuecomment-949936528 command: yarn test:e2e - command-prefix: yarn dlx start: yarn start-test-server wait-on: "http://localhost:8888" wait-on-timeout: 5 diff --git a/cypress/e2e/1-basic/zero_configuration.cy.js b/cypress/e2e/1-basic/zero_configuration.cy.js index addd6ee20..915f73c7b 100644 --- a/cypress/e2e/1-basic/zero_configuration.cy.js +++ b/cypress/e2e/1-basic/zero_configuration.cy.js @@ -8,8 +8,8 @@ describe("Dropzone with zero configuration", () => { it("uploads single file", () => { cy.intercept("POST", "/").as("upload"); - cy.get(".dropzone").attachFile("image.jpg", { - subjectType: "drag-n-drop", + cy.get(".dropzone").selectFile("cypress/fixtures/image.jpg", { + action: "drag-drop", }); cy.wait("@upload").then((interception) => { @@ -24,8 +24,8 @@ describe("Dropzone with zero configuration", () => { cy.intercept("POST", "/").as("upload"); cy.get(".dropzone") - .attachFile("image.jpg", { subjectType: "drag-n-drop" }) - .attachFile("image.tiff", { subjectType: "drag-n-drop" }) + .selectFile("cypress/fixtures/image.jpg", { action: "drag-drop" }) + .selectFile("cypress/fixtures/image.tiff", { action: "drag-drop" }) cy.wait("@upload").then((interception) => { expect(interception.response.statusCode).to.eq(200); diff --git a/cypress/e2e/2-integrations/aws-s3-multipart.cy.js b/cypress/e2e/2-integrations/aws-s3-multipart.cy.js index 17f2fd0ba..b08573033 100644 --- a/cypress/e2e/2-integrations/aws-s3-multipart.cy.js +++ b/cypress/e2e/2-integrations/aws-s3-multipart.cy.js @@ -15,8 +15,8 @@ describe("Dropzone with zero configuration", () => { ).as("upload"); cy.intercept("POST", "/amazon-complete").as("complete"); - cy.get(".dropzone").attachFile("image.jpg", { - subjectType: "drag-n-drop", + cy.get(".dropzone").selectFile("cypress/fixtures/image.jpg", { + action: "drag-drop", }); let remainingSize = imageSize; let partEtags = []; diff --git a/cypress/support/commands.js b/cypress/support/commands.js deleted file mode 100644 index d94c8d8b0..000000000 --- a/cypress/support/commands.js +++ /dev/null @@ -1 +0,0 @@ -import "cypress-file-upload"; diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index 413b0ecfa..71550f181 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -12,6 +12,3 @@ // You can read more here: // https://on.cypress.io/configuration // *********************************************************** - -// Import commands.js using ES2015 syntax: -import "./commands"; diff --git a/package.json b/package.json index 4f4b67962..8726c4806 100644 --- a/package.json +++ b/package.json @@ -43,8 +43,8 @@ "css": "yarn sass src/:dist/ --style compressed", "watch-css": "yarn sass src/:dist/ --watch --style compressed", "test": "karma start test/karma.conf.js", - "test:e2e": "yarn run cypress run", - "start-test-server": "node test/test-server.js" + "test:e2e": "cypress run", + "start-test-server": "yarn node test/test-server.js" }, "bugs": { "url": "https://github.com/NicolasCARPi/dropzone/issues" @@ -63,7 +63,6 @@ "@parcel/transformer-sass": "^2.12.0", "chai": "^4.4.1", "cypress": "^13.11.0", - "cypress-file-upload": "^5.0.8", "express": "^4.19.2", "karma": "^6.4.3", "karma-chrome-launcher": "^3.2.0", diff --git a/yarn.lock b/yarn.lock index 91c1fcc0c..9f6b1b67c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -87,7 +87,6 @@ __metadata: "@swc/helpers": "npm:^0.5.11" chai: "npm:^4.4.1" cypress: "npm:^13.11.0" - cypress-file-upload: "npm:^5.0.8" express: "npm:^4.19.2" karma: "npm:^6.4.3" karma-chrome-launcher: "npm:^3.2.0" @@ -2235,15 +2234,6 @@ __metadata: languageName: node linkType: hard -"cypress-file-upload@npm:^5.0.8": - version: 5.0.8 - resolution: "cypress-file-upload@npm:5.0.8" - peerDependencies: - cypress: ">3.0.0" - checksum: 10c0/881a4d9cc16fbf5fd3efc69e1cfa65dd4036c747e2d0e9b7cf32f7f5bb5a137abfd7ce08bd3b7cf802e5d214c0036eabe4e116ccac162445e51e930656375310 - languageName: node - linkType: hard - "cypress@npm:^13.11.0": version: 13.11.0 resolution: "cypress@npm:13.11.0"