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