public void YandexLogout(BrowserType browser) { mainPage.MailLoginClick(); windowActions.SwitchBetweenWindows(WebDriver, 1); loginPage.EnterLogin(TestData.validLogin); loginPage.ClickSignIn(); loginPage.EnterPassword(TestData.validPassword); loginPage.ClickSignIn(); mailIncomingMessagesPage.ClickOnUserName(); var loginUrl = windowActions.GetCurrentUrl(WebDriver); mailIncomingMessagesPage.Logout(); var logoutUrl = windowActions.GetCurrentUrl(WebDriver); Assert.Multiple(() => { Assert.AreNotEqual(loginUrl, logoutUrl, "Url after logout didn't change"); Assert.IsTrue(loginPage.GetLoginButton().Displayed); }); }