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_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_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"); }