예제 #1
0
        public void W082_ProductEditor_tabControl_models_row0_Brand()
        {
            // get modelsDataGridView and check it's visible
            DataGridView modelsDataGridView =
                TestDriver.WidgetGet <DataGridView>("ProductEditor.tabControl.models.modelsDataGridView");

            // check the brand for row 0
            int selectedRow = modelsDataGridView.SelectedIndices[0];

            Assert.AreEqual("Samsung", modelsDataGridView.GetCellText(2, selectedRow));

            modelsDataGridView.FocusCellInColumn(2);

            Assert.AreEqual(2, modelsDataGridView.GetFocusedColumn());
            Assert.AreEqual(selectedRow, modelsDataGridView.GetFocusedRow());

            // get the cell editor for current focused cell
            ComboBox cellEditor = modelsDataGridView.CellEditorGet <ComboBox>();

            Assert.IsNotNull(cellEditor);

            // check cell editor text
            cellEditor.AssertTextIs("Samsung");

            // edit brand
            cellEditor.SelectItem(5);
            modelsDataGridView.StopEditing();

            // check the brand changes
            const string brand = "Philips";

            Assert.AreEqual(brand, modelsDataGridView.WaitForCellText(brand));
        }
예제 #2
0
        public void W084_ProductEditor_tabControl_models_row0_ProductType()
        {
            // get modelsDataGridView and check it's visible
            DataGridView modelsDataGridView =
                TestDriver.WidgetGet <DataGridView>("ProductEditor.tabControl.models.modelsDataGridView");

            // check the product type for row 0
            int selectedRow = modelsDataGridView.SelectedIndices[0];

            Assert.AreEqual("TV", modelsDataGridView.GetCellText(3, selectedRow));

            modelsDataGridView.FocusCellInColumn(3);

            Assert.AreEqual(3, modelsDataGridView.GetFocusedColumn());
            Assert.AreEqual(selectedRow, modelsDataGridView.GetFocusedRow());

            // get the cell editor for current focused cell
            ComboBox cellEditor = modelsDataGridView.CellEditorGet <ComboBox>();

            Assert.IsNotNull(cellEditor);

            // check cell editor text
            cellEditor.AssertTextIs("TV");

            // edit product type
            cellEditor.SelectItem(2);
            modelsDataGridView.StopEditing();

            // check the product type changes
            const string productType = "Radio";

            Assert.AreEqual(productType, modelsDataGridView.WaitForCellText(productType));
        }
예제 #3
0
        public void W054_CustomerEditor_EditRegisterOne_state()
        {
            // get CustomerEditor and check it's visible
            Form customerEditor = TestDriver.WidgetGet <Form>("CustomerEditor");

            // get DataGridView
            DataGridView dataGridView = customerEditor.WidgetGet <DataGridView>("dataGridView");

            // check DataGridView has two rows
            Assert.IsTrue(dataGridView.RowCount == 2,
                          string.Format("dataGridView row count: expected 2 and actual is {0}.", dataGridView.RowCount));

            // get state ComboBox
            ComboBox state = customerEditor.WidgetGet <ComboBox>("state");

            // check state
            state.AssertTextIs("Florida");

            // change state
            state.SelectItem(25);
            // wait until it's changed
            customerEditor.WidgetWaitAssertTextIs("state", "Mississippi", "ComboBox");

            if (CurrentBrowser == Browser.Edge)
            {
                TestDriver.Sleep(Waiter.BrowserUpdate);
            }

            // now Save it
            customerEditor.ButtonClick("saveButton");

            // get & check changed lastName
            customerEditor.WidgetWaitAssertTextIs("state", "Mississippi", "ComboBox");

            TestDriver.Sleep(Waiter.Duration);
        }