Beispiel #1
0
        string RegisterUser(int random, Model model, string followUserName = null)
        {
            app.Tap(model.RegisterButton);

            app.WaitForElement(model.RegisterName);

            var email = "Artist" + random + "@email.com";

            app.Tap(model.RegisterEmail);
            app.EnterText(email);

            app.Tap(model.RegisterName);
            app.EnterText(getArtistName(random));

            app.Tap(model.RegisterPassword);
            app.EnterText("123456");

            app.Tap(model.RegisterPasswordConfirmation);
            app.EnterText("123456");

            app.PressEnter();

            app.Tap(model.RegisterRegisterButton);

            app.WaitForElement(model.PhoneVerificationNumberOne);

            app.Tap(model.PhoneVerificationNumberOne);
            app.EnterText("011");

            var fourDigit = String.Format("{0:0000}", random % 10000);

            app.Tap(model.PhoneVerificationNumberTwo);
            app.EnterText("1111");

            app.Tap(model.PhoneVerificationNumberThree);
            app.EnterText(fourDigit);

            app.PressEnter();

            app.Tap(model.PhoneVerificationButton);

            app.WaitForElement(model.PhoneNumberConfirmationSend);

            app.Tap(model.PhoneNumberConfirmationSend);

//			app.WaitForElement(model.ToastMessage);

//			var code = app.Query(model.ToastMessage).First().Text;

//			Console.Out.WriteLine(code);

//			code = code.Replace("Code: ", "");

            app.Tap(model.PhoneVerificationCodeNumber);

            // app.EnterText(code);
            app.EnterText("0000");

            app.Tap(model.PhoneVerificationCodeButton);

            app.Tap(model.PhoneNumberConfirmationSend);

            if (followUserName == null)
            {
                app.Tap(model.FirstFollowArtistButton);
            }
            else
            {
                app.ScrollDownTo(model.FollowArtistButton(followUserName));
                app.Tap(model.FollowArtistButton(followUserName));
            }

            app.Tap(model.FollowDoneButton);

            app.Tap(model.SideMenuHamburger);

            app.Tap(model.SideMenuSetting);

            app.ScrollToVerticalEnd();

            app.Tap(model.SettingsLogout);

            return(email);
        }