Exemplo n.º 1
0
        public void AddItem()
        {
            VaultPage vaultPage = new VaultPage();

            vaultPage.ClickAddItem();
            Thread.Sleep(3000);
            AddItemPage addItem = new AddItemPage();

            addItem.CreateItem("Login", "Clayton Automation", "Selenium", "Password01", "https://www.googe.com");
        }
Exemplo n.º 2
0
        public NavigationViewModel()
        {
            AllItems      = new VaultPage("All items");
            FavoriteItems = new FavoritesVaultPage();
            CategoryItems.Add(new CategoryVaultPage("Login", "LoginIcon", typeof(LoginItem)));
            CategoryItems.Add(new CategoryVaultPage("Note", "NoteIcon", typeof(NoteItem)));
            CategoryItems.Add(new CategoryVaultPage("Card", "CardIcon", typeof(CardItem)));
            CategoryItems.Add(new CategoryVaultPage("Identity", "IdentityIcon", typeof(IdentityItem)));

            Settings = new SettingsPageViewModel();
            Account  = new AccountPageViewModel();

            UpdateFolders();

            BitwardenFoldersRepository.Instance.PropertyChanged += Folders_PropChanged;
        }
Exemplo n.º 3
0
        public void Login()
        {
            Driver.Navigate().GoToUrl("https://testdo.bitwarden.com");
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);

            LoginPage loginPage = new LoginPage();
            VaultPage vaultPage = new VaultPage();

            loginPage.EnterUserNameAndPassword(Data.GetEmail(), Data.GetPassword());
            loginPage.ClickLogin();

            Thread.Sleep(3000);

            Assert.AreEqual(Driver.Url, "https://testdo.bitwarden.com/#/vault", "URL doesn't match");
            GetScreenshot.TakeScreenshot();
        }
        /// <summary>
        /// TODO: Comment
        /// </summary>
        public void AuthenticateExcecute()
        {
            //TODO: Save path in configuration
            string configurationPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments),
                                                    "SecureVault",
                                                    "settings",
                                                    "configuration.dat");

            ConfigurationHelper configHelper       = new ConfigurationHelper(configurationPath);
            HashHelper          hashHelper         = new HashHelper();
            SecureStringHelper  secureStringHelper = new SecureStringHelper();

            //Check if password is correct
            if (hashHelper.ComputeHash(secureStringHelper.SecureStringToString(this.Password)).Equals(configHelper.GetPasswordHash()))
            {
                IEnumerable <Tuple <string, string, string> > savedData = configHelper.GetAllSavedData();
                ObservableCollection <SavedData> dataCollection         = new ObservableCollection <SavedData>();

                foreach (var data in savedData)
                {
                    dataCollection.Add(new SavedData()
                    {
                        Name = data.Item1, EncryptedValue = data.Item2, Salt = data.Item3
                    });
                }

                this.Model.SavedData = dataCollection;

                //Navigate to the VaultPage
                VaultPage vaultPage = new VaultPage();
                vaultPage.DataContext = new VaultViewModel(this.Model);
                this.MainFrame.Navigate(vaultPage);
            }
            else
            {
                this.Error           = "Invalid Password";
                this.Model.SavedData = null;
            }
        }