示例#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);
        }
        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;
        }