-
-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add document and change the syntax on the steps for Drag and Drop #4580
Add document and change the syntax on the steps for Drag and Drop #4580
Conversation
@@ -1049,6 +1049,26 @@ Then local storage item with key `token` does not exist | |||
include::partial$proxy-steps.adoc[] | |||
|
|||
=== Window Steps | |||
==== Drag and drop steps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it has actually nothing about windows, I would say it's more about mouse actions
* $draggable: The <<_locator,locator>> to identify the element to be dragged | ||
* $location: Desired position relative to the target element (TOP, BOTTOM, LEFT, RIGHT, CENTER, LEFT_TOP, RIGHT_TOP, LEFT_BOTTOM, RIGHT_BOTTOM). | ||
* $target: The <<_locator,locator>> to identify the target element. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please follow common approach to describe parameters
vividus-plugin-web-app/src/main/java/org/vividus/steps/ui/web/DragAndDropSteps.java
Show resolved
Hide resolved
dec66d5
to
854584a
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4580 +/- ##
============================================
+ Coverage 97.38% 97.40% +0.01%
+ Complexity 6761 6533 -228
============================================
Files 914 914
Lines 18789 18809 +20
Branches 1249 1250 +1
============================================
+ Hits 18298 18320 +22
+ Misses 384 383 -1
+ Partials 107 106 -1 ☔ View full report in Codecov by Sentry. |
854584a
to
2d3c0ef
Compare
Arguments.of(null, null), | ||
Arguments.of(null, mock(WebElement.class)), | ||
Arguments.of(mock(WebElement.class), null) | ||
Arguments.of(null, null), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noisy change
@@ -62,7 +62,7 @@ protected String processValue(String propertyName, String partOfPropertyValueToP | |||
.map(data -> data.get(matcher.group("key"))) | |||
.map(String.class::cast) | |||
.orElseThrow(() -> new IllegalArgumentException( | |||
String.format("Unable to find secret at path '%s' in Vault", partOfPropertyValueToProcess) | |||
String.format("Unable to find secret at path '%s' in Vault", partOfPropertyValueToProcess) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noisy change
@@ -1,10 +1,18 @@ | |||
Meta: | |||
@epic vividus-plugin-web-app | |||
|
|||
Scenario: Step verification 'When I drag element located `$origin` and drop it at $location of element located `$target`' | |||
Scenario: Step verification deprecated 'When I drag element located `$origin` and drop it at $location of element located `$target`' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please optimize this story to verify both actual and deprecated steps in a single scenario.
This set of steps facilitates the dragging and dropping of elements on a web page. | ||
Desired position relative to the target element (TOP, BOTTOM, LEFT, RIGHT, CENTER, LEFT_TOP, RIGHT_TOP, LEFT_BOTTOM, RIGHT_BOTTOM). | ||
|
||
==== The drag and drop operation is real |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove is real
|
||
[source,gherkin] | ||
---- | ||
When I drag element located `$draggable` and drop it at $location of element located `$target` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deprecated syntax here
.Dragging the image on the page | ||
[source,gherkin] | ||
---- | ||
When I drag element located `$draggable` and drop it at $location of element located `$target` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deprecated syntax
|
||
[source,gherkin] | ||
---- | ||
When I simulate drag of element located `$draggable` and drop at element located `$target` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deprecated syntax
2d3c0ef
to
8c7a87b
Compare
=== Hover mouse over the element | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=== Hover mouse over the element |
This set of steps facilitates the dragging and dropping of elements on a web page. | ||
Desired position relative to the target element (TOP, BOTTOM, LEFT, RIGHT, CENTER, LEFT_TOP, RIGHT_TOP, LEFT_BOTTOM, RIGHT_BOTTOM). | ||
|
||
==== The drag and drop operation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==== The drag and drop operation | |
==== The drag and drop using mouse |
When I drag element located by `$draggable` and drop it at $location of element located by `$target` | ||
---- | ||
|
||
==== The drag and drop operation is simulated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==== The drag and drop operation is simulated | |
==== The drag and drop simulation |
_Deprecated syntax (will be removed in VIVIDUS 0.7.0)_: | ||
[source,gherkin] | ||
---- | ||
When I hover mouse over element located `$locator` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😮
*/ | ||
@Deprecated(since = "0.6.1", forRemoval = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Deprecated(since = "0.6.1", forRemoval = true) | |
@Deprecated(since = "0.6.4", forRemoval = true) |
*/ | ||
@Deprecated(since = "0.6.1", forRemoval = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Deprecated(since = "0.6.1", forRemoval = true) | |
@Deprecated(since = "0.6.4", forRemoval = true) |
private void performDragAndDrop(Locator draggable, Locator target, | ||
BiConsumer<WebElement, WebElement> dragAndDropExecutor) | ||
private void performDragAndDropDeprecated(Locator draggable, Locator target, | ||
BiConsumer<WebElement, WebElement> dragAndDropExecutor) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BiConsumer<WebElement, WebElement> dragAndDropExecutor) | |
BiConsumer<WebElement, WebElement> dragAndDropExecutor) |
2807d98
to
b4c0625
Compare
* $draggable: - The <<_locator,locator>> to identify the element to be dragged | ||
* $location: - Action to select the position state of the element (TOP, BOTTOM, LEFT, RIGHT, CENTER, LEFT_TOP, RIGHT_TOP, LEFT_BOTTOM, RIGHT_BOTTOM). | ||
* $target: - The <<_locator,locator>> to identify the target element. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* $draggable: - The <<_locator,locator>> to identify the element to be dragged | |
* $location: - Action to select the position state of the element (TOP, BOTTOM, LEFT, RIGHT, CENTER, LEFT_TOP, RIGHT_TOP, LEFT_BOTTOM, RIGHT_BOTTOM). | |
* $target: - The <<_locator,locator>> to identify the target element. | |
* `$draggable` - The <<_locator,locator>> to identify the element to be dragged. | |
* `$location` - Action to select the position state of the element (TOP, BOTTOM, LEFT, RIGHT, CENTER, LEFT_TOP, RIGHT_TOP, LEFT_BOTTOM, RIGHT_BOTTOM). | |
* `$target` - The <<_locator,locator>> to identify the target element. |
.Dragging the image on the page | ||
[source,gherkin] | ||
---- | ||
When I drag element located by `$draggable` and drop it at $location of element located by `$target` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put actual values instead of argument placeholders
|
||
==== The drag and drop operation simulation | ||
|
||
This step simulated a drag-and-drop operation for specified elements, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step simulated a drag-and-drop operation for specified elements, | |
This step simulates a drag-and-drop operation for specified elements, |
==== The drag and drop operation simulation | ||
|
||
This step simulated a drag-and-drop operation for specified elements, | ||
replicating the behavior without actual user interaction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replicating the behavior without actual user interaction. | |
replicating the behavior without actual mouse actions perfromed. |
* $draggable: - The <<_locator,locator>> to identify the element to be dragged | ||
* $target: - The <<_locator,locator>> to identify the target element. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* $draggable: - The <<_locator,locator>> to identify the element to be dragged | |
* $target: - The <<_locator,locator>> to identify the target element. | |
* `$draggable` - The <<_locator,locator>> to identify the element to be dragged. | |
* `$target` - The <<_locator,locator>> to identify the target element. |
When I simulate drag of element located by `$draggable` and drop at element located by `$target` | ||
---- | ||
|
||
=== Hover mouse over the element |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this for?
verify((Interactive) driver).perform( | ||
|
||
argThat(arg -> arg.iterator().next().encode().toString().equals(actionsSequence))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please format properly
private static WebElement mockWebElementWithRectDeprecated(int x, int y, int height, int width) | ||
{ | ||
WebElement element = mock(WebElement.class); | ||
when(element.getRect()).thenReturn(new Rectangle(x, y, height, width)); | ||
return element; | ||
} | ||
|
||
static Stream<Arguments> getElementsDeprecated() | ||
{ | ||
return Stream.of( | ||
Arguments.of(null, null), | ||
Arguments.of(null, mock(WebElement.class)), | ||
Arguments.of(mock(WebElement.class), null) | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no reason to duplicate the code
WebElement draggable = mock(WebElement.class); | ||
WebElement target = mock(WebElement.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WebElement draggable = mock(WebElement.class); | |
WebElement target = mock(WebElement.class); | |
WebElement draggable = mock(); | |
WebElement target = mock(); |
String.format("Unable to find secret at path '%s' in Vault", partOfPropertyValueToProcess) | ||
String.format("Unable to find secret at path '%s' in Vault", partOfPropertyValueToProcess) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noisy change
b90d5bf
to
caf0212
Compare
---- | ||
|
||
* `$draggable` - The <<_locator,locator>> to identify the element to be dragged | ||
* `$location` - Action to select the position state of the element (TOP, BOTTOM, LEFT, RIGHT, CENTER, LEFT_TOP, RIGHT_TOP, LEFT_BOTTOM, RIGHT_BOTTOM). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's not really action, but rather target position relatively to the target element
* `$target` - The <<_locator,locator>> to identify the target element. | ||
|
||
.Simulation of dragging an image onto the page | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moves a mouse cursor on the element. | ||
|
||
[source,gherkin] | ||
---- | ||
When I hover mouse over element located by `$locator` | ||
---- | ||
|
||
_Deprecated syntax (will be removed in VIVIDUS 0.7.0)_: | ||
[source,gherkin] | ||
---- | ||
When I hover mouse over element located `$locator` | ||
---- | ||
|
||
* `$locator` - The <<_locator,locator>> to an element to hover. | ||
|
||
.Step example | ||
[source,gherkin] | ||
---- | ||
When I hover mouse over element located by `id(hoverme)` | ||
---- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moves a mouse cursor on the element. | |
[source,gherkin] | |
---- | |
When I hover mouse over element located by `$locator` | |
---- | |
_Deprecated syntax (will be removed in VIVIDUS 0.7.0)_: | |
[source,gherkin] | |
---- | |
When I hover mouse over element located `$locator` | |
---- | |
* `$locator` - The <<_locator,locator>> to an element to hover. | |
.Step example | |
[source,gherkin] | |
---- | |
When I hover mouse over element located by `id(hoverme)` | |
---- |
Duplicated docs
caf0212
to
18291c2
Compare
*/ | ||
@Deprecated(since = "0.6.4", forRemoval = true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Deprecated(since = "0.6.4", forRemoval = true) | |
@Deprecated(since = "0.6.5", forRemoval = true) |
0.6.4
is released, it's needed to update @since
version to 0.6.5
everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw it's a good example of one of the reasons why it's not recommended to delay with PR fixes in general
|
||
==== The drag and drop using mouse | ||
|
||
This step for a drag-and-drop operation for specified elements. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please follow the same approach as for other steps, e.g.:
This step for a drag-and-drop operation for specified elements. | |
Performs drag-and-drop operation for the specified elements. |
When I drag element located by `$draggable` and drop it at $location of element located by `$target` | ||
---- | ||
|
||
* `$draggable` - The <<_locator,locator>> to identify the element to be dragged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `$draggable` - The <<_locator,locator>> to identify the element to be dragged | |
* `$draggable` - The <<_locator,locator>> to identify the element to be dragged. |
This step simulates a drag-and-drop operation for specified elements, | ||
replicating the behavior without actual mouse actions performed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please follow the same approach as for other steps, e.g.:
This step simulates a drag-and-drop operation for specified elements, | |
replicating the behavior without actual mouse actions performed. | |
Simulates a drag-and-drop operation for specified elements, | |
replicating the behavior without actual mouse actions performed. |
When I simulate drag of element located by `$draggable` and drop at element located by `$target` | ||
---- | ||
|
||
* `$draggable` - The <<_locator,locator>> to identify the element to be dragged |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `$draggable` - The <<_locator,locator>> to identify the element to be dragged | |
* `$draggable` - The <<_locator,locator>> to identify the element to be dragged. |
18291c2
to
e419000
Compare
=== Drag and drop steps | ||
|
||
This set of steps facilitates the dragging and dropping of elements on a web page. | ||
Desired position relative to the target element (TOP, BOTTOM, LEFT, RIGHT, CENTER, LEFT_TOP, RIGHT_TOP, LEFT_BOTTOM, RIGHT_BOTTOM). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Desired position relative to the target element (TOP, BOTTOM, LEFT, RIGHT, CENTER, LEFT_TOP, RIGHT_TOP, LEFT_BOTTOM, RIGHT_BOTTOM). |
it's not applicable to all steps
This set of steps facilitates the dragging and dropping of elements on a web page. | ||
Desired position relative to the target element (TOP, BOTTOM, LEFT, RIGHT, CENTER, LEFT_TOP, RIGHT_TOP, LEFT_BOTTOM, RIGHT_BOTTOM). | ||
|
||
==== The drag and drop using mouse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==== The drag and drop using mouse | |
==== Drag and drop using mouse |
---- | ||
|
||
* `$draggable` - The <<_locator,locator>> to identify the element to be dragged. | ||
* `$location` - Target position relative to the target element (TOP, BOTTOM, LEFT, RIGHT, CENTER, LEFT_TOP, RIGHT_TOP, LEFT_BOTTOM, RIGHT_BOTTOM). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `$location` - Target position relative to the target element (TOP, BOTTOM, LEFT, RIGHT, CENTER, LEFT_TOP, RIGHT_TOP, LEFT_BOTTOM, RIGHT_BOTTOM). | |
* `$location` - The target position relative to the target element (TOP, BOTTOM, LEFT, RIGHT, CENTER, LEFT_TOP, RIGHT_TOP, LEFT_BOTTOM, RIGHT_BOTTOM). |
.Dragging the image on the page | ||
[source,gherkin] | ||
---- | ||
When I drag element located by `id(item-number)` and drop it at RIGHT_BOTTOM of element located by `id(item-number)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I drag element located by `id(item-number)` and drop it at RIGHT_BOTTOM of element located by `id(item-number)` | |
When I drag element located by `id(item-number)` and drop it at right bottom of element located by `id(item-number)` |
let's make it more readable
When I drag element located by `id(item-number)` and drop it at RIGHT_BOTTOM of element located by `id(item-number)` | ||
---- | ||
|
||
==== The drag and drop operation simulation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
==== The drag and drop operation simulation | |
==== Drag and drop simulation |
e419000
to
283bce0
Compare
No description provided.