public void Logout() { WaitUntilElementDisplayed(driver, By.XPath("//*[contains(@aria-label, 'Selenium')]")); LoggedUser.Click(); SignOutButton.Click(); Assert.IsTrue(PasswordInput.Displayed); }
public void Awake() { if (Instance == null) { Instance = this; flexButtonComponent.selectedColor = Color.white; } }
private void ForgotPasswordLinkLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { NewPasswordTextBoxForgotPassword.PasswordChar = '•'; ConfirmNewPasswordTextBoxForgotPassword.PasswordChar = '•'; NewPasswordTextBoxForgotPassword.MaxLength = 12; ConfirmNewPasswordTextBoxForgotPassword.MaxLength = 12; SignOutButton.Hide(); TabControl.TabPages.Add(ForgotPasswordTabPage); TabControl.SelectedTab = ForgotPasswordTabPage; }
public void InitializeWelcomePage() { currentUser = null; ResetSignIn(); ResetSignUp(); TabControl.TabPages.Clear(); PasswordTextBoxSignIn.PasswordChar = '•'; PasswordTextBoxSignUp.PasswordChar = '•'; PasswordTextBoxSignIn.MaxLength = 12; PasswordTextBoxSignUp.MaxLength = 12; TabControl.TabPages.Add(WelcomeTabPage); TabControl.SelectedTab = WelcomeTabPage; SignOutButton.Hide(); }
public override void OnActivityCreated(Bundle savedInstanceState) { base.OnActivityCreated(savedInstanceState); bindings.Add(this.SetBinding(() => Vm.State, () => SignInButton.Visibility).ConvertSourceToTarget(s => s == "NotAuthenticated" ? ViewStates.Visible : ViewStates.Gone)); bindings.Add(this.SetBinding(() => Vm.State, () => AuthLayout.Visibility).ConvertSourceToTarget(s => s == "Authenticated" ? ViewStates.Visible : ViewStates.Gone)); bindings.Add(this.SetBinding(() => Vm.Bio, () => BioView.Text, BindingMode.TwoWay)); bindings.Add(this.SetBinding(() => Vm.PublicImages, () => ImagePublicSwitch.Checked, BindingMode.TwoWay)); bindings.Add(this.SetBinding(() => Vm.MessagingEnabled, () => EnableMessagingSwitch.Checked, BindingMode.TwoWay)); ArrayAdapter adapter = ArrayAdapter.CreateFromResource(Activity, Resource.Array.AlbumPrivacyItems, global::Android.Resource.Layout.SimpleSpinnerItem); adapter.SetDropDownViewResource(global::Android.Resource.Layout.SimpleSpinnerDropDownItem); AlbumPrivacySpinner.Adapter = adapter; bindings.Add(this.SetBinding(() => Vm.AlbumPrivacyIndex).WhenSourceChanges(() => AlbumPrivacySpinner.SetSelection(Vm.AlbumPrivacyIndex))); AlbumPrivacySpinner.ItemSelected += AlbumPrivacySpinner_ItemSelected; bindings.Add(this.SetBinding(() => Vm.ShowMature, () => MatureContentSwitch.Checked, BindingMode.TwoWay)); SignInButton.SetCommand("Click", Vm.SignInCommand); SaveSettingsButton.SetCommand("Click", Vm.SaveCommand); SignOutButton.SetCommand("Click", Vm.SignOutCommand); }
private void SignOutButton_Click(object sender, EventArgs e) { string msgToSend = MyProtocol.SignOut(); TriviaServerConnection.SendToServer(msgToSend); this.UserName.Show(); this.User_Name.Show(); this.Password.Show(); this.Password_Text.Show(); this.Show_Password.Show(); this.SignInButton.Show(); this.Forgot_Password.Show(); this.HelloUserLabel.Hide(); this.SignUpButton.Show(); SignOutButton.Hide(); this.BestScoresButton.Enabled = false; this.MyStatusButton.Enabled = false; this.CreateRoomButton.Enabled = false; this.JoinRoomButton.Enabled = false; }
public void VerifyInboxFolder(string username, string password, string username1, string password1) { Login(username, password); WaitUntilElementDisplayed(driver, By.CssSelector("div[gh='cm']")); NewEmailButton.Click(); WaitUntilElementDisplayed(driver, By.XPath("//textarea[@aria-label='To']")); NewEmailToInput.SendKeys("*****@*****.**"); NewEmailSubjectInput.SendKeys(subjectToSend); WaitUntilElementDisplayed(driver, By.XPath("//*[@data-tooltip='Sent']")); SendEmailButton.Click(); Thread.Sleep(1000); WaitUntilElementDisplayed(driver, By.XPath("//*[contains(@aria-label, 'Selenium')]")); LoggedUser.Click(); WaitUntilElementDisplayed(driver, By.XPath("//*[@id = 'gb_71']")); SignOutButton.Click(); driver.Quit(); //var Driver = new ChromeDriver(@"D:\Automation"); PageObject gmail = new PageObject(driver); NavigateTo(); //Login(username1, password1); //List<IWebElement> emails = driver.FindElements(By.CssSelector("div[class = 'ae4 aDM']> div>div>table>tbody>tr")).ToList(); //foreach (IWebElement email in emails) //{ // if (email.Text.Contains(sss) == true) // { // email.Click(); // break; // } // else // { // driver.Close(); // } //} }
/* -END OF INITIALIZERS- */ /* ------------------------------------------------------------------------------------------ */ /* -BEGIN OF TAB CONTROL- */ void TabControl_Selecting(object sender, TabControlCancelEventArgs e) { TabPage current = (sender as TabControl).SelectedTab; //if (current != ReadMailTabPage && selectedMailList != null) //{ // selectedMailList.Clear(); //} if (current == WelcomeTabPage) { SignOutButton.Hide(); InitializeWelcomePage(); } else if (current == ForgotPasswordTabPage) { SignOutButton.Hide(); } else { SignOutButton.Show(); TabControl.TabPages.Remove(WelcomeTabPage); if (current == InboxTabPage) { Refresh(InboxTabPage); } else if (current == OutboxTabPage) { Refresh(OutboxTabPage); } else if (current == NewMailTabPage) { ResetNewMail(); } } }
void ReleaseDesignerOutlets() { if (FullNameActionButton != null) { FullNameActionButton.Dispose(); FullNameActionButton = null; } if (FullNameCancelButton != null) { FullNameCancelButton.Dispose(); FullNameCancelButton = null; } if (FullNameTextBox != null) { FullNameTextBox.Dispose(); FullNameTextBox = null; } if (InformationLabel != null) { InformationLabel.Dispose(); InformationLabel = null; } if (MacAddressActionButton != null) { MacAddressActionButton.Dispose(); MacAddressActionButton = null; } if (MacAddressCancelButton != null) { MacAddressCancelButton.Dispose(); MacAddressCancelButton = null; } if (MacAddressTextBox != null) { MacAddressTextBox.Dispose(); MacAddressTextBox = null; } if (PasswordActionButton != null) { PasswordActionButton.Dispose(); PasswordActionButton = null; } if (PasswordCancelButton != null) { PasswordCancelButton.Dispose(); PasswordCancelButton = null; } if (PasswordTextBox != null) { PasswordTextBox.Dispose(); PasswordTextBox = null; } if (PiConnectionStringTextBox != null) { PiConnectionStringTextBox.Dispose(); PiConnectionStringTextBox = null; } if (SignOutButton != null) { SignOutButton.Dispose(); SignOutButton = null; } if (UsernameTextBox != null) { UsernameTextBox.Dispose(); UsernameTextBox = null; } }
public override void ViewDidLoad() { base.ViewDidLoad(); Title = Resources.LoginTitle; ResetSuccessLabel.Text = Resources.APITokenResetSuccess; InstructionLabel.Text = Resources.TokenResetInstruction; PasswordTextField.Placeholder = Resources.Password; SignOutButton.SetTitle(Resources.OrSignOut, UIControlState.Normal); prepareViews(); ViewModel.Error .Subscribe(ErrorLabel.Rx().Text()) .DisposedBy(DisposeBag); ViewModel.Email .SelectToString() .Subscribe(EmailLabel.Rx().Text()) .DisposedBy(DisposeBag); ViewModel.Password .Subscribe(PasswordTextField.Rx().TextObserver()) .DisposedBy(DisposeBag); PasswordTextField.Rx().Text() .Subscribe(ViewModel.Password) .DisposedBy(DisposeBag); ViewModel.IsPasswordMasked .Subscribe(PasswordTextField.Rx().SecureTextEntry()) .DisposedBy(DisposeBag); SignOutButton.Rx() .BindAction(ViewModel.SignOut) .DisposedBy(DisposeBag); ShowPasswordButton.Rx() .BindAction(ViewModel.TogglePasswordVisibility) .DisposedBy(DisposeBag); nextButton.Rx().Tap() .Subscribe(ViewModel.Done.Inputs) .DisposedBy(DisposeBag); PasswordTextField.Rx().ShouldReturn() .Subscribe(ViewModel.Done.Inputs) .DisposedBy(DisposeBag); //Enabled ViewModel.NextIsEnabled .Subscribe(nextButton.Rx().Enabled()) .DisposedBy(DisposeBag); //Visibility ViewModel.HasError .Subscribe(ErrorView.Rx().IsVisible()) .DisposedBy(DisposeBag); ViewModel.Done.Executing .Invert() .Subscribe(ShowPasswordButton.Rx().IsVisible()) .DisposedBy(DisposeBag); ViewModel.Done.Executing .Subscribe(ActivityIndicatorView.Rx().IsVisible()) .DisposedBy(DisposeBag); PasswordTextField.BecomeFirstResponder(); }
public void SignOut() { GmailAccountOptions.Click(); SignOutButton.Click(); }
public override void ViewDidLoad() { base.ViewDidLoad(); Title = Resources.LoginTitle; ResetSuccessLabel.Text = Resources.APITokenResetSuccess; InstructionLabel.Text = Resources.TokenResetInstruction; PasswordTextField.Placeholder = Resources.Password; SignOutButton.SetTitle(Resources.OrSignOut, UIControlState.Normal); EmailLabel.Text = ViewModel.Email.ToString(); ViewModel.Error .Subscribe(ErrorLabel.Rx().Text()) .DisposedBy(DisposeBag); ViewModel.Password .Subscribe(PasswordTextField.Rx().TextObserver()) .DisposedBy(DisposeBag); PasswordTextField.Rx().Text() .Subscribe(ViewModel.Password) .DisposedBy(DisposeBag); SignOutButton.Rx() .BindAction(ViewModel.SignOut) .DisposedBy(DisposeBag); ViewModel.SignOut.Elements .Subscribe(IosDependencyContainer.Instance.IntentDonationService.ClearAll) .DisposedBy(DisposeBag); ShowPasswordButton.Rx().Tap() .Subscribe(_ => { PasswordTextField.ResignFirstResponder(); PasswordTextField.SecureTextEntry = !PasswordTextField.SecureTextEntry; PasswordTextField.BecomeFirstResponder(); }) .DisposedBy(DisposeBag); LoginButton.Rx().Tap() .Subscribe(ViewModel.Done.Inputs) .DisposedBy(DisposeBag); PasswordTextField.Rx().ShouldReturn() .Subscribe(ViewModel.Done.Inputs) .DisposedBy(DisposeBag); //Enabled ViewModel.NextIsEnabled .Subscribe(LoginButton.Rx().Enabled()) .DisposedBy(DisposeBag); //Visibility ErrorLabel.Hidden = true; ViewModel.HasError .Subscribe(ErrorLabel.Rx().AnimatedIsVisible()) .DisposedBy(DisposeBag); ViewModel.Done.Executing .Invert() .Subscribe(ShowPasswordButton.Rx().IsVisible()) .DisposedBy(DisposeBag); ViewModel.Done.Executing .Subscribe(ActivityIndicatorView.Rx().IsVisibleWithFade()) .DisposedBy(DisposeBag); ViewModel.Done.Executing.Select(loginButtonTitle) .Subscribe(LoginButton.Rx().AnimatedTitle()) .DisposedBy(DisposeBag); PasswordTextField.BecomeFirstResponder(); ShowPasswordButton.SetupShowPasswordButton(); //Color ViewModel.HasError .Select(loginButtonTintColor) .Subscribe(LoginButton.Rx().TintColor()) .DisposedBy(DisposeBag); ViewModel.NextIsEnabled .Select(loginButtonTitleColor) .Subscribe(LoginButton.Rx().TitleColor()) .DisposedBy(DisposeBag); UIColor loginButtonTintColor(bool hasError) => hasError ? UIColor.White : UIColor.Black; UIColor loginButtonTitleColor(bool enabled) => enabled ? Core.UI.Helper.Colors.Login.EnabledButtonColor.ToNativeColor() : Core.UI.Helper.Colors.Login.DisabledButtonColor.ToNativeColor(); }
void ReleaseDesignerOutlets() { if (ActivityIndicatorView != null) { ActivityIndicatorView.Dispose(); ActivityIndicatorView = null; } if (BottomConstraint != null) { BottomConstraint.Dispose(); BottomConstraint = null; } if (EmailLabel != null) { EmailLabel.Dispose(); EmailLabel = null; } if (ErrorLabel != null) { ErrorLabel.Dispose(); ErrorLabel = null; } if (PasswordTextField != null) { PasswordTextField.Dispose(); PasswordTextField = null; } if (ShowPasswordButton != null) { ShowPasswordButton.Dispose(); ShowPasswordButton = null; } if (SignOutButton != null) { SignOutButton.Dispose(); SignOutButton = null; } if (InstructionLabel != null) { InstructionLabel.Dispose(); InstructionLabel = null; } if (ResetSuccessLabel != null) { ResetSuccessLabel.Dispose(); ResetSuccessLabel = null; } if (LoginButton != null) { LoginButton.Dispose(); LoginButton = null; } }
public dynamic handleRecievedMessage(string MsgFromServer) { int msgCode = Int32.Parse(MsgFromServer.Substring(0, 3)); if (msgCode == 0) { // nothing it just connected } else if (msgCode == ServerCodes.SIGN_IN) { int status = Int32.Parse(MsgFromServer[3].ToString()); switch (status) { case 0: // success popUpText.Text = ""; this.UserName.Hide(); this.User_Name.Hide(); this.Password.Hide(); this.Password_Text.Hide(); this.SignInButton.Hide(); this.Show_Password.Hide(); this.Forgot_Password.Hide(); this.HelloUserLabel.Text = "Hello " + User_Name.Text; this.HelloUserLabel.Show(); this.SignUpButton.Hide(); this.CreateRoomButton.Enabled = true; this.JoinRoomButton.Enabled = true; this.MyStatusButton.Enabled = true; this.BestScoresButton.Enabled = true; this.SignOutButton.Enabled = true; SignOutButton.Show(); break; case 1: // TO DO : MNADE LL DSPLE popUpText.Text = "Wrong Details.."; break; case 2: // is aleardy connected popUpText.Text = "this user is already signed in!!"; break; } return(null); } else if (msgCode == ServerCodes.SIGN_UP) { int status = Int32.Parse(MsgFromServer[3].ToString()); switch (status) { case 0: return("YOU ARE NOW REGESTURED"); break; case 1: return("Illegal Pass"); break; case 2: return("Username Already Exists!!"); break; case 3: return("Username is Illegal!!"); break; case 4: return("No Clue what the problem is!!"); break; } return(null); } else if (msgCode == ServerCodes.GET_FORGOT_PASSWORD) { int isFound = Int32.Parse(MsgFromServer[3].ToString()); if (isFound == 1) { int passwordLength = Int32.Parse(MsgFromServer.Substring(4, 4)); string password = MsgFromServer.Substring(8, passwordLength); return("User is Found.!, Password : "******"User not found in the DATABASE.!"); } return(null); } else if (msgCode == ServerCodes.SEND_ROOMS_LIST) { int numOfRooms = Int32.Parse(MsgFromServer.Substring(3, 4)); // rooms <id, name> Dictionary <string, string> Rooms = new Dictionary <string, string>(); int firstRoomIDIndex = 7; int firstRoomNameSizeIndex = 11; string roomID; int roomNameSize = 0; string roomName; int roomNameSizeSum = 0; for (int i = 0; i < numOfRooms; i++) { roomNameSize = Int32.Parse(MsgFromServer.Substring(firstRoomNameSizeIndex + roomNameSizeSum + i * 4 + i * 2, 2)); roomName = MsgFromServer.Substring(firstRoomNameSizeIndex + 2 + roomNameSizeSum + i * 4 + i * 2, roomNameSize); roomID = MsgFromServer.Substring(firstRoomIDIndex + i * 4 + i * 2 + roomNameSizeSum, 4); roomNameSizeSum += roomNameSize; Rooms.Add(roomID, roomName); } return(Rooms); // Send Dict in Function } else if (msgCode == ServerCodes.SEND_USERS_LIST) { int numOfUsers = Int32.Parse(MsgFromServer.Substring(3, 3)); if (numOfUsers == 0) { } else { List <string> Users = new List <string>(); int firstUserNameSizeIndex = 6; string userName; int NameSize; int NameSizeSum = 0; for (int i = 0; i < numOfUsers; i++) { NameSize = Int32.Parse(MsgFromServer.Substring(firstUserNameSizeIndex + NameSizeSum + i * 2, 2)); userName = MsgFromServer.Substring(firstUserNameSizeIndex + 2 + NameSizeSum + 2 * i, NameSize); NameSizeSum += NameSize; Users.Add(userName); } return(Users);// Send usernames list to the function } } else if (msgCode == ServerCodes.RESPOND_TO_JOIN_ROOM) { int status = Int32.Parse(MsgFromServer[4].ToString()); switch (status) { case 0: // success List <int> list = new List <int>(); int numOfQuestions = Int32.Parse(MsgFromServer.Substring(4, 2)); int QuestionTimeInSec = Int32.Parse(MsgFromServer.Substring(6, 2)); list.Add(numOfQuestions); list.Add(QuestionTimeInSec); return(list); break; case 1: // room is full break; case 2: // room doesn't exsist or somthing like that break; } return(null); } else if (msgCode == ServerCodes.RESPOND_TO_LEAVE_ROOM) { return(MsgFromServer[4] == '0' ? true : false); } else if (msgCode == ServerCodes.RESPOND_TO_CREATE_ROOM) { int status = Int32.Parse(MsgFromServer[3].ToString()); switch (status) { case 0: // success return(true); break; case 1: // fail return(false); break; } return(null); } else if (msgCode == ServerCodes.RESPOND_TO_CLOSE_ROOM) { return(null); } else if (msgCode == ServerCodes.RESPOND_TO_QUESTION_WITH_ANSWERS) // start game { List <string> questionWithAnswersList = new List <string>(); int sizeSum = 0; int QuestionSize = Int32.Parse(MsgFromServer.Substring(3, 3)); string Question = MsgFromServer.Substring(6, QuestionSize); sizeSum += QuestionSize; int ans1Size = Int32.Parse(MsgFromServer.Substring(6 + sizeSum, 3)); string ans1 = MsgFromServer.Substring(6 + 3 + sizeSum, ans1Size); sizeSum += ans1Size; // "118020Who is Eddie Vedder?011Phone model007TV Show008Computer008Musician int ans2Size = Int32.Parse(MsgFromServer.Substring(6 + 3 + sizeSum, 3)); //problem string ans2 = MsgFromServer.Substring(6 + 3 * 2 + sizeSum, ans2Size); sizeSum += ans2Size; int ans3Size = Int32.Parse(MsgFromServer.Substring(6 + 3 * 2 + sizeSum, 3)); string ans3 = MsgFromServer.Substring(6 + 3 * 3 + sizeSum, ans3Size); sizeSum += ans3Size; int ans4Size = Int32.Parse(MsgFromServer.Substring(6 + 3 * 3 + sizeSum, 3)); string ans4 = MsgFromServer.Substring(6 + 3 * 4 + sizeSum, ans4Size); sizeSum += ans4Size; questionWithAnswersList.Add(Question); questionWithAnswersList.Add(ans1); questionWithAnswersList.Add(ans2); questionWithAnswersList.Add(ans3); questionWithAnswersList.Add(ans4); return(questionWithAnswersList); } else if (msgCode == ServerCodes.RESPOND_TO_USERS_ANS) { int status = Int32.Parse(MsgFromServer[3].ToString()); switch (status) { case 0: // wrong answer return(false); break; case 1: // correct answer return(true); break; } return(null); } else if (msgCode == ServerCodes.GAME_IS_FINISHED) { int numOfUsers = Int32.Parse(MsgFromServer.Substring(3, 1)); if (numOfUsers == 0) { } else { Dictionary <string, int> Users = new Dictionary <string, int>(); int firstUserNameSizeIndex = 4; string userName; int NameSize; int sizeSum = 0; int UserScore; for (int i = 0; i < numOfUsers; i++) { NameSize = Int32.Parse(MsgFromServer.Substring(firstUserNameSizeIndex + sizeSum + i * 4, 2)); userName = MsgFromServer.Substring(firstUserNameSizeIndex + 2 + sizeSum + i * 4, NameSize); sizeSum += NameSize; UserScore = Int32.Parse(MsgFromServer.Substring(firstUserNameSizeIndex + 2 + sizeSum + i * 4, 2)); Users[userName] = UserScore; } return(Users);// Send usernames list to the function } } else if (msgCode == ServerCodes.GET_BEST_SCORES_FROM_SERVER) { Dictionary <string, int> Users = new Dictionary <string, int>(); int firstUserNameSizeIndex = 3; string userName; int NameSize; int sizeSum = 0; int UserScore; for (int i = 0; i < 3; i++) { NameSize = Int32.Parse(MsgFromServer.Substring(firstUserNameSizeIndex + sizeSum + 8 * i, 2)); userName = MsgFromServer.Substring(firstUserNameSizeIndex + 2 + sizeSum + i * 8, NameSize); sizeSum += NameSize; UserScore = Int32.Parse(MsgFromServer.Substring(firstUserNameSizeIndex + 2 + sizeSum + i * 8, 6)); Users[userName] = UserScore; } return(Users); } else if (msgCode == ServerCodes.GET_PERSONAL_STATUS_FROM_SERVER) { int numberOfGames = Int32.Parse(MsgFromServer.Substring(3, 4)); int numberOfRightAnswers; int numberOfWrongAnswers; float avgTimeForAnswer; List <string> ans = new List <string>(); if (numberOfGames == 0) { //nvrmnd numberOfRightAnswers = Int32.Parse(MsgFromServer.Substring(7, 6)); numberOfWrongAnswers = Int32.Parse(MsgFromServer.Substring(13, 6)); int tens = Int32.Parse(MsgFromServer.Substring(19, 1)); int ones = Int32.Parse(MsgFromServer.Substring(20, 1)); int tenth = Int32.Parse(MsgFromServer.Substring(21, 1)); int percent = Int32.Parse(MsgFromServer.Substring(22, 1)); avgTimeForAnswer = tens * 10 + ones * 1 + (float)(tenth * 0.1) + (float)(percent * 0.01); ans.Add(numberOfGames.ToString()); ans.Add(numberOfRightAnswers.ToString()); ans.Add(numberOfWrongAnswers.ToString()); ans.Add(avgTimeForAnswer.ToString()); } else { numberOfRightAnswers = Int32.Parse(MsgFromServer.Substring(7, 6)); numberOfWrongAnswers = Int32.Parse(MsgFromServer.Substring(13, 6)); int tens = Int32.Parse(MsgFromServer.Substring(19, 1)); int ones = Int32.Parse(MsgFromServer.Substring(20, 1)); int tenth = Int32.Parse(MsgFromServer.Substring(21, 1)); int percent = Int32.Parse(MsgFromServer.Substring(22, 1)); avgTimeForAnswer = tens * 10 + ones * 1 + (float)(tenth * 0.1) + (float)(percent * 0.01); ans.Add(numberOfGames.ToString()); ans.Add(numberOfRightAnswers.ToString()); ans.Add(numberOfWrongAnswers.ToString()); ans.Add(avgTimeForAnswer.ToString()); } return(ans); } return(null); }