How do I run a PHPUnit Selenium test without having a new browser window run for each function?

前端 未结 5 1836
逝去的感伤
逝去的感伤 2021-01-13 05:06

I am trying to run a selenium test case using PHPUnit. And the first thing I do is trying the login function, this works perfect but then I want to run a function to check i

5条回答
  •  悲哀的现实
    2021-01-13 05:29

    Okej so I guess you can just call the function directly from another function like so:

    public function testOne
    {
    #code
    $this->Two();
    }
    
    public function Two()
    {
    #code
    $this->Three();
    }
    
    public function Three()
    {
    #code
    }
    

    and so on, this will just run the next function without a new browser, however, if it fails anywhere in any test the whole test is stoped so the feedback wont bee as good as individual tests.

提交回复
热议问题