Skip to content

Commit

Permalink
Init Cypress test in Draggable (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranay0302 committed Feb 19, 2021
1 parent 0660f9e commit ebbd2af
Show file tree
Hide file tree
Showing 10 changed files with 101 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/draggable/cypress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"projectId": "es3fs5",
"video": false
}
Binary file added packages/draggable/cypress/.DS_Store
Binary file not shown.
6 changes: 6 additions & 0 deletions packages/draggable/cypress/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
extends: ["plugin:cypress/recommended"],
rules: {
"import/no-extraneous-dependencies": ["error", { devDependencies: true }],
},
};
1 change: 1 addition & 0 deletions packages/draggable/cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
8 changes: 8 additions & 0 deletions packages/draggable/cypress/integration/sample_spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
describe("checking", () => {
// it("returns noice", function () {
// expect(true).to.equal(true);
// });
it("actions", () => {
cy.visit("https://jalal246.github.io/dflex/");
});
});
24 changes: 24 additions & 0 deletions packages/draggable/cypress/plugins/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************

// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

/**
* @type {Cypress.PluginConfig}
*/
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
// eslint-disable-next-line global-require
require("@cypress/code-coverage/task")(on, config);
return config;
};
25 changes: 25 additions & 0 deletions packages/draggable/cypress/support/commands.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("login", (email, password) => { ... })
//
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
20 changes: 20 additions & 0 deletions packages/draggable/cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// ***********************************************************
// 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
// ***********************************************************

// Import commands.js using ES2015 syntax:
import './commands'

// Alternatively you can use CommonJS syntax:
// require('./commands')
10 changes: 8 additions & 2 deletions packages/draggable/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@
"@dflex/core-instance"
],
"devDependencies": {
"dflex-utils-test": "^0.1.0"
"@cypress/code-coverage": "^3.9.2",
"cross-env": "^7.0.3",
"cypress": "^6.4.0",
"dflex-utils-test": "^0.1.0",
"eslint-plugin-cypress": "^2.11.2",
"start-server-and-test": "^1.12.0"
},
"keywords": [
"@dflex",
Expand All @@ -37,5 +42,6 @@
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"access": "public"
}
},
"dependencies": {}
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1521,6 +1521,11 @@
debug "^3.1.0"
lodash.once "^4.1.1"

"@dflex/draggable@^0.3.2":
version "0.3.3"
resolved "https://registry.yarnpkg.com/@dflex/draggable/-/draggable-0.3.3.tgz#4298509912707332fb74fae826bb262ff649fd95"
integrity sha512-XNVM/N7v8F1cOSzsDdXAPB20AAIEz8TOVkm8niNpKIckL9Gch95t+mRcJTbyaHeoNFAsezwjthkZJFa5bpUWhg==

"@docsearch/css@3.0.0-alpha.32":
version "3.0.0-alpha.32"
resolved "https://registry.yarnpkg.com/@docsearch/css/-/css-3.0.0-alpha.32.tgz#3d89c8db4035531d201f74ef2115f72094a24036"
Expand Down

0 comments on commit ebbd2af

Please sign in to comment.