Testing AngularJS with Selenium

后端 未结 12 762
梦毁少年i
梦毁少年i 2020-11-27 04:56

I have a SPA application on stack ASP MVC + AngularJS and I\'d like to test the UI. For now I\'m trying Selenium with PhantomJS and WebKit drivers.

This is a sample

12条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 05:37

    I have implemented usage based on D Sayar's answer And it might helpful for someone. You just have to copy all boolean functions mention over there in to single class, And then add below PageCallingUtility() method. This method is calling internal dependency.

    In your normal usage you need to directly call PageCallingUtility() method.

    public void PageCallingUtility()
    {
        if (DomHasLoaded() == true)
        {
            if (IsJqueryBeingUsed() == true)
            {
                JqueryHasLoaded();
            }
    
            if (AngularIsBeingUsed() == true)
            {
                AngularHasLoaded();
            }
        }
    }
    

提交回复
热议问题