Ejemplo n.º 1
0
		public void LoginToSite()
		{
			XDocument doc = XDocument.Load(DataFileLocation);

			XElement settings = doc.Document.Element("Tests").Element("settings");
			XElement testSettings = doc.Document.Element("Tests").Element("modules");

			string testName = testSettings.Attribute("name").Value;

			_driver = StartBrowser(settings.Attribute("browser").Value);
			_baseUrl = settings.Attribute("baseURL").Value;

			Trace.WriteLine(BasePage.RunningTestKeyWord + "'" + testName + "'");
			Trace.WriteLine(BasePage.PreconditionsKeyWord);

			OpenMainPageAndLoginAsHost();

			//Create a Page
			var blankPage = new BlankPage(_driver);
			blankPage.OpenAddNewPageFrameUsingControlPanel(_baseUrl);
			blankPage.AddNewPage("page");

			//Delete Default HTML Module on page
			blankPage.OpenUsingUrl(_baseUrl,"page");
			var module = new Modules(_driver);
			Trace.WriteLine(BasePage.TraceLevelElement + "Find the Module number:");
			string moduleNumber =
				module.WaitForElement(By.XPath(Modules.LocationDescription["ContentPane"].IdWhenOnPage + Modules.CommonModulesDescription["HtmlModule"].IdWhenOnPage + "/a")).GetAttribute("name");
			module.DeleteModule(moduleNumber);

			//Export new page as Default
			var pageExportPage = new PageExportPage(_driver);
			pageExportPage.OpenUsingControlPanel(_baseUrl + "/page");
			pageExportPage.ExportPage("Default", "NewDefault");

			//Create set of pages with New Default
			var adminPageManagementPage = new AdminPageManagementPage(_driver);
			adminPageManagementPage.OpenUsingButtons(_baseUrl);
			adminPageManagementPage.AddPagesInBulk(">" + "Page", "P1Modules", 65, AdminPageManagementPage.PageType.Web, "Home");

			//Create set of pages for Drag&Drop tests with New Default
			adminPageManagementPage.OpenUsingButtons(_baseUrl);
			adminPageManagementPage.AddPagesInBulk(">" + "Page", "P1ModulesDragDrop", 65, AdminPageManagementPage.PageType.Web, "Home");
			
			//Create a page with 4 HtmlModuleDictionary Modules on page
			blankPage.OpenUsingUrl(_baseUrl, "Home/P1Modules/Page61");
			module.OpenModulePanelUsingControlPanel();
			int i = 1;
			while (i < 5)
			{
				module.AddNewModuleUsingMenu(HtmlModuleDictionary.IdWhenOnBanner, HtmlModuleDictionary.IdWhenOnPage, "ContentPane");
				i++;
			}
			
			_logContent = LogContent(); 
		}