Skip to content
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
5 changes: 1 addition & 4 deletions .github/workflows/validating.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,12 @@ jobs:
- name: Build
run: yarn run build

- name: Run test
run: yarn run test

- uses: cypress-io/github-action@v6
with:
install-command : yarn install --immutable --immutable-cache
# fix issue with "Cannot find module 'cypress'"
# https://github.com/cypress-io/github-action/issues/430#issuecomment-949936528
command: yarn test:e2e
command: yarn run test
start: yarn start-test-server
wait-on: "http://localhost:8888"
wait-on-timeout: 5
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ _config.yaml
dist
.parcel-cache

cypress/screenshots/

# The GitLab pages artifacts
public

Expand Down
9 changes: 4 additions & 5 deletions cypress.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ const { defineConfig } = require('cypress')

module.exports = defineConfig({
e2e: {
// We've imported your old cypress plugins here.
// You may want to clean this up later by importing these.
setupNodeEvents(on, config) {
return require('./cypress/plugins/index.js')(on, config)
},
baseUrl: 'http://localhost:8888',
specPattern: [
"cypress/e2e/**/*.cy.{js,jsx,ts,tsx}",
"cypress/unit/**/*.cy.{js,jsx,ts,tsx}",
],
},
})
16 changes: 9 additions & 7 deletions cypress/e2e/1-basic/zero_configuration.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ describe("Dropzone with zero configuration", () => {

cy.wait("@upload").then((interception) => {
expect(interception.response.statusCode).to.eq(200);
expect(interception.response.body).to.deep.eq({
success: true,
});
expect(interception.response.body).to.deep.eq({ success: true });
});
});

Expand All @@ -25,13 +23,17 @@ describe("Dropzone with zero configuration", () => {

cy.get(".dropzone")
.selectFile("cypress/fixtures/image.jpg", { action: "drag-drop" })
.selectFile("cypress/fixtures/image.tiff", { action: "drag-drop" })
.selectFile("cypress/fixtures/image.tiff", { action: "drag-drop" });

// wait for BOTH uploads
cy.wait("@upload").then((interception) => {
expect(interception.response.statusCode).to.eq(200);
expect(interception.response.body).to.deep.eq({
success: true,
});
expect(interception.response.body).to.deep.eq({ success: true });
});

cy.wait("@upload").then((interception) => {
expect(interception.response.statusCode).to.eq(200);
expect(interception.response.body).to.deep.eq({ success: true });
});
});
});
File renamed without changes.
16 changes: 16 additions & 0 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
globalThis.sleep = (delay) =>
new Promise((resolve) => setTimeout(resolve, delay));
14 changes: 14 additions & 0 deletions cypress/support/unit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************
Loading