public void HtmlFileInput_SetFile_Succeeds() { //Arrange using (var webPage = new TempWebPage( @"<html> <head> <title>test</title> </head> <body> <input name=""inputName"" type=""file"" id=""inputId"" /> </body> </html>")) { var browserWindow = BrowserWindow.Launch(webPage.FilePath); HtmlFileInput fileInput = browserWindow.Find <HtmlFileInput>(By.Id("inputId")); string tempInputFilePath = Path.GetTempFileName(); //Act fileInput.FileName = tempInputFilePath; browserWindow.Close(); File.Delete(tempInputFilePath); } }
public void HtmlFileInputTest_SelectedItem() { HtmlFileInput fileInput = new HtmlFileInput(BasicTestPage); fileInput.FileName = HtmlFileInputTest.PathToPage; fileInput.FileName.Should().EndWith(HtmlFileInputTest.PageName); AssertResult("uploadHere", "change"); }