Can I make Behat/ZombieJS/Mink simulate a click on a “non-link” element, to fire JS listeners?

前端 未结 4 689
时光取名叫无心
时光取名叫无心 2021-01-12 18:34

I am using Behat for testing, with the ZombieJS driver, and everything is working very well so far, but there is one thing that bothers me, I can\'t seem to figure out how t

4条回答
  •  不思量自难忘°
    2021-01-12 18:53

    Yes I believe so, but you'll need to write a custom step, something along these lines (if you're using a subclass of MinkContext.

    /**
     * @When /^I click the something$/
     */
    public function iClickTheSomething() 
    {
        $something = $this->getSession()
                          ->getPage()
                          ->find("css", "div.sa")
                          ->click();
    }
    

提交回复
热议问题