public async Task SessionCreationTest() { Chrome c = new Chrome(remoteDebuggingPort: 9992, headless: false); var currentSessions = await c.GetActiveSessions(); var s = await c.CreateNewSession(); var newSessions = await c.GetActiveSessions(); Assert.IsTrue(currentSessions.Count() + 1 == newSessions.Count(), "The number of sessions before creation + 1 was not equal to the sessions found later"); c.Dispose(); }
public async Task SessionDisposeTest() { using (Chrome c = new Chrome(remoteDebuggingPort: 9994, headless: false)) { var currentSessions = await c.GetActiveSessions(); var s = await c.CreateNewSession(); s.Dispose(); var currentSessions2 = await c.GetActiveSessions(); Assert.AreEqual(currentSessions.Count(), currentSessions2.Count(), 0, "The session created was not destroyed when disposed"); } }