private void _logoutBothPlayers(RemoteWebDriver hostDriver, RemoteWebDriver guestDriver, LobbyPage hostLobbyPage, LobbyPage guestLobbyPage) { hostLobbyPage.Navigate(); LogOut(hostDriver); guestLobbyPage.Navigate(); LogOut(guestDriver); }
public void UserHaveNickAndPasswordThenClickHostButtonThenClickAbortRoomButton_UserCanSeeRoomIdAndNickAndPasswordThenRoomIsAborted() { using (var driver = _getNewInstanceOfRequiredDriver()) { LogIn(driver); var lobbyPage = new LobbyPage(driver); lobbyPage.Navigate(); lobbyPage.PlayerNickInput.SendKeys("nick"); lobbyPage.PasswordInput.SendKeys("password"); lobbyPage.HostButton.Click(); _waitForElement(driver, By.ClassName(LobbyPage.modalContentClassName)); Assert.Greater(lobbyPage.ModalHostedRoomId.Text.Length, 0); Assert.AreEqual("nick", lobbyPage.ModalHostNick.Text); Assert.AreEqual("password", lobbyPage.ModalHostedRoomPassword.Text); lobbyPage.ModalAbortButton.Click(); _waitForElement(driver, By.ClassName("logout")); LogOut(driver); } }
/// <summary> /// Should redirect multiplayerGame. /// We dont want navigate using MultiplayerGamePagen /// because game itself cannot create valid match /// </summary> private void _startGameUsingLobby( RemoteWebDriver hostDriver, RemoteWebDriver guestDriver, out LobbyPage hostLobbyPage, out LobbyPage guestLobbyPage, out MultiplayerGamePage hostGamePage, out MultiplayerGamePage guestGamePage) { LogIn(hostDriver); LogIn(guestDriver); hostLobbyPage = new LobbyPage(hostDriver); guestLobbyPage = new LobbyPage(guestDriver); hostLobbyPage.Navigate(); guestLobbyPage.Navigate(); hostLobbyPage.HostButton.Click(); _waitForElement(hostDriver, By.ClassName(LobbyPage.modalContentClassName)); guestLobbyPage.RefreshButton.Click(); _waitForElement(guestDriver, By.CssSelector(LobbyPage.firstRoomInLobbySelector)); guestLobbyPage.FirstRoom.Click(); hostGamePage = new MultiplayerGamePage(hostDriver); guestGamePage = new MultiplayerGamePage(guestDriver); _waitUntilUserIsRedirected("multiplayerGame", hostDriver); _waitUntilUserIsRedirected("multiplayerGame", guestDriver); }
private void _logoutBothPlayers(LobbyPage hostLobbyPage, LobbyPage guestLobbyPage) { hostLobbyPage.Navigate(); LogOut(hostLobbyPage.Driver); guestLobbyPage.Navigate(); LogOut(guestLobbyPage.Driver); }
private void _loginBothPlayersAndNavigateThemToLobby(RemoteWebDriver hostDriver, RemoteWebDriver guestDriver, out LobbyPage hostLobbyPage, out LobbyPage guestLobbyPage) { LogIn(hostDriver); LogIn(guestDriver); hostLobbyPage = new LobbyPage(hostDriver); hostLobbyPage.Navigate(); guestLobbyPage = new LobbyPage(guestDriver); guestLobbyPage.Navigate(); }
private void _startGameUsingLobby(RemoteWebDriver hostDriver, RemoteWebDriver guestDriver, out LobbyPage hostLobbyPage, out LobbyPage guestLobbyPage) { hostLobbyPage = new LobbyPage(hostDriver); guestLobbyPage = new LobbyPage(guestDriver); hostLobbyPage.Navigate(); guestLobbyPage.Navigate(); hostLobbyPage.HostButton.Click(); _waitForElement(hostDriver, By.ClassName(LobbyPage.modalContentClassName)); guestLobbyPage.RefreshButton.Click(); _waitForElement(guestDriver, By.CssSelector(LobbyPage.firstRoomInLobbySelector)); guestLobbyPage.FirstRoom.Click(); }
public void UserClickMenuButton_UserIsRedirectedToMenu() { using (var driver = _getNewInstanceOfRequiredDriver()) { LogIn(driver); var lobbyPage = new LobbyPage(driver); lobbyPage.Navigate(); lobbyPage.MenuButton.Click(); _verifyUserIsRedirected("", driver); LogOut(driver); } }