Skip to content

Commit 7d083d1

Browse files
committed
Enabling LogsToFile test in C#
1 parent 3d251fc commit 7d083d1

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

examples/dotnet/SeleniumDocs/Browsers/InternetExplorerTest.cs

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace SeleniumDocs.Browsers
1111
[EnabledOnOs("WINDOWS")]
1212
public class InternetExplorerTest
1313
{
14-
private InternetExplorerDriver driver;
14+
private InternetExplorerDriver _driver;
1515
private string _logLocation;
1616
private string _tempPath;
1717

@@ -26,7 +26,7 @@ public void Cleanup()
2626
{
2727
File.Delete(_tempPath);
2828
}
29-
driver.Quit();
29+
_driver.Quit();
3030
}
3131

3232
[TestMethod]
@@ -35,27 +35,26 @@ public void BasicOptionsWin10()
3535
var options = new InternetExplorerOptions();
3636
options.AttachToEdgeChrome = true;
3737
options.EdgeExecutablePath = GetEdgeLocation();
38-
driver = new InternetExplorerDriver(options);
38+
_driver = new InternetExplorerDriver(options);
3939
}
4040

4141
[TestMethod]
4242
public void BasicOptionsWin11()
4343
{
4444
var options = new InternetExplorerOptions();
45-
driver = new InternetExplorerDriver(options);
45+
_driver = new InternetExplorerDriver(options);
4646
}
4747

4848
[TestMethod]
49-
[Ignore("Not implemented")]
5049
public void LogsToFile()
5150
{
5251
var service = InternetExplorerDriverService.CreateDefaultService();
5352
service.LogFile = GetLogLocation();
5453

55-
driver = new InternetExplorerDriver(service);
56-
driver.Quit(); // Close the Service log file before reading
54+
_driver = new InternetExplorerDriver(service);
55+
_driver.Quit(); // Close the Service log file before reading
5756
var lines = File.ReadLines(GetLogLocation());
58-
Assert.IsNotNull(lines.FirstOrDefault(line => line.Contains("geckodriver INFO Listening on")));
57+
Assert.IsNotNull(lines.FirstOrDefault(line => line.Contains("Started InternetExplorerDriver server")));
5958
}
6059

6160
[TestMethod]
@@ -70,7 +69,7 @@ public void LogsToConsole()
7069

7170
//service.LogToConsole = true;
7271

73-
driver = new InternetExplorerDriver(service);
72+
_driver = new InternetExplorerDriver(service);
7473
Assert.IsTrue(stringWriter.ToString().Contains("geckodriver INFO Listening on"));
7574
Console.SetOut(originalOutput);
7675
stringWriter.Dispose();
@@ -84,8 +83,8 @@ public void LogsLevel()
8483

8584
service.LoggingLevel = InternetExplorerDriverLogLevel.Warn;
8685

87-
driver = new InternetExplorerDriver(service);
88-
driver.Quit(); // Close the Service log file before reading
86+
_driver = new InternetExplorerDriver(service);
87+
_driver.Quit(); // Close the Service log file before reading
8988
var lines = File.ReadLines(GetLogLocation());
9089
Assert.IsNotNull(lines.FirstOrDefault(line => line.Contains("Invalid capability setting: timeouts is type null")));
9190
}
@@ -97,7 +96,7 @@ public void SupportingFilesLocation()
9796

9897
service.LibraryExtractionPath = GetTempDirectory();
9998

100-
driver = new InternetExplorerDriver(service);
99+
_driver = new InternetExplorerDriver(service);
101100
Assert.IsTrue(File.Exists(GetTempDirectory() + "/IEDriver.tmp"));
102101
}
103102

0 commit comments

Comments
 (0)