Пример #1
0
        public void RegisterDeviceIPModeDifferentPort()
        {
            string changedPort = "1265";

            try
            {
                //SDK for verification
                var deviceSDKSettings = new GeneralInfo_SDK();

                deviceSDKSettings.ChangeDevicePort(changedPort);

                //Click Add Device
                deviceListAccessLayer = new DeviceOperations_AL();
                deviceListAccessLayer.AddDevice();

                //Search Device with Ip Mode with changed port
                var discoveredDevices = registerdeviceAL.SearchDevice(startIp: DriverManager.deviceToRegisterIP, port: changedPort);

                var uidetails = registerdeviceAL.RegisterDevice(DriverManager.deviceToRegisterIP, discoveredDevices);

                //Verify device registration on device list page.
                Assert.IsTrue(deviceListAccessLayer.IsDeviceSuccessfullyRegistered(uidetails.deviceInfo.SerialNumber));

                deviceSDKSettings = new GeneralInfo_SDK(DriverManager.deviceToRegisterIP, changedPort, IXMSoft.Business.SDK.Data.DeviceConnectionType.Ethernet);

                var sdkdetails = deviceSDKSettings.GetDeviceGeneralInfo();

                //Db verification
                //UI doesn't have port so verifying sdk and db for port.
                var deviceDBInfo = dbInteraction.GetDeviceDetailsFromDB(DriverManager.deviceToRegisterIP);
                Assert.AreEqual(sdkdetails.Port, deviceDBInfo.Port);

                Assert.AreEqual(sdkdetails.Name, uidetails.deviceInfo.DeviceName, "Device name invalid");
                Assert.AreEqual(sdkdetails.SerialNo, uidetails.deviceInfo.SerialNumber, "Device serial invalid");
                Assert.AreEqual(sdkdetails.FwVersion, uidetails.deviceInfo.FirmwareVersion, "Device firmware invalid");
                Assert.AreEqual(sdkdetails.Mac, uidetails.networkInfo.MacID, "Device MAC invalid");
                Assert.AreEqual(sdkdetails.IPAddress, uidetails.networkInfo.IP, "Device IP invalid");
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "Fail: Register device using IP failed.");
                TestResult = TestResultType.Fail;
                Assert.Fail(ex.Message);
            }
            finally
            {
                deviceSDKSettings = new GeneralInfo_SDK(DriverManager.deviceToRegisterIP, changedPort, IXMSoft.Business.SDK.Data.DeviceConnectionType.Ethernet);
                deviceSDKSettings.ChangeDevicePort(DriverManager.deviceToRegisterPort);
                Logger.Info("Reverted PORT number back to " + DriverManager.deviceToRegisterPort + " from " + changedPort + " using SDK");
            }
        }
Пример #2
0
        public void RegisterDeviceUI()
        {
            try
            {
                deviceListAccessLayer = new DeviceOperations_AL();
                deviceListAccessLayer.AddDevice();

                Assert.IsTrue(registerdeviceAL.IsAddDeviceDiscoveryUIValid());
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "Fail: Device Register page UI failed.");
                TestResult = TestResultType.Fail;
                Assert.Fail(ex.Message);
            }
        }
Пример #3
0
        public void BulkDeviceRegistration()
        {
            try
            {
                deviceListAccessLayer = new DeviceOperations_AL();
                deviceListAccessLayer.AddDevice();

                registerdeviceAL.SearchDevice(autoDiscover: true);
                Thread.Sleep(2000);
                Assert.IsTrue(IXMWebUtils.IsProgressBarShown(true, CommonLocators.IXMLoader),
                              "Fail: Progress bar not displayed while doing AutoDiscovery");

                string deviceName = "IXMSHR";
                registerdeviceAL.BulkRegisterDevice(deviceName, deviceGrpName: "Simulator");
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "Fail: Register device using auto discover failed.");
                TestResult = TestResultType.Fail;
                Assert.Fail(ex.Message);
            }
        }
Пример #4
0
        public void RegisterDeviceIPMode()
        {
            try
            {
                //Click Add Device
                deviceListAccessLayer = new DeviceOperations_AL();
                deviceListAccessLayer.AddDevice();

                //Search Device with Ip Mode
                var discoveredDevices = registerdeviceAL.SearchDevice(startIp: DriverManager.deviceToRegisterIP);

                var uidetails = registerdeviceAL.RegisterDevice(DriverManager.deviceToRegisterIP, discoveredDevices);

                //Verify device registration on device list page.
                Assert.IsTrue(deviceListAccessLayer.IsDeviceSuccessfullyRegistered(uidetails.deviceInfo.SerialNumber));

                //Db verification
                //ToDo but already from UI below SDK verification is done

                //SDK for verification
                var deviceSDKSettings = new GeneralInfo_SDK(DriverManager.deviceToRegisterIP, DriverManager.deviceToRegisterPort, IXMSoft.Business.SDK.Data.DeviceConnectionType.Ethernet);
                var sdkdetails        = deviceSDKSettings.GetDeviceGeneralInfo();

                Assert.AreEqual(sdkdetails.Name, uidetails.deviceInfo.DeviceName, "Device name invalid");
                Assert.AreEqual(sdkdetails.SerialNo, uidetails.deviceInfo.SerialNumber, "Device serial invalid");
                Assert.AreEqual(sdkdetails.FwVersion, uidetails.deviceInfo.FirmwareVersion, "Device firmware invalid");
                string mac = sdkdetails.Mac == null ? sdkdetails.WiFiMac : sdkdetails.Mac;
                Assert.AreEqual(mac, uidetails.networkInfo.MacID, "Device MAC invalid");
                Assert.AreEqual(sdkdetails.IPAddress, uidetails.networkInfo.IP, "Device IP invalid");
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "Fail: Register device using IP failed.");
                TestResult = TestResultType.Fail;
                Assert.Fail(ex.Message);
            }
        }
Пример #5
0
        public void RegisterDeviceIPModeStartEndRange()
        {
            try
            {
                //Click Add Device
                deviceListAccessLayer = new DeviceOperations_AL();
                deviceListAccessLayer.AddDevice();

                var discoveredDevices = registerdeviceAL.SearchDevice(startIp: "192.168.138.2", endIp: "192.168.138.4");

                var allRegisteredDevices = registerdeviceAL.BulkRegisterDevice();

                //Verify device registration on device list page.
                foreach (var uidetails in allRegisteredDevices)
                {
                    Assert.IsTrue(deviceListAccessLayer.IsDeviceSuccessfullyRegistered(uidetails.deviceInfo.SerialNumber));
                    deviceSDKSettings = new GeneralInfo_SDK(uidetails.networkInfo.IP, "9734", IXMSoft.Business.SDK.Data.DeviceConnectionType.Ethernet);
                    var sdkdetails = deviceSDKSettings.GetDeviceGeneralInfo();

                    //Db verification

                    //SDK verification
                    Assert.AreEqual(sdkdetails.Name, uidetails.deviceInfo.DeviceName, "Device name invalid");
                    Assert.AreEqual(sdkdetails.SerialNo, uidetails.deviceInfo.SerialNumber, "Device serial invalid");
                    Assert.AreEqual(sdkdetails.FwVersion, uidetails.deviceInfo.FirmwareVersion, "Device firmware invalid");
                    Assert.AreEqual(sdkdetails.Mac, uidetails.networkInfo.MacID, "Device MAC invalid");
                    Assert.AreEqual(sdkdetails.IPAddress, uidetails.networkInfo.IP, "Device IP invalid");
                }
            }
            catch (Exception ex)
            {
                Logger.Error(ex, "Fail: Register device using IP for start ip end ip range failed.");
                TestResult = TestResultType.Fail;
                Assert.Fail(ex.Message);
            }
        }