Ejemplo n.º 1
0
        public void WhenGetFilteredDevicesFromServerThenShowFilteredDevices()
        {
            UI_Customer.DataModels.FilterDataModel FilterExample = new UI_Customer.DataModels.FilterDataModel
            {
                measurements = new List <string> {
                    "ECG"
                },
                weight = new List <string> {
                    "1-10"
                },
                resolution = new List <string> {
                    "1920x1080"
                },
                batterycapacity = new List <string> {
                    "7"
                }
            };
            UI_Customer.PreferenceModel.Preferences.SaveFilterPreferencesForIp(FilterExample);
            var application = Application.Launch(@"F:\philips pre-joining training\case study 2 part 2 AssistPurchase\git exact copy 2\assist-purchase-s21b4\Segment2_GUI\UI-Customer\bin\Debug\UI-Customer.exe");

            var HomePage = application.GetWindow("HomePage", InitializeOption.NoCache);

            var assistant_button = HomePage.Get <Button>(
                SearchCriteria.ByAutomationId("Assistant"));

            assistant_button.Click();
            var devices_got_from_server = UI_Customer.ServerConnection.Devices.getFilterdDevices(FilterExample);

            foreach (var singleDevice in devices_got_from_server)
            {
                string listOfMeasurements = null;
                foreach (var singleMeasurement in singleDevice.measurements)
                {
                    listOfMeasurements += singleMeasurement + " ";
                }
                string s = singleDevice.name + "\n" + singleDevice.overview + "\n" + listOfMeasurements + "\n";
                HomePage.Get <Label>(SearchCriteria.ByText(s));
            }
            //Here currently just checking whether filtered devices are present in window or not.
            //it is not checking for other devices than filtered devices are shown or not.(Idealy window must not contain devices other than filtered devices).
            application.Close();
        }
Ejemplo n.º 2
0
        public void WhenCustomerPreferencesAreSavedThenLoadCustomerPreferences()
        {
            UI_Customer.DataModels.FilterDataModel FilterExample = new UI_Customer.DataModels.FilterDataModel
            {
                measurements = new List <string> {
                    "ECG"
                },
                weight = new List <string> {
                    "1-10"
                },
                resolution = new List <string> {
                    "1920x1080"
                },
                batterycapacity = new List <string> {
                    "7"
                }
            };
            UI_Customer.PreferenceModel.Preferences.SaveFilterPreferencesForIp(FilterExample);
            var application = Application.Launch(@"F:\philips pre-joining training\case study 2 part 2 AssistPurchase\git exact copy 2\assist-purchase-s21b4\Segment2_GUI\UI-Customer\bin\Debug\UI-Customer.exe");

            var HomePage = application.GetWindow("HomePage", InitializeOption.NoCache);

            var assistant_button = HomePage.Get <Button>(
                SearchCriteria.ByAutomationId("Assistant"));

            output.WriteLine(assistant_button.Text);
            assistant_button.Click();
            var ECG_checkbox = HomePage.Get <CheckBox>(
                SearchCriteria.ByText("ECG"));
            var weightRange_checkbox = HomePage.Get <CheckBox>(
                SearchCriteria.ByText("1-10 Kg"));
            var resolution_checkbox = HomePage.Get <CheckBox>(
                SearchCriteria.ByText("1920x1080"));
            var battery_checkbox = HomePage.Get <CheckBox>(
                SearchCriteria.ByText("7"));

            Assert.True(ECG_checkbox.IsSelected);
            Assert.True(weightRange_checkbox.IsSelected);
            Assert.True(resolution_checkbox.IsSelected);
            Assert.True(battery_checkbox.IsSelected);
            application.Close();
        }