boa-constrictor icon indicating copy to clipboard operation
boa-constrictor copied to clipboard

[FEATURE]: New Task: shift+click, or more general keypress+click

Open imnasnainaec opened this issue 3 years ago • 4 comments

Description

I would like a new WebDriver Task for holding a key (or keys) and clicking. With Key in the constructor, the method could be something like as follows:

        /// <summary>
        /// Clicks the web element while holding the specified Key.
        /// Use browser actions instead of direct click (due to IE).
        /// </summary>
        /// <param name="actor">The screenplay actor.</param>
        /// <param name="driver">The WebDriver.</param>
        public override void PerformAs(IActor actor, IWebDriver driver)
        {
            actor.WaitsUntil(Existence.Of(Locator), IsEqualTo.True());
            new Actions(driver).MoveToElement(driver.FindElement(Locator.Query)).KeyDown(Key).Click().KeyUp(Key).Perform();
        }

Alternatives

No response

Anything else?

I'd be happy to setup the pr--please let me know if I should proceed--or let somebody else do it.

We are needing shift+click for testing one function of https://github.com/sillsdev/TheCombine.

Commitments

  • [X] I agree to follow Boa Constrictor's Code of Conduct.
  • [X] I want to work on this issue myself.

imnasnainaec avatar Oct 27 '21 17:10 imnasnainaec

@imnasnainaec , this sounds awesome! I assigned it to you. Here's our contributing guide: https://q2ebanking.github.io/boa-constrictor/contributing/contributing-code/

AutomationPanda avatar Oct 27 '21 18:10 AutomationPanda

Maybe this more abstractly could be an action like Modifier Click and similarly Modifier Chord

CoffeeAtBedtime avatar Dec 04 '22 19:12 CoffeeAtBedtime

Hi @imnasnainaec! Is this something you'd still like to implement?

AutomationPanda avatar Dec 13 '22 00:12 AutomationPanda

@AutomationPanda It is, though my work schedule has been changing and I don't expect to be able to work on it until next spring or summer.

imnasnainaec avatar Dec 13 '22 15:12 imnasnainaec