예제 #1
0
        public CommunicationsResponse RetrieveSelectedBankAccountDetails(BankCommsCapsule capsule)
        {
            string address = "https://online.mbank.pl/pl/Login";
            CommunicationsResponse response = new CommunicationsResponse();

            ChromeDriver driver = new ChromeDriver();

            driver.Navigate().GoToUrl(address);

//            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
            Thread.Sleep(3000);

            IWebElement login    = driver.FindElementByName("userID");
            IWebElement password = driver.FindElementByName("pass");

            login.SendKeys(capsule._login);
            password.SendKeys(capsule._password);

            password.Submit();


            driver.Navigate().GoToUrl("https://online.mbank.pl/pl#/accounts");
            Thread.Sleep(3000);
            // IWebElement account = driver.FindElementByName

            driver.Quit();
            return(response);
        }
예제 #2
0
        internal BankCommsCapsule ReadAccountInfo(SingleAccountInfo info)
        {
            BankCommsCapsule commsCapsule = new BankCommsCapsule(info.login, info.password);

            //TODO bank url creation
            return(commsCapsule);
        }
예제 #3
0
        internal BankCommsCapsule CreateBankCommunicationsCapsule(SingleAccountInfo info)
        {
            ConfigReader configReader = new ConfigReader();

            BankCommsCapsule capsule = configReader.ReadAccountInfo(info);

            return(capsule);
        }
예제 #4
0
        public CommunicationsResponse RetrieveSelectedBankAccountDetails(BankCommsCapsule capsule)
        {
            return(null);
            //if (_fakeInfo.IsEqualTo(capsule))
            //{
            //    return PrefabricatedCommsResponse();
            //}

            //return NullObjectResponse();
        }
예제 #5
0
        public BankAccountDetails GiveAccountDetails(SingleAccountInfo info)
        {
            AccountInfoRequestFactory factory = new AccountInfoRequestFactory();
            BankCommsCapsule          capsule = factory.CreateBankCommunicationsCapsule(info);

            CommunicationsResponse resp = _selectedComms.RetrieveSelectedBankAccountDetails(capsule);//the part where magic happens

            AccountInfoResponseParser parser  = new AccountInfoResponseParser();
            BankAccountDetails        details = parser.FormAccountDetails(resp);

            return(details);
        }
예제 #6
0
 internal BankCommsCapsule ReadAccountInfo(SingleAccountInfo info)
 {
     BankCommsCapsule commsCapsule = new BankCommsCapsule(info.login, info.password);
     //TODO bank url creation
     return commsCapsule;
 }
예제 #7
0
        public CommunicationsResponse RetrieveSelectedBankAccountDetails(BankCommsCapsule capsule)
        {
            return null;
            //if (_fakeInfo.IsEqualTo(capsule))
            //{
            //    return PrefabricatedCommsResponse();
            //}

            //return NullObjectResponse();
        }
예제 #8
0
        public CommunicationsResponse RetrieveSelectedBankAccountDetails(BankCommsCapsule capsule)
        {
            string address = "https://online.mbank.pl/pl/Login";
            CommunicationsResponse response = new CommunicationsResponse();

            ChromeDriver driver = new ChromeDriver();
            driver.Navigate().GoToUrl(address);

            //            WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
            Thread.Sleep(3000);

            IWebElement login = driver.FindElementByName("userID");
            IWebElement password = driver.FindElementByName("pass");

            login.SendKeys(capsule._login);
            password.SendKeys(capsule._password);

            password.Submit();

            driver.Navigate().GoToUrl("https://online.mbank.pl/pl#/accounts");
            Thread.Sleep(3000);
               // IWebElement account = driver.FindElementByName

            driver.Quit();
            return response;
        }