cypress-dragndrop-kit 1.0.7 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +17 -7
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -27,20 +27,30 @@ import 'cypress-dragndrop-kit';
27
27
 
28
28
  | Command | Type | Description |
29
29
  | --- | --- | --- |
30
- | `dragTo(targetElementLocator, options)` | `Child command` | Custom child command for dragging and dropping a chained element to a specified element location |
31
- | `dragAndDrop(sourceElementLocator, targetElementLocator, options)` | `Parent command` | Custom command for dragging and dropping from one element location to another |
30
+ | `cy.dragTo(target, options)` | `Child command` | Custom child command for dragging and dropping a chained element to a specified element location |
31
+ | `cy.dragAndDrop(source, target, options)` | `Parent command` | Custom command for dragging and dropping from one element location to another |
32
32
 
33
33
 
34
34
  <br/>
35
35
 
36
- ### ⚙️ Command Options
36
+ ### ⚙️ Input parameters
37
37
 
38
- The `options` input parameter is an optional object for handling specific cases related to the drag-and-drop functionality.
38
+ #### Required
39
+
40
+ | Parameter name | Type | Default | Description |
41
+ | --- | --- | --- | --- |
42
+ | `sourceElement` | `string` | / | locator for the `source` element |
43
+ | `targetElement` | `string` | / | locator for the `target` element |
44
+
45
+ #### Optional
46
+
47
+ The `options` parameter is the third and only optional argument — an object used to configure specific aspects of the drag-and-drop behavior.
39
48
 
40
49
  | Option | Type | Default | Description |
41
50
  | --- | --- | --- | --- |
42
51
  | `pressDelay` | `number` | `0` | Time delay (in milliseconds) after mouse down event, before initiating the dragging of the element. Useful for simulating long-press behavior |
43
52
 
53
+
44
54
  <br/>
45
55
 
46
56
  ### 📘 Examples
@@ -64,10 +74,10 @@ it('should be able to drag and drop an item by using "dragAndDrop()"', () => {
64
74
 
65
75
  // Usage of "dragTo(target, { pressDelay })"
66
76
  it('should be able to drag and drop an item after a 2 second delay by using "dragTo()"', () => {
67
- cy.get('[data-id="47"]').dragTo('[data-id="3"]', { pressDelay: 2000 });
77
+ cy.get('[data-id="47"]').dragTo('[data-id="3"]', { pressDelay: 2000 });
68
78
 
69
- cy.get('[data-id="47"]').should('have.attr', 'data-index', 3);
70
- cy.get('[data-id="3"]').should('have.attr', 'data-index', 4);
79
+ cy.get('[data-id="47"]').should('have.attr', 'data-index', 3);
80
+ cy.get('[data-id="3"]').should('have.attr', 'data-index', 4);
71
81
  })
72
82
  ```
73
83
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cypress-dragndrop-kit",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Custom command meant for interacting with draggable elements in the UI",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types.d.ts",