public void Test_CreateFolder(string folderType, string folderName)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Create Folder:'");

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);

			adminFileManagementPage.CreateFolder(folderType, folderName);

			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the folder is present in the list");
			Assert.IsTrue(adminFileManagementPage.ElementPresent(By.XPath(FileManagementPage.FolderTreeView + "//li/div/span[text() = '" + folderName + "']")),
						"The Folder is not created correctly");
		}
Beispiel #2
0
		public void Test001_UploadFileUnder12MB()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Upload file under 12 MB'");

			var fileUploadPage = new FileUploadPage(_driver);
			fileUploadPage.OpenUsingControlPanel(_baseUrl);

			fileUploadPage.UploadFile(_smallFileToUpload, _folderName);

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);
			adminFileManagementPage.SearchForFile(_smallFileToUpload);

			Assert.IsTrue(
				adminFileManagementPage.ElementPresent(
					By.XPath("//div[contains(@class, 'dnnModuleDigitalAssetItemName')]//span/font[text() = '" + _smallFileToUpload + "']")));
		}
		public void Test_DeleteFolderUsingToolBar(string folderName, string nameToDelete)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete Folder:'");

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);
			adminFileManagementPage.SelectFolderFromTreeView("Root", folderName);

			adminFileManagementPage.SetItemsPerPage("All");

			adminFileManagementPage.DeleteUsingToolBar(folderName, nameToDelete);

			adminFileManagementPage.SelectFolderFromTreeView("Root", folderName);
			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the Folder is NOT present in the list");
			Assert.IsFalse(adminFileManagementPage.ElementPresent(By.XPath(FileManagementPage.FileView + "//trtr[contains(@style, 'visibility: visible;')]/td/div[@title = '" + nameToDelete + "']")),
						"The Folder is not deleted correctly");
		}
Beispiel #4
0
		public void Test002_UploadFileOver12MB()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Upload file over 12 MB'");

			var fileUploadPage = new FileUploadPage(_driver);
			fileUploadPage.OpenUsingControlPanel(_baseUrl);

			fileUploadPage.UploadFile(_largeFileToUpload, _folderName);

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);
			adminFileManagementPage.SearchForFile(_largeFileToUpload);

			Assert.IsFalse(
				adminFileManagementPage.ElementPresent(
					By.XPath("//div[contains(@id, 'dnnModuleDigitalAssetsListViewItem')]/span/font[text() = '" + _largeFileToUpload +
					         "']")));
		}
		public void DeleteFolder(string folderName)
		{
			Trace.WriteLine(BasePage.TraceLevelComposite + "'Delete Folder from Treeview:'" + folderName);

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);

			adminFileManagementPage.DeleteFolderFromTreeView(folderName);
		}
		public void UploadFileToFolder(string rootFolderName, string folderName, string fileNameToUpload)
		{
			Trace.WriteLine(BasePage.TraceLevelComposite + "'Upload File to Folder:'");

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);

			adminFileManagementPage.SelectFolderFromTreeView(rootFolderName, folderName);

			//adminFileManagementPage.SetItemsPerPage("All");

			adminFileManagementPage.UploadFileToFolder(folderName, fileNameToUpload);
		}
		public void CreateFolder(string folderType, string folderName)
		{
			Trace.WriteLine(BasePage.TraceLevelComposite + "'Create Folder:'");

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);

			adminFileManagementPage.CreateFolder(folderType, folderName);
		}
		public void Test_RenameFolderUsingToolBar(string folderName, string nameToEdit, string newName)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Rename Folder:'");

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);
			adminFileManagementPage.SelectFolderFromTreeView("Root", folderName);

			adminFileManagementPage.RenameUsingToolBar(folderName, nameToEdit, newName);

			adminFileManagementPage.SelectFolderFromTreeView("Root", folderName);
			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the Folder is NOT present in the list");
			Assert.IsFalse(adminFileManagementPage.ElementPresent(By.XPath(FileManagementPage.FileView + "//tr/td/div[@title = '" + nameToEdit + "']")),
						"The Folder is not renamed correctly");
		}
		public void Test0205_CopyFile(
			[ValuesAttribute("StandardFolder",
							"SecureFolder",
							"DatabaseFolder")] string folderFrom,
			[ValuesAttribute("SecureFolder",
							"StandardFolder",
							"DatabaseFolder")] string prefix,
			[ValuesAttribute("Birds.jpg",
							"Birds.pdf",
							"Birds.zip")] string fileToMove)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Copy File to Folder:'" + prefix + fileToMove);

			var folderTo = folderFrom + "CopyTo" + prefix;

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);
			adminFileManagementPage.SelectFolderFromTreeView("Root", folderFrom);

			adminFileManagementPage.CopyFile(folderFrom, folderTo, prefix + fileToMove);

			adminFileManagementPage.SelectFolderFromTreeView("Root", folderTo);
			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the File is  present in the list");
			Assert.IsTrue(adminFileManagementPage.ElementPresent(By.XPath(FileManagementPage.FileView + "//tr/td/div[@title = '" + prefix + fileToMove + "']")),
						"The File is not copied correctly");

			adminFileManagementPage.SelectFolderFromTreeView("Root", folderFrom);
			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the File is NOT present in the list");
			Assert.IsTrue(adminFileManagementPage.ElementPresent(By.XPath(FileManagementPage.FileView + "//tr/td/div[@title = '" + prefix + fileToMove + "']")),
						"The File is not copied correctly");
		}
		public void Test0204_CopyFile_PreconditionsUploadZipFile(
			[ValuesAttribute("StandardFolder",
							"SecureFolder",
							"DatabaseFolder")] string folderName,
			[ValuesAttribute("StandardFolder",
							"SecureFolder",
							"DatabaseFolder")] string prefix,
			[ValuesAttribute("Birds.zip")] string fileToUpload)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Upload File to Folder:'");

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);

			adminFileManagementPage.SelectFolderFromTreeView("Root", folderName);

			adminFileManagementPage.SetItemsPerPage("All");

			adminFileManagementPage.UploadZipFileToFolder(folderName, prefix + fileToUpload, By.XPath(FileManagementPage.KeepCompressedButton));

		}
		public void Test0305_MoveFile(
			[ValuesAttribute("StandardFolder",
							"SecureFolder",
							"DatabaseFolder")] string folderFrom,
			[ValuesAttribute("SecureFolder",
							"StandardFolder",
							"DatabaseFolder")] string prefix,
			[ValuesAttribute("Birds.jpg",
							"Birds.pdf",
							"Birds.zip")] string fileToMove)
		{
		
			var folderTo = folderFrom + "MoveTo" + prefix;
			var fullFileNameToMove = prefix + fileToMove;

			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Move File to Folder:'" + fullFileNameToMove);

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);
			adminFileManagementPage.SelectFolderFromTreeView("Root", folderFrom);

			adminFileManagementPage.MoveFile(folderFrom, folderTo, fullFileNameToMove);

			adminFileManagementPage.SelectFolderFromTreeView("Root", folderTo);
			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the File is present in the list");
			Assert.IsTrue(adminFileManagementPage.ElementPresent(By.XPath(FileManagementPage.FileView + "//tr/td/div[@title = '" + fullFileNameToMove + "']")),
						"The File is not moved correctly");

			adminFileManagementPage.SelectFolderFromTreeView("Root", folderFrom);
			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the File is NOT present in the list");
			Assert.IsFalse(adminFileManagementPage.ElementPresent(By.XPath(FileManagementPage.FileView + "//tr[contains(@style, 'visibility: visible;')]/td/div[@title = '" + fullFileNameToMove + "']")),
						"The File is not moved correctly");
		}
		public void Test010_DeleteFileUsingToolBar(
			[ValuesAttribute("StandardFolder")] string folderName,

			[ValuesAttribute("Birds_files.bmp",
							"Birds_files.docx",
							"Birds_files.gif",
							"Birds_files.jpg",
							"Birds_files.mp3",
							"Birds_files.pdf",
							"Birds_files.png",
							"Birds_files.pptx",
							"Birds_files.rar",
							"Birds_files.swf",
							"Birds_files.txt",
							"Birds_files.xlsx",
							"Birds_files.xml")] string nameToDelete)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete File:'");

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);

			adminFileManagementPage.SelectFolderFromTreeView("Root", folderName);

			adminFileManagementPage.SetItemsPerPage("All");

			adminFileManagementPage.DeleteUsingToolBar(folderName, nameToDelete);

			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the File is NOT present in the list");
			Assert.IsFalse(adminFileManagementPage.ElementPresent(By.XPath(FileManagementPage.FileView + "//tr/td/div[@title = '" + nameToDelete + "']")),
						"The File is not deleted correctly");
		}
		public void Test009_Search(string folderName, string pattern, int results)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'SEARCH:'");

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);

			adminFileManagementPage.SelectFolderFromTreeView("Root", folderName);
			
			adminFileManagementPage.SearchForFile(pattern);

			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the results");
			Assert.That(adminFileManagementPage.FindElements(By.XPath(FileManagementPage.FileViewItems + "[contains(@style, 'visibility: visible;')]")).Count, Is.EqualTo(results),
				"The number of results is not correct");
		}
		public void Test_UploadNotAllowedToFolder(string folderName, string fileToUpload)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Upload Not Allowed File type to Folder:'");

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);
			adminFileManagementPage.SelectFolderFromTreeView("Root", folderName);

			adminFileManagementPage.SetItemsPerPage("All");

			adminFileManagementPage.UploadNotAllowedFileType(folderName, fileToUpload);

			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the warning message is displayed");
			Assert.That(adminFileManagementPage.WaitForElement(
						By.XPath("//span[@class = 'dnnModuleDigitalAssetsErrorMessage']")).Text,
						Is.EqualTo("File extension not allowed"),
						"The warning message is not displayed");
		}
		public void Test_UploadDecompressedZipFileToFolder(string folderName, string fileToUpload)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Upload decompressed ZIP File to Folder:'");

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);
			adminFileManagementPage.SelectFolderFromTreeView("Root", folderName);

			adminFileManagementPage.SetItemsPerPage("All");

			adminFileManagementPage.UploadZipFileToFolder(folderName, fileToUpload, By.XPath(FileManagementPage.ExpandButton));

			adminFileManagementPage.SelectFolderFromTreeView("Root", folderName);

			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the subfolder is present in the list");
			Assert.That(adminFileManagementPage.WaitForElement(
						By.XPath(FileManagementPage.FileView + "/span[span[text() = '" + fileToUpload.Replace(".zip", "") + "']]/img")).GetAttribute("src"),
						Is.StringContaining("/Folder"),
						"The Subfolder is not created correctly");

			adminFileManagementPage.SelectSubFolderFromTreeView(folderName, fileToUpload.Replace(".zip", ""));

			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the size of uploaded file is correct");
			Assert.That(adminFileManagementPage.WaitForElement(
						By.XPath(FileManagementPage.FileView + "//tr[td/div[@title = '" + "Owl.jpg" + "']]/td[@class = 'dnnModuleDigitalAssetsGrid-SizeColumn']")).Text,
						Is.Not.EqualTo("0.0 KB"),
						"The File is not loaded correctly");

			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the size of uploaded file is correct");
			Assert.That(adminFileManagementPage.WaitForElement(
						By.XPath(FileManagementPage.FileView + "//tr[td/div[@title = '" + "Owls.jpg" + "']]/td[@class = 'dnnModuleDigitalAssetsGrid-SizeColumn']")).Text,
						Is.Not.EqualTo("0.0 KB"),
						"The File is not loaded correctly");

			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the size of uploaded file is correct");
			Assert.That(adminFileManagementPage.WaitForElement(
						By.XPath(FileManagementPage.FileView + "//tr[td/div[@title = '" + "OwlToo.jpg" + "']]/td[@class = 'dnnModuleDigitalAssetsGrid-SizeColumn']")).Text,
						Is.Not.EqualTo("0.0 KB"),
						"The File is not loaded correctly");

			adminFileManagementPage.SelectSubFolderFromTreeView(fileToUpload.Replace(".zip", ""), fileToUpload.Replace("Folder.zip", "") + "SubFolder");

			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the size of uploaded file is correct");
			Assert.That(adminFileManagementPage.WaitForElement(
						By.XPath(FileManagementPage.FileView + "//tr[td/div[@title = '" + "bird01.jpg" + "']]/td[@class = 'dnnModuleDigitalAssetsGrid-SizeColumn']")).Text,
						Is.Not.EqualTo("0.0 KB"),
						"The File is not loaded correctly");

			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the size of uploaded file is correct");
			Assert.That(adminFileManagementPage.WaitForElement(
						By.XPath(FileManagementPage.FileView + "//tr[td/div[@title = '" + "bird02.jpg" + "']]/td[@class = 'dnnModuleDigitalAssetsGrid-SizeColumn']")).Text,
						Is.Not.EqualTo("0.0 KB"),
						"The File is not loaded correctly");

			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the size of uploaded file is correct");
			Assert.That(adminFileManagementPage.WaitForElement(
						By.XPath(FileManagementPage.FileView + "//tr[td/div[@title = '" + "bird03.jpg" + "']]/td[@class = 'dnnModuleDigitalAssetsGrid-SizeColumn']")).Text,
						Is.Not.EqualTo("0.0 KB"),
						"The File is not loaded correctly");

		}
		public void Test_UploadZipFileToSubfolder(string folderName, string subFolderName, string fileToUpload)
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Upload ZIP File to Folder:'");

			var adminFileManagementPage = new AdminFileManagementPage(_driver);
			adminFileManagementPage.OpenUsingButtons(_baseUrl);

			adminFileManagementPage.SelectSubFolderFromTreeView(folderName, subFolderName);

			adminFileManagementPage.SetItemsPerPage("All");

			adminFileManagementPage.UploadZipFileToFolder(folderName, fileToUpload, By.XPath(FileManagementPage.KeepCompressedButton));

			adminFileManagementPage.OpenUsingButtons(_baseUrl);

			adminFileManagementPage.SelectSubFolderFromTreeView(folderName, subFolderName);

			Trace.WriteLine(BasePage.TraceLevelPage + "Verify the size of uploaded file is correct");
			Assert.That(adminFileManagementPage.WaitForElement(
						By.XPath(FileManagementPage.FileView + "//tr[td/div[@title = '" + fileToUpload + "']]/td[@class = 'dnnModuleDigitalAssetsGrid-SizeColumn']")).Text,
						Is.Not.EqualTo("0.0 KB"),
						"The File is not loaded correctly");
		}