Beispiel #1
0
        public string Open_Main_Page()
        {
            setup();
            webGoat.openMainPage();
            var pageHtml = ie.html();

            Assert.That(pageHtml.contains("WebGoat"), "Could not find the word WebGoat in the default page");
            if (ie.hasButton("Start WebGoat"))
            {
                webGoat.openMainPage();
                ie.button("Start WebGoat").flash().click();
                Assert.That(pageHtml.contains("WebGoat"), "Could not find the word WebGoat in the default page");
            }
            LocalCopyAvailable = true;
            return("ok");
        }
Beispiel #2
0
        [Test] public void TM_Config_TM_Security__Show_Content_Rules()
        {
            var texts_WithLoginForm = new [] { "Login required", "If you have a valid account", "if not, please sign up for an account to gain access" };
            var texts_LibraryView   = new [] { "Guidance Libraries", "Technology", "Phase", "Type" };

            //Mode 1: Anonymous users cannot see library and content (just a login form)
            tmConfig.TMSecurity.Show_ContentToAnonymousUsers = false;
            tmConfig.TMSecurity.Show_LibraryToAnonymousUsers = false;
            ieTeamMentor.page_Home();

            ie.html().assert_Contains(texts_WithLoginForm);
            ie.html().assert_Not_Contains(texts_LibraryView);

            //Mode 2: Anonymous users can see library but no content (still asked to login using Form)
            tmConfig.TMSecurity.Show_ContentToAnonymousUsers = false;
            tmConfig.TMSecurity.Show_LibraryToAnonymousUsers = true;
            ieTeamMentor.page_Home();
            ie.waitForField("ctl00_ContentPlaceHolder1_UsernameBox");       // wait for the right hand ajax page to load

            ie.html().assert_Contains(texts_WithLoginForm);
            ie.html().assert_Contains(texts_LibraryView);

            //Mode 3: Anonymous users can see library and content
            tmConfig.TMSecurity.Show_ContentToAnonymousUsers = true;
            tmConfig.TMSecurity.Show_LibraryToAnonymousUsers = true;
            ieTeamMentor.page_Home();

            ie.waitForField("ctl00_ContentPlaceHolder1_UsernameBox", 150, 10);      // will fail to find it

            ie.html().assert_Not_Contains(texts_WithLoginForm);
            ie.html().assert_Contains(texts_LibraryView);
        }
Beispiel #3
0
        [Test] public void Issue_838__SiteData_custom_TBot_pages_can_conflict_with_the_main_TBot_pages()
        {
            //Open main Tbot Page and capture number of links

            ieTeamMentor.open_TBot_Login_if_Needed()
            .html().assert_Contains("your friendly TeamMentor Bot", "Welcome to the TBot control center");

            var links_Size = ieTeamMentor.ie.links().size().assert_Bigger_Than(15);

            //Create a Custom TbotPage and confirm it can be executed ok
            tmFileStorage.path_SiteData()
            .folder_Create_Folder("Tbot")                                            // create a TBot folder in the Site_Data folder
            .folder_Create_File("tbotPage.cshtml", "this is an TBot page: @(40+2)"); // create a test Razor page inside it

            ieTeamMentor.page_TBot();                                                // Refresh page

            ie.assert_Has_Link("tbotPage")                                           // check that there is an new Tbot link to 'tbotPage'
            .links().size().assert_Is(links_Size.inc());                             // if the name is unique to the current list, then it should add to the list

            ie.link("Reset Razor Templates").click(); ie.html().assert_Contains("Current Razor Templates");
            ie.link("TBot").click(); ie.html().assert_Contains("Available TBot Commands");
            ie.link("tbotPage").click(); ie.html().assert_Contains("this is an TBot page: 42");


            // Create a Tbot page with the same name of an existing Tbot Page (for example DebugInfo)

            tmFileStorage.path_SiteData()
            .folder_Create_Folder("Tbot")                                                                   // create a TBot folder in the Site_Data folder
            .folder_Create_File("DebugInfo.cshtml", "this is an TBot page: @(40+2)");

            ieTeamMentor.page_TBot();                              // Refresh page

            //**** Here is the core of the Issue_838
            ie.links().size().assert_Is(links_Size.inc());        // there should still be only one new TBOT page (the one added above

            ie.link("Reset Razor Templates").click();
            ie.link("TBot").click();
            ie.link("DebugInfo").click();                          // opening DebugInfo
            ie.html().assert_Contains("this is an TBot page: 42"); // should show the 'overridden' Tbot page
        }
Beispiel #4
0
 public string html()
 {
     return(ie.html());
 }