public static AddProductPage SearchProduct(IWebDriver driver, Product product)
        {
            AddProductPage addProductPage = new AddProductPage(driver);

            addProductPage.AddNewProduct(product);
            return(new AddProductPage(driver));
        }
Example #2
0
        //Former constructor.

        /*public App ()
         * {
         *      InitializeComponent();
         *
         * MainPage = new NavigationPage(new MainPage());
         * }*/

        /// <summary>
        /// Initializes a new instance of the App Class
        /// </summary>
        /// <param name="path"></param>
        public App(string path)
        {
            InitializeComponent();

            //Gets the database path send from BooksMVVM.Android.MainActivity.cs
            DB_PATH = path;

            //Instansiates the different viewmodels and pages.
            MainDAL dal = new MainDAL();
            IAddProductPageViewModel addProductPageViewModel = new AddProductPageViewModel(dal);
            AddProductPage           addproductPage          = new AddProductPage(addProductPageViewModel);
            IMakeListPageViewModel   makeListPageViewModel   = new MakeListPageViewModel(dal);
            MakeListPage             makeListPage            = new MakeListPage(makeListPageViewModel);
            //Not sure if this violates MVVM, but it needs them to navigate between pages.
            //One way to fix this could maybe be to simple have to codebehind handle the navigation
            //but I am not sure if it violates MVVM.
            IMainPageViewModel mainPageViewModel = new MainPageViewModel(addproductPage, makeListPage, dal);
            MainPage           mainPage          = new MainPage(mainPageViewModel);
            NavigationPage     navigationPage    = new NavigationPage(mainPage)
            {
                BarBackgroundColor = Color.FromHex("#2199e8"),
                BarTextColor       = Color.White
            };

            MainPage = navigationPage;
        }
        public void NewProduct()
        {
            AddProductPage addProductPage = new AddProductPage(driver);

            addProductPage.AddNewProduct();

            Assert.AreEqual(searchProductName, addProductPage.AssertAddNewProducts());
        }
 public void Setup()
 {
     driver = new ChromeDriver();
     driver.Navigate().GoToUrl("http://localhost:5000/");
     driver.Manage().Window.Maximize();
     loginPage = new LoginPage(driver);
     AddProductPage addProductPage = loginPage.LoginMetod(name, password);
 }
Example #5
0
        public void AddNewProduct()
        {
            MainPage = new MainPage(driver);

            AddProduct = new AddProductPage(driver);
            AddProduct.AddNewProduct();
            Assert.AreEqual("Create new", driver.FindElement(By.XPath("//a[@href='/Product/Create']")).Text);
        }
        public void ThenIShouldBeAbleToAddNewProductInToTheInventory()
        {
            //Create AddNewProduct object

            AddProductPage NewProduct = new AddProductPage();

            NewProduct.AddNewProduct();
        }
Example #7
0
        public void AddNewProductTest()
        {
            //Create AddNewProduct object

            AddProductPage NewProduct = new AddProductPage();

            NewProduct.AddNewProduct();
        }
        /// <summary>
        /// Initializes a new instance of the MainPageViewModel class.
        /// </summary>
        /// <param name="addBookPage"></param>
        /// <param name="makeListPage"></param>
        public MainPageViewModel(AddProductPage addProductPage, MakeListPage makeListPage, MainDAL dal)
        {
            this.addProductPage = addProductPage;
            this.makeListPage   = makeListPage;
            DAL = dal;

            //Creates the commands bound to from the view.
            ToolbarItem_ADD_Command  = new Command(ToolbarItem_ADD_Command_Execute);
            ToolbarItem_FILL_Command = new Command(ToolbarItem_FILL_Command_Execute);
            ClearBtn_Command         = new Command(ClearBtn_Command_Execute, ClearBtn_Command_CanExecute);
            DeleteModeBtn_Command    = new Command(DeleteModeBtn_Command_Execute, DeleteModeBtn_Command_CanExecute);
        }
        public void WhenICheckCreatProduct(string ProductName)
        {
            AddProductPage addProductPage = new AddProductPage(driver);

            Assert.AreEqual(ProductName, addProductPage.AssertAddNewProducts(new Product(ProductName, null, null, null, null, null, null, null)));
        }
Example #10
0
 public AddProductSteps(ContextObject context)
 {
     _context        = context;
     _addProductPage = new AddProductPage(_context);
 }
        public void NewProduct()
        {
            addProductPage = ProductService.SearchProduct(driver, CreateProductNew);

            Assert.AreEqual(CreateProductNew.searchProductName, addProductPage.AssertAddNewProducts(CreateProductNew.searchProductName));
        }