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); } }
public LobbyPageViewModel(LobbyPage page) { _page = page; _page.DisplayPlayers(); DisplayGameCreationDialogCommand = new RelayCommand <object>((o) => DisplayGameCreationDialog(), (o) => true); JoinLobbyCommand = new RelayCommand <object>(async(o) => await JoinLobby(), (o) => true); Messenger.Default.Register(this, delegate(string msg) { if (!msg.StartsWith(nameof(GameGridElementViewModel.IsSelectedGame))) { return; } foreach (GameGridElement g in Lobbies.Where(g => msg.EndsWith(((GameGridElementViewModel)g.DataContext).WaitingRoom.Channel.id))) { foreach (GameGridElement gg in Lobbies) { ((GameGridElementViewModel)gg.DataContext).UnSelectGame(); } IsGameSelected = true; _currentSelectedWaitingRoom = ((GameGridElementViewModel)g.DataContext).WaitingRoom; } }); }
/// <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); } }
protected override void OnElementChanged(ElementChangedEventArgs <Page> e) { base.OnElementChanged(e); page = e.NewElement as LobbyPage; var activity = this.Context as Activity; }
public LobbyViewModel(bool skipUi = false) { memberIdList = new ObservableCollection <ChatSessionID>(); lobbyModel = new Model.LobbyModel(this); lobbyView = skipUi ? null : new LobbyPage(this); }
private void _logoutBothPlayers(RemoteWebDriver hostDriver, RemoteWebDriver guestDriver, LobbyPage hostLobbyPage, LobbyPage guestLobbyPage) { hostLobbyPage.Navigate(); LogOut(hostDriver); guestLobbyPage.Navigate(); LogOut(guestDriver); }
protected override void OnElementChanged(VisualElementChangedEventArgs e) { base.OnElementChanged(e); page = e.NewElement as LobbyPage; }
public override void OnInstance() { base.OnInstance(); panel = lobbyPage = LobbyPage.Instance; }