Exemplo n.º 1
0
 public IE_TeamMentor(string webRoot, string path_XmlLibraries, Uri siteUri, bool startHidden)
 {
     this.ie = "Test_IE_TeamMentor".popupWindow(1000, 700, startHidden).add_IE();
     this.path_XmlLibraries = path_XmlLibraries;
     this.webRoot           = webRoot;
     this.siteUri           = siteUri;
 }
 	public API_WordPress_IE(WatiN_IE _ie, Uri serverUri) 
 	{
 		this.ie = _ie;   
 		this.ServerUri = serverUri;
 		
 		configureDependencies();
 	}
Exemplo n.º 3
0
 public static WatiN_IE assert_Has_Link(this WatiN_IE watinIe, string linkId, string message = NUnit_WatiN_Messages.ASSERT_HAS_LINK)
 {
     watinIe.assert_Has_Valid_Url()
     .waitForLink(linkId)
     .assert_Not_Null(message.format(watinIe.url(), linkId));
     return(watinIe);
 }
        public static WatiN_IE assert_Url_Is(this WatiN_IE watinIe, string expectedUrl, string message = Extra_NUnit_Messages.ASSERT_URL_IS)
        {
            var url = watinIe.url();

            url.assert_Is(expectedUrl, message.format(url, expectedUrl));
            return(watinIe);
        }
 public static WatiN_IE assert_Has_Links(this WatiN_IE watinIe, params string[] linksIds)
 {
     foreach (var linkId in linksIds)
     {
         watinIe.assert_Has_Link(linkId);
     }
     return(watinIe);
 }
Exemplo n.º 6
0
 public void testFixtureSetup()
 {
     admin_Name = "admin";
     admin_Pwd  = "!!tmadmin";
     ie         = "Test_Cassini_User_Management".add_IE_Hidden_PopupWindow();
     //ie.parentForm().show();
     //ie.script_IE().waitForClose();
 }
Exemplo n.º 7
0
 public static WatiN_IE assert_Has_Valid_Url(this WatiN_IE watinIe, string message = NUnit_WatiN_Messages.ASSERT_HAS_VALID_URL)
 {
     if (watinIe.notNull())
     {
         watinIe.url().isUri().assert_True(message);
     }
     return(watinIe);
 }
 	public API_HacmeBank(string websitePort, WatiN_IE watinIE) 
 	{
 		Url_Website = "http://localhost:{0}/HacmeBank_v2_Website".format(websitePort);
 		if (watinIE.isNull())
 			ie = "".ie(0,450,800,700);  
 		else
 			ie = watinIE;
 	}
		public API_SuperSecureBank(WatiN_IE _ie, bool disableFlashing)
		{
			ie = _ie;
			if (disableFlashing)
				ie.disableFlashing();
			else
				ie.enableFlashing();
		}			
Exemplo n.º 10
0
        [SetUp] public void setUp()
        {
            webRoot.assert_Folder_Exists();
            path_XmlLibraries.assert_Folder_Exists();
            siteUri.assert_Not_Null();

            ieTeamMentor = new IE_TeamMentor(webRoot, path_XmlLibraries, siteUri, startHidden: true);
            ie           = ieTeamMentor.ie;
        }
Exemplo n.º 11
0
 	public IE_JQuery(WatiN_IE _ie)
 	{    		
 		this.ie = _ie;
 		this.PathToJQueryFile = @"jquery-1.5.2.min.js".local();
 		this.DebugMode = false;
 		
 		ie.onNavigate((url)=> this.installJQuery() );
 		this.installJQuery();
 	}
 public void setup()
 {
     if (WebUtils.offline())
         "Skipping test because we are offline".assert_Ignore();
     ie = "Test_Cassini_Library_Management".add_IE_PopupWindow(1000,600);
     admin_Name = "admin";
     admin_Pwd  = "!!tmadmin";
     server 	   = apiCassini.url();
 }
        public void setUp()
        {
            webRoot          .assert_Folder_Exists();
            path_XmlLibraries.assert_Folder_Exists();
            siteUri          .assert_Not_Null();

            ieTeamMentor = new IE_TeamMentor(webRoot, path_XmlLibraries, siteUri, startHidden: true);
            ie           = ieTeamMentor.ie;
        }
Exemplo n.º 14
0
 public void setup()
 {
     if (WebUtils.offline())
     {
         "Skipping test because we are offline".assert_Ignore();
     }
     ie         = "Test_Cassini_Library_Management".add_IE_PopupWindow(1000, 600);
     admin_Name = "admin";
     admin_Pwd  = "!!tmadmin";
     server     = apiCassini.url();
 }
        public void testFixtureSetUp()
        {
            nUnitTests_Cassini = new NUnitTests_Cassini_TeamMentor().start();
            tmProxy            = nUnitTests_Cassini.tmProxy();
            ieTeamMentor       = nUnitTests_Cassini.new_IE_TeamMentor(true);
            ie                 = ieTeamMentor.ie;

            nUnitTests_Cassini.siteUri.GET().assert_Contains("TeamMentor");     // make a request to trigger Asp.NET pipeline and TM Startup
            tmProxy.map_ReferencesToTmObjects();                                // these should be alive after startup
            tmConfig = tmProxy.TmConfig     .assert_Not_Null();                 // specially the TMConfig object
        }
Exemplo n.º 16
0
        [TestFixtureSetUp] public void testFixtureSetUp()
        {
            nUnitTests_Cassini = new NUnitTests_Cassini_TeamMentor().start();
            tmProxy            = nUnitTests_Cassini.tmProxy();
            ieTeamMentor       = nUnitTests_Cassini.new_IE_TeamMentor(true);
            ie = ieTeamMentor.ie;

            nUnitTests_Cassini.siteUri.GET().assert_Contains("TeamMentor");     // make a request to trigger Asp.NET pipeline and TM Startup
            tmProxy.map_ReferencesToTmObjects();                                // these should be alive after startup
            tmConfig = tmProxy.TmConfig.assert_Not_Null();                      // specially the TMConfig object
        }
Exemplo n.º 17
0
        public override void testFixtureSetUp()
        {
            base.testFixtureSetUp();

            this.tmProxy_Refresh()
            .tmProxy.assert_Not_Null();

            tmFileStorage = tmProxy.TmFileStorage.assert_Not_Null();

            ieTeamMentor = this.new_IE_TeamMentor_Hidden(true);
            ie           = ieTeamMentor.ie;
        }
Exemplo n.º 18
0
        public void testFixtureSetUp()
        {
            TmQAConfig = new TM_QA_Config_Loader().load();
            if (TmQAConfig.serverOffline())
                Assert.Fail("[TestFixture_WebServices]TM server is offline: {0}".info(WebSite_Url));

            tbot = new IE_UnitTest
                {
                    TargetServer = TmQAConfig.Url_Target_TM_Site
                };
            ie = tbot.ie;
        }
Exemplo n.º 19
0
        public static ascx_Simple_Script_Editor script_IE(this WatiN_IE ie)
        {
            ie.parentForm().show();                                     // in case it is hidden
            var codeToAppend = "//using FluentSharp.Watin".line() +     // required refereces to allow easy scripting
                               "//using WatiN.Core       ".line() +
                               "//O2Ref:WatiN.Core.dll   ";

            var scriptEditor = ie.script_Me("ie")                       // set varaible name to 'ie' instead of 'watiN_IE'
                               .code_Append(codeToAppend);

            return(scriptEditor);
        }
Exemplo n.º 20
0
 public API_HacmeBank(string websitePort, WatiN_IE watinIE)
 {
     Url_Website = "http://localhost:{0}/HacmeBank_v2_Website".format(websitePort);
     if (watinIE.isNull())
     {
         ie = "".ie(0, 450, 800, 700);
     }
     else
     {
         ie = watinIE;
     }
 }
 public static T showViewState <T>(this T control, WatiN_IE ie, bool showDetailedView)
     where T : System.Windows.Forms.Control
 {
     if (showDetailedView)
     {
         control.showViewState(ie);
     }
     else
     {
         control.showViewStateValues(ie);
     }
     return(control);
 }
Exemplo n.º 22
0
    	public  API_Blogger(WatiN_IE ie)
    	{
    		if (ie !=null)
    			IE = ie;
    		else
    			IE = "".ie(0,450,800,700);  
 
    		LoginPage = "https://www.blogger.com/start";
    		LogoutPage = "http://www.blogger.com/logout.g";
    		DashboardPage = "http://www.blogger.com/home";    		
    		ExpectedTitle_LoginPage = "Blogger: Create your free blog";
    		ExpectedTitle_DashboardPage = "Blogger: Dashboard";
    		ExpectedTitle_NewPost = "blog - Create Post";
    	}
Exemplo n.º 23
0
        public static WatiN_IE                  reload_LibraryTree(this WatiN_IE ie)
        {
            ie.invokeEval(@"TM.Gui.Dialog.alertUser('Refreshing Library Tree ','TM QA script');

                            $('#gui_West_bottom').load('/Html_Pages/Gui/Panels/Left_LibraryTree.html',function()
                                {
                                    TM.Debug.reuseLibraryMappingsObject = false;
                                    TM.Events.onGuiObjectsLoaded();                             
                                    window.TM.Gui.LibraryTree.showTree()
                                    window.TM.Gui.LibraryTree.selectFirstNode();            
                                });
                           ");
            return(ie);
        }
Exemplo n.º 24
0
        [TestFixtureSetUp] public void testFixtureSetUp()
        {
            TmQAConfig = new TM_QA_Config_Loader().load();
            if (TmQAConfig.serverOffline())
            {
                Assert.Fail("[TestFixture_WebServices]TM server is offline: {0}".info(WebSite_Url));
            }

            tbot = new IE_UnitTest
            {
                TargetServer = TmQAConfig.Url_Target_TM_Site
            };
            ie = tbot.ie;
        }
Exemplo n.º 25
0
        public TestFixture_TBot()
        {
            Assert.Ignore("Disable IE tests");
            TmQAConfig = new TM_QA_Config_Loader().load();
            if (TmQAConfig.serverOffline())
            {
                Assert.Ignore("[TestFixture_WebServices]TM server is offline: {0}".info(WebSite_Url));
            }

            tbot = new API_IE_TBot
            {
                TargetServer = TmQAConfig.Url_Target_TM_Site
            };
            ie = tbot.ie;
        }
Exemplo n.º 26
0
        public static WatiN_IE wait_For_Url(this WatiN_IE watinIe, string expectedUrl, int maxWait = 1000)
        {
            var splitWait = maxWait / 10;

            for (var i = 0; i < 10; i++)
            {
                if (watinIe.url() == expectedUrl)
                {
                    return(watinIe);
                }
                splitWait.sleep();
            }
            "[WatiN_IE][wait_For_Url]  did not found expected url '{0}' after {1} miliseconds. The current value is: '{2}'".format(expectedUrl, maxWait, watinIe.url());
            return(watinIe);
        }
        public Unit_Tests_using_IE set_IE_Object(string key)
        {
            ie = key.o2Cache <WatiN_IE>(
                () => {
                "[Test_TM_IE] Setting IE object to key ".info(key);
                ie = "IE for {0}".format(key)
                     .popupWindow(800, 500)
                     .add_IE()
                     .silent(false);

                ie.WebBrowser.onClosed(() => key.o2Cache(null));
                return(ie);
            });
            Assert.That(ie.notNull(), "set_IE_Object ie was null");
            return(this);
        }
Exemplo n.º 28
0
        /// <summary>
        /// Wait for an element to have a value in its InnerHtml
        ///
        /// Returns null if the element was not found
        /// </summary>
        /// <param name="watinIe"></param>
        /// <param name="elementName"></param>
        /// <param name="maxWait"></param>
        /// <returns></returns>
        public static WatiN_IE wait_For_Element_InnerHtml(this WatiN_IE watinIe, string elementName, int maxWait = 1000)
        {
            var splitWait = maxWait / 10;

            for (var i = 0; i < 10; i++)
            {
                var element = watinIe.element(elementName);
                if (element.notNull() && element.innerHtml().valid())
                {
                    return(watinIe);
                }
                splitWait.sleep();
            }
            "[WatiN_IE][wait_For_Url]  did not found valid innerHtml inside element '{0}' after {1} miliseconds. ".error(elementName, maxWait);
            return(null);
        }
        public static WatiN_IE show_Formated_Javascript(this WatiN_IE ie, WatiN_IE temp_ie, string codeToFormat)
        {		
            var prettifyHtml = @"prettify.htm".local();
            if (prettifyHtml.fileExists().isFalse())
                return ie;			
			
            if (ie.url().isNull() || ie.url().contains("prettify.htm").isFalse())
                ie.open(prettifyHtml);  						
            var formatedJsCode = (temp_ie.isNull()) 
                                     ? ie.HostControl.formatJsCode(codeToFormat)
                                     : temp_ie.formatJsCode(codeToFormat);			
						
            var codeDiv = ie.div("codeDiv");
            codeDiv.innerHtml("<pre id=\"code\" class=\"prettyprint\">{0}</pre>".format(formatedJsCode));			
            ie.invokeScript("prettyPrint"); 			
            return ie;
        }
Exemplo n.º 30
0
    	public WatiN_IE set_IE_Object(string key)
    	{
    		ie = key.o2Cache<WatiN_IE>(
								()=> {
										"[Test_TM_IE] Setting IE object to key ".info(key);
										ie = "IE for {0}".format(key)
														 .popupWindow(800,500)
														 .add_IE()
														 .silent(true);
										
										ie.WebBrowser.onClosed(()=> key.o2Cache(null) );
										return ie;
									 });
			Assert.That(ie.notNull(), "set_IE_Object ie was null");
//			check_if_TM_WebServer_is_Running();
			return ie;
    	}
Exemplo n.º 31
0
        public WatiN_IE set_IE_Object(string key)
        {
            ie = key.o2Cache <WatiN_IE>(
                () => {
                "[Test_TM_IE] Setting IE object to key ".info(key);
                ie = "IE for {0}".format(key)
                     .popupWindow(800, 500)
                     .add_IE()
                     .silent(true);

                ie.WebBrowser.onClosed(() => key.o2Cache(null));
                return(ie);
            });
            Assert.That(ie.notNull(), "set_IE_Object ie was null");
//			check_if_TM_WebServer_is_Running();
            return(ie);
        }
Exemplo n.º 32
0
        /// <summary>
        /// tries to find a link or button using the provided identified (<paramref name="linkOrButtonRef"/>) and click on it
        ///
        /// Returns the original watinIe object so that multiple clicks can be chained
        ///
        /// Returns null if the link or button was not found
        /// </summary>
        /// <param name="watinIe"></param>
        /// <param name="linkOrButtonRef"></param>
        /// <returns></returns>
        public static WatiN_IE click(this WatiN_IE watinIe, string linkOrButtonRef)
        {
            if (watinIe.isNull() || linkOrButtonRef.notValid())
            {
                return(watinIe);
            }
            if (watinIe.hasLink(linkOrButtonRef))
            {
                watinIe.link(linkOrButtonRef).click();
                return(watinIe);
            }
            if (watinIe.hasButton(linkOrButtonRef))
            {
                watinIe.button(linkOrButtonRef).click();
                return(watinIe);
            }

            "[WatiN_IE][click] could not find link or button with reference: {0}".error(linkOrButtonRef);
            return(null);
        }
Exemplo n.º 33
0
        /// <summary>
        /// Wait for an element innerText to match the <paramref name="expectedValue"/> value
        ///
        /// Note: the comparison is not CaseSensitive and trim is applied to the search values
        ///
        /// Returns null if the element was not found or if it was found but the values didn't match
        /// </summary>
        /// <param name="watinIe"></param>
        /// <param name="elementName"></param>
        /// /// <param name="expectedValue"></param>
        /// <param name="maxWait"></param>
        /// <returns></returns>
        public static WatiN_IE wait_For_Element_InnerText(this WatiN_IE watinIe, string elementName, string expectedValue, int maxWait = 1000)
        {
            if (watinIe.isNull() || elementName.notValid())
            {
                return(watinIe);
            }
            var splitWait = maxWait / 10;

            expectedValue = expectedValue.notNull() ? expectedValue.lower().trim() : "";
            for (var i = 0; i < 10; i++)
            {
                var element = watinIe.element(elementName);
                if (element.notNull() && element.innerText().valid() && element.innerText().lower().trim() == expectedValue)
                {
                    return(watinIe);
                }
                splitWait.sleep();
            }
            "[WatiN_IE][wait_For_Url] did not found the expected '{0}' value inside the element '{1}' after {2} miliseconds. ".error(expectedValue, elementName, maxWait);
            return(null);
        }
Exemplo n.º 34
0
 public void setUp()
 {
     ie = "Test_Cassini_User_Management".add_IE_Hidden_PopupWindow();
 }
Exemplo n.º 35
0
 	public IE_Google(WatiN_IE ie) : base(ie)
 	{
 	 	config();
 	}
 	public  HacmeBank_BlackBox_Exploits(WatiN_IE browser, string startUrl)
 	{
 		Browser = browser;
 		StartUrl = "http://127.0.0.1:8080/petclinic";    		
 	}
 	public API_EventBrite(WatiN_IE watinIe)
 	{
 		ie = watinIe;
 		
 	}
 [SetUp] public void setup()
 {
     ie = "Test_WatiN_IE_ExtensionMethods_Elements".popupWindow_Hidden_With_IE();
     ie.showMessage(testMessage);
 }
Exemplo n.º 39
0
 /// <summary>
 /// calls <code>tmProxy.cache_Reload__Data();</code> before watinIe.reload_LibraryTree()
 /// </summary>
 /// <param name="tmProxy"></param>
 /// <param name="ie"></param>
 /// <returns></returns>
 public static TM_Proxy                  reload_LibraryTree(this TM_Proxy tmProxy, WatiN_IE ie)
 {
     tmProxy.cache_Reload__Data();
     ie.reload_LibraryTree();
     return(tmProxy);
 }
Exemplo n.º 40
0
 	public API_SI_Exams(WatiN_IE _ie)
 	{    		
 		this.ie = _ie;
 		//setGuiAutomation();
 	}
Exemplo n.º 41
0
        public ascx_Edit_AspNet_Pages buildGui()
        {
            var topPanel = this.add_Panel();

            topPanel.insert_LogViewer();

            ActionsPanel = topPanel.insert_Above <Panel>(70).add_GroupBox("Actions").add_Panel();
            AspNetFiles  = topPanel.insert_Left <Panel>(300).add_GroupBox("ASP.NET Files")
                           .add_TreeView()
                           .sort();


            ActionsPanel.add_Label("WebRoot", 30, 0).autoSize()
            .append_TextBox(this.File_Path)
            .width(200)
            .onEnter(
                (text) => {
                this.File_Path = text;
                this.loadFiles_FromLocalFolder();
            })
            .append_Label("Url").top(30).autoSize()
            .append_TextBox(this.Web_Address)
            .width(200)
            .onTextChange((text) => this.Web_Address = text)
            .append_Link("refresh IE", () => ie.open_ASync(ie.url()));

            Aspx_CodeViewer   = topPanel.add_GroupBox("Aspx page").add_SourceCodeViewer();
            CSharp_CodeViewer = Aspx_CodeViewer.parent().insert_Below().add_GroupBox("CSharp page").add_SourceCodeEditor();

            this.ie = topPanel.add_IE_SideView();
            ActionsPanel.add_Link("Compile project", 5, 0,
                                  () => {
                if (this.CSProj_File.fileExists())
                {
                    var msBuild    = @"C:\Windows\Microsoft.NET\Framework\v3.5\MSBuild.exe";
                    var parameters = "\"{0}\"".format(CSProj_File);
                    msBuild.startProcess(parameters,
                                         (log) => {
                        if (log.isNull())
                        {
                            return;
                        }
                        if (log.lower().contains("error "))
                        {
                            log.error();
                        }
                        else
                        if (log.lower().contains("warning "))
                        {
                            log.debug();
                        }
                        else
                        {
                            log.info();
                        }
                    });
                }
                else
                {
                    "CSProj_File variable is not set of file does not exist: {0}".error(CSProj_File);
                }
            });


            this.ActionsPanel.add_CheckBox("Show *.cs files", 5, 200,
                                           (value) => {
                this.ShowFilesWithExtension_CS = value;
                this.loadFiles_FromLocalFolder();
            }).autoSize();

            this.ActionsPanel.add_CheckBox("Show *.ascx, *.asax, *.config files", 5, 320,
                                           (value) => {
                this.ShowFilesWithExtension_AscxAsaxConfig = value;
                this.loadFiles_FromLocalFolder();
            }).autoSize();

            var splitContainers = this.controls <SplitContainer>(true);

            this.ActionsPanel.add_CheckBox("show/open source code files", 5, 550,
                                           (value) => {
                this.OpenSourceCodeFiles = value;
                splitContainers[2].panel1Collapsed(value.isFalse());
            }).autoSize().@check();

            setPageViewers();


            AspNetFiles.add_ContextMenu().add_MenuItem("refresh", () => this.loadFiles_FromLocalFolder());
            return(this);
        }
Exemplo n.º 42
0
 public static WatiN_IE wait_For_Link(this WatiN_IE watinIe, string nameOrId)
 {
     watinIe.waitForLink(nameOrId);
     return(watinIe);
 }
Exemplo n.º 43
0
 public static WatiN_IE open(this WatiN_IE watinIe, Uri uri)
 {
     return((watinIe.notNull() && uri.notNull())
         ? watinIe.open(uri.str())
         : watinIe);
 }
Exemplo n.º 44
0
 public static WatiN_IE script_IE_WaitForClose(this WatiN_IE ie)
 {
     ie.script_IE().waitForClose();
     return(ie);
 }
		public API_JPetStore(WatiN_IE _ie)
		{
			ie = _ie;
		}			
Exemplo n.º 46
0
 public HacmeBank_BlackBox_Exploits(WatiN_IE browser, string startUrl)
 {
     Browser  = browser;
     StartUrl = "http://127.0.0.1:8080/petclinic";
 }
Exemplo n.º 47
0
 public API_TeamMentor_IE(WatiN_IE ie)
     : base(ie)
 {
     config();
 }
 	public IE_TeamProfessor(WatiN_IE ie) : base(ie)
 	{
 	 	config();
 	}
 	public API_EventBrite()
 	{
 		ie = "".ie(0,450,800,700);      		
 	}
 	public API_IE_CxWebClient(WatiN_IE ie) : base(ie)
 	{    		
 	 	config();
 	}
Exemplo n.º 51
0
 	public WatiN_IE set_IE_Object(WatiN_IE _ie)
 	{
 		this.ie = _ie;
 		return _ie;
 	}    	    
 	public API_IE_CxWebClient(WatiN_IE ie) : base(ie)
 	{    		
 	 	config(DEFAULT_SERVER);
 	}
Exemplo n.º 53
0
 	public static string jQuery_Append_Body(this string htmlToAppend, WatiN_IE ie)
 	{    		
 		ie.jQuery_Append_Body(htmlToAppend);
 		return htmlToAppend;
 	}
Exemplo n.º 54
0
 		public API_WebGoat(WatiN_IE _ie, string localDirectoryWithWebGoatInstallation)
 		{
 			ie = _ie;
 			Dir_LocalInstallation = localDirectoryWithWebGoatInstallation; 		
 		}
 [SetUp] public void setup()
 {
     ie = "Test_WatiN_IE_ExtensionMethods_Inject_Html".popupWindow_Hidden_With_IE();            
     
 }
Exemplo n.º 56
0
 public static WatiN_IE wait_For_Uri(this WatiN_IE watinIe, Uri expectedUri, int maxWait = 1000)
 {
     return((watinIe.notNull() && expectedUri.notNull())
         ? watinIe.wait_For_Url(expectedUri.str(), maxWait)
         : watinIe);
 }
 	public API_IE_CxWebClient(WatiN_IE ie, string targetServer) : base(ie)
 	{
 		config(targetServer);
 	}
 	public API_EtherpadLite(WatiN_IE _ie) : this()
 	{
 		ie = _ie;
 	}    	    	
 	public API_BTOpenZone()
 	{
 		ie = "".ie(0,450,800,700);  
 		defaultWebPage =  "http://www.google.co.uk";
 	}
 /// <summary>
 /// calls <code>tmProxy.cache_Reload__Data();</code> before watinIe.reload_LibraryTree()
 /// </summary>
 /// <param name="tmProxy"></param>
 /// <param name="ie"></param>
 /// <returns></returns>
 public static TM_Proxy reload_LibraryTree(this TM_Proxy tmProxy,  WatiN_IE ie)
 {
     tmProxy.cache_Reload__Data();
     ie.reload_LibraryTree();
     return tmProxy;
 }