Exemple #1
0
    public void PlatformNotify()
    {
        LoginFlow flow = mCurFlow as LoginFlow;

        if (flow != null)
        {
            flow.PlatformLogin();
            return;
        }

        MainFlow mflow = mCurFlow as MainFlow;

        if (mflow == null)
        {
            return;
        }

        if (!PlatformSDK.PlatformLoginSucceed)
        {
            mflow.BackToLogin();
        }
        else
        {// 更新票据到服务器 xeixin
        }
    }
Exemple #2
0
    private BaseFlow createNextFlow(GAME_FLOW_ENUM flow)
    {
        BaseFlow nextFlow = null;

        switch (flow)
        {
        case GAME_FLOW_ENUM.GAME_FLOW_VERIFY:
        {
            nextFlow = new VerifyFlow();
        } break;

        case GAME_FLOW_ENUM.GAME_FLOW_LOGIN:
        {
            nextFlow = new LoginFlow();
        } break;

        case GAME_FLOW_ENUM.GAME_FLOW_MAIN:
        {
            nextFlow = new MainFlow();
        } break;
        }

        if (nextFlow != null)
        {
            nextFlow.Init();
        }

        return(nextFlow);
    }
Exemple #3
0
    public static void OnNetConnectOK()
    {
        LoginFlow flow = GameApp.Instance.GetCurFlow() as LoginFlow;

        if (flow != null)
        {
            flow.ConnectServerSucceed();
        }
        GameDebug.Log("connect server ok");
    }
Exemple #4
0
        public void Logout()
        {
            Console.WriteLine("Step2. Login to Twitter with valid credentials");
            LoginFlow.SuccessfulLogin(LoginData.GetValidCredentials());

            Console.WriteLine("Step3. Log out from Twitter");
            Settings.ClickSettings();
            Settings.IsDropdownOpened();
            Settings.ClickLogout();

            Console.WriteLine("Step4. Check that Twitter Home page is loaded");
            HomePage.IsPageLoaded();
        }
Exemple #5
0
 public static LoginResult Run(LoginFlow loginFlow)
 {
     switch (loginFlow)
     {
         case LoginFlow.ForEventGen:
             return LoginFlowEventGen();
         case LoginFlow.ForExperiment:
             return LoginFlowExperiment();
         case LoginFlow.Regular:
             return LoginFlowRegular();
         default:
             throw new NotSupportedException();
     }
 }
Exemple #6
0
        public static LoginResult Run(LoginFlow loginFlow)
        {
            switch (loginFlow)
            {
            case LoginFlow.ForEventGen:
                return(LoginFlowEventGen());

            case LoginFlow.ForExperiment:
                return(LoginFlowExperiment());

            case LoginFlow.Regular:
                return(LoginFlowRegular());

            default:
                throw new NotSupportedException();
            }
        }
Exemple #7
0
        private void ShowAuthFlow()
        {
            var check = MruV.Accounts.IsAccountExist(new IsAccountExistRequest()
            {
                Login = Name
            });

            Name = $"Niezalogowany_{Id}";
            if (check.Exists)
            {
                var loginFlow = new LoginFlow(this);
                loginFlow.Show();
            }
            else
            {
                var registrationFlow = new RegistrationFlow(this);
                registrationFlow.Start();
            }
        }
Exemple #8
0
        public void SendTweet()
        {
            string tweet = "New tweet " + DateTime.Now.ToString("MMddyyyyhhmmss");

            Console.WriteLine("Step2. Login to Twitter with valid credentials");
            LoginFlow.SuccessfulLogin(LoginData.GetValidCredentials());

            Console.WriteLine("Step3. Posting a tweet");
            Feed.TypeNewTweet(tweet);
            Feed.SendTweet();

            Console.WriteLine("Step4. Check that the tweet appears on my profile");
            bool isTweetAppeared = Feed.IsTweetAppeared(tweet);

            Console.WriteLine($"Tweet '{tweet}' {(isTweetAppeared ? "appeared" : "did NOT appeared")}");
            if (!isTweetAppeared)
            {
                throw new Exception($"Tweet '{tweet}' did NOT appeared in Feed");
            }
        }
Exemple #9
0
        public void IncorrectLogin()
        {
            Console.WriteLine("Step2. Login to Twitter with invalid credentials");
            LoginFlow.PerformLogin(LoginData.GetInvalidCredentials());

            Console.WriteLine("Step3. Check that player don't see Feed -> player is not Logged in ");
            bool isLoaded = Feed.IsLoaded();

            Console.WriteLine($"Feed {(isLoaded ? "is" : "is NOT")} loaded");
            if (isLoaded)
            {
                throw new Exception($"Feed is loaded -> player is Logged In, but shouldn't be");
            }

            Console.WriteLine("Step4. Check that player is redirected to Login page");
            LoginPage.IsPageLoaded();

            Console.WriteLine("Step5. Check that player sees Alert message");
            LoginPage.IsAlertMessageLoaded();
            string alertText = LoginPage.GetMessageText();

            Console.WriteLine($"Alert message text: '{alertText}'");
        }
Exemple #10
0
        private async Task RegistroOrLogin(IDialogContext context, IAwaitable <IMessageActivity> result)
        {
            var loginReg = await result;

            if (loginReg.Text.ToLower().Contains("si"))
            {
                var login           = new LoginFlow();
                var loginFormDialog = new FormDialog <LoginFlow>(login, LoginFlow.BuildForm, FormOptions.PromptInStart);
                context.Call(loginFormDialog, LoginHandler);
            }
            else if (loginReg.Text.ToLower().Contains("no"))
            {
                var registro           = new RegistroFlow();
                var registroFormDialog = new FormDialog <RegistroFlow>(registro, RegistroFlow.BuildForm, FormOptions.PromptInStart);
                context.Call(registroFormDialog, RegistroHandler);
                //loginReg.Text = "si";
                //IAwaitable<IMessageActivity> loginsi = new AwaitableFromItem<IMessageActivity>(loginReg);
                //await RegistroOrLogin(context, loginsi);
            }
            else
            {
                //context.Done(this);
            }
        }
Exemple #11
0
 public void SuccessfulLogin()
 {
     Console.WriteLine("Step2. Login to Twitter with valid credentials");
     LoginFlow.SuccessfulLogin(LoginData.GetValidCredentials());
 }
 public LoginSteps()
 {
     loginPage = new LoginPage();
     homePage  = new HomePage();
     loginFlow = new LoginFlow();
 }