Is there a way to speed up AngularJS protractor tests?

后端 未结 7 506
孤城傲影
孤城傲影 2021-01-31 05:10

I have created tests for my application. Everything works but it runs slow and even though only 1/3 of the application is tested it still takes around ten minutes for protrator

7条回答
  •  [愿得一人]
    2021-01-31 05:52

    Another speed tip I've found is that for every test I was logging in and logging out after the test is done. Now I check if I'm already logged in with the following in my helper method;

      # Login to the system and make sure we are logged in.
      login: ->
        browser.get("/login")
        element(By.id("username")).isPresent().then((logged_in) ->
          if logged_in == false
            element(By.id("staff_username")).sendKeys("admin")
            element(By.id("staff_password")).sendKeys("password")
            element(By.id("login")).click()
        )
    

提交回复
热议问题