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 easy support for drag and drop e.g. sliders #76

Closed
occupant23 opened this issue Mar 19, 2019 · 4 comments
Closed

Add easy support for drag and drop e.g. sliders #76

occupant23 opened this issue Mar 19, 2019 · 4 comments
Assignees
Labels
codeDone The issue is rechecked for development branch codeReadyForRecheck The issue is fixed/implemented AND merged into development, but needs to be rechecked there feature Low Priority
Milestone

Comments

@occupant23
Copy link
Contributor

Selenide seems not to have such a feature. Implement it for Neo and try to port it back to Selenide.

@occupant23
Copy link
Contributor Author

PoC and implementation idea:

import org.openqa.selenium.interactions.Action;
import org.openqa.selenium.interactions.Actions;

...

private void slideHorizontalUntilText(SelenideElement leftSlider, int movement, SelenideElement textContainer, String textToFind)
    {
        Actions moveSlider = new Actions(Neodymium.getDriver());

        int counter = 0;
        while (!textContainer.has(text(textToFind)))
        {
            if (counter > 23)
            {
                SelenideAddons.wrapAssertionError(() -> {
                    Assert.assertTrue("CircutBreaker: Was not able to interact with the slider", false);
                });
            }
            Action action = moveSlider.dragAndDropBy(leftSlider.getWrappedElement(), movement, 0).build();
            action.perform();
            Selenide.sleep(3000);
            counter++;
        }
    }

@occupant23
Copy link
Contributor Author

occupant23 commented Mar 19, 2020

Next steps:

  • Add this functionality to the SelenideAddon class
  • Build a basic function that can cover linear 2d movements
  • Adopt variable naming
  • Add short had functions for horizontal and vertical movements
  • Add documentation to our wiki
  • Add unit tests for this functions

@jseng92
Copy link

jseng92 commented Apr 2, 2020

added requested changes

@jseng92
Copy link

jseng92 commented Apr 2, 2020

we skip the "Add short had functions for horizontal and vertical movements" step because these functions are to special, so if needed the user can implement them by himself and use the generell function for it
There will be an example inside the documentation and in the code

occupant23 added a commit that referenced this issue Apr 3, 2020
@occupant23 occupant23 added codeReadyForRecheck The issue is fixed/implemented AND merged into development, but needs to be rechecked there codeDone The issue is rechecked for development branch labels Apr 3, 2020
@occupant23 occupant23 changed the title Add easy support for drag and dropping sliders Add easy support for drag and drop e.g. sliders Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
codeDone The issue is rechecked for development branch codeReadyForRecheck The issue is fixed/implemented AND merged into development, but needs to be rechecked there feature Low Priority
Projects
None yet
Development

No branches or pull requests

2 participants