Skip to content
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

Merged
merged 2 commits into from
Dec 11, 2023

Conversation

TykovkaV
Copy link
Contributor

No description provided.

@TykovkaV TykovkaV requested a review from a team as a code owner November 20, 2023 15:43
@@ -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
Copy link
Collaborator

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

Comment on lines 1062 to 1064
* $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.
Copy link
Collaborator

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

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e90344d) 97.38% compared to head (2ba176f) 97.40%.
Report is 14 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

Arguments.of(null, null),
Arguments.of(null, mock(WebElement.class)),
Arguments.of(mock(WebElement.class), null)
Arguments.of(null, null),
Copy link
Contributor

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)
Copy link
Contributor

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`'
Copy link
Contributor

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
Copy link
Contributor

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`
Copy link
Contributor

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`
Copy link
Contributor

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`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deprecated syntax

Comment on lines 338 to 339
=== Hover mouse over the element

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
=== 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
==== 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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
==== 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`
Copy link
Collaborator

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)
Copy link
Collaborator

@valfirst valfirst Nov 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@Deprecated(since = "0.6.1", forRemoval = true)
@Deprecated(since = "0.6.4", forRemoval = true)

*/
@Deprecated(since = "0.6.1", forRemoval = true)
Copy link
Collaborator

@valfirst valfirst Nov 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
BiConsumer<WebElement, WebElement> dragAndDropExecutor)
BiConsumer<WebElement, WebElement> dragAndDropExecutor)

@TykovkaV TykovkaV force-pushed the add_drag_and_drop_steps branch 2 times, most recently from 2807d98 to b4c0625 Compare November 24, 2023 11:29
Comment on lines 352 to 354
* $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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* $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`
Copy link
Collaborator

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,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
replicating the behavior without actual user interaction.
replicating the behavior without actual mouse actions perfromed.

Comment on lines 372 to 373
* $draggable: - The <<_locator,locator>> to identify the element to be dragged
* $target: - The <<_locator,locator>> to identify the target element.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* $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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this for?

Comment on lines 86 to 87
verify((Interactive) driver).perform(

argThat(arg -> arg.iterator().next().encode().toString().equals(actionsSequence)));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please format properly

Comment on lines 91 to 104
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)
);
}
Copy link
Collaborator

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

Comment on lines 170 to 171
WebElement draggable = mock(WebElement.class);
WebElement target = mock(WebElement.class);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noisy change

@TykovkaV TykovkaV force-pushed the add_drag_and_drop_steps branch 2 times, most recently from b90d5bf to caf0212 Compare November 27, 2023 11:00
----

* `$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).
Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

Comment on lines 382 to 401
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)`
----
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

@TykovkaV TykovkaV requested a review from vkepin December 4, 2023 11:19
*/
@Deprecated(since = "0.6.4", forRemoval = true)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
@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

Copy link
Collaborator

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.
Copy link
Collaborator

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.:

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `$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.
Copy link
Collaborator

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.:

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `$draggable` - The <<_locator,locator>> to identify the element to be dragged
* `$draggable` - The <<_locator,locator>> to identify the element to be dragged.

=== 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).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
==== 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).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `$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)`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
==== The drag and drop operation simulation
==== Drag and drop simulation

@valfirst valfirst merged commit 4b1b72a into vividus-framework:master Dec 11, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants