public static void PO_AdvertiseJobs()
        {
            ExtendMethods.ButtonClick(Driver.driver, "XPath", "/html/body/div[5]/div/div[5]/a[1]");
            Thread.Sleep(1500);

            //navigate to Owners>Properties
            ExtendMethods.ButtonClick(Driver.driver, "XPath", "/html[1]/body[1]/div[1]/div[1]/div[2]/div[1]");
            Thread.Sleep(1500);
            ExtendMethods.ButtonClick(Driver.driver, "XPath", "/html[1]/body[1]/div[1]/div[1]/div[2]/div[1]/div[1]/a[4]");


            //Checking the right page
            Assert.AreEqual("My Advertised Jobs", Driver.driver.Title);
            Base.test = Base.extent.StartTest("In My Advertised Jobs  page");
            Thread.Sleep(1500);

            //Adding new job
            ExtendMethods.ButtonClick(Driver.driver, "XPath", "/ html[1] / body[1] / div[2] / div[1] / div[1] / div[2] / div[1] / div[2] / a[1]");


            ExtendMethods.TextBox(Driver.driver, "XPath", "/html[1]/body[1]/div[2]/div[1]/div[1]/form[1]/div[1]/div[1]/div[1]/div[2]/div[1]/input[1]", "Gas Geyser Installation");
            Thread.Sleep(1500);
            ExtendMethods.TextBox(Driver.driver, "XPath", "/html[1]/body[1]/div[2]/div[1]/div[1]/form[1]/div[1]/div[1]/div[1]/div[3]/div[1]/input[1]", "600");
            Thread.Sleep(1500);

            ExtendMethods.TextBox(Driver.driver, "XPath", "/html[1]/body[1]/div[2]/div[1]/div[1]/form[1]/div[1]/div[1]/div[2]/div[1]/textarea[1]", "Need Urgent installation of gas geyser");
            ExtendMethods.ButtonClick(Driver.driver, "XPath", "/html[1]/body[1]/div[2]/div[1]/div[1]/form[1]/div[1]/div[3]/div[1]/div[1]/button[1]");
            Base.test = Base.extent.StartTest("Job added succesfully");
        }
        public void GivenIHaveLoggedInWithValidServiceSupplier()
        {
            Base.Init();
            LoginPage obj = new LoginPage();

            obj.MyDoSomethingMethod(LoginPage.MyEnumUserLogin.Service_Supp);
            ExtendMethods.ButtonClick(Driver.driver, "XPath", "/html/body/div[5]/div/div[5]/a[1]");
        }
Ejemplo n.º 3
0
        private string GetJobId(Task model)
        {
            string jobId;

            if (Request == null)
            {
                jobId = GetJobIdFromUrl(model.Url);
            }
            else
            {
                jobId = ExtendMethods.URLSafeString($"{model.Id}_{model.Name}");
            }
            return(jobId);
        }
Ejemplo n.º 4
0
 public static void SS_ApplyJob()
 {
     //ExtendMethods.ButtonClick(Driver.driver, "XPath", "/html/body/div[5]/div/div[5]/a[1]");
     Thread.Sleep(1500);
     ExtendMethods.ButtonClick(Driver.driver, "XPath", "/html[1]/body[1]/div[1]/div[1]/div[2]/a[3]");
     ExtendMethods.ButtonClick(Driver.driver, "XPath", "/html[1]/body[1]/div[2]/div[1]/div[1]/div[3]/div[1]/div[3]/div[1]/div[1]/button[1]");
     //Console.WriteLine(Driver.driver.FindElement(By.XPath("/html[1]/body[1]/div[2]/div[1]/div[2]/form[1]/fieldset[1]/div[2]/div[1]/div[1]/div[1]/div[3]/div[1]/div[1]/h4[1]")).Text);
     Thread.Sleep(1500);
     ExtendMethods.TextBox(Driver.driver, "XPath", "/html[1]/body[1]/div[2]/div[1]/div[2]/form[1]/fieldset[1]/div[3]/div[1]/div[1]/input[1]", "550");
     ExtendMethods.TextBox(Driver.driver, "XPath", "/html[1]/body[1]/div[2]/div[1]/div[2]/form[1]/fieldset[1]/div[3]/div[2]/div[1]/textarea[1]", "I Will Fix This Jon ASAP");
     Thread.Sleep(1500);
     ExtendMethods.ButtonClick(Driver.driver, "XPath", "/html[1]/body[1]/div[2]/div[1]/div[2]/form[1]/fieldset[1]/div[3]/div[4]/button[1]");
     Base.test = Base.extent.StartTest("Quote submitted successfully");
 }
Ejemplo n.º 5
0
        private string GetJobIdFromUrl(string url)
        {
            Uri uri = new Uri(url);

            string[] appMethod = uri.AbsolutePath.Split('/');
            var      query     = HttpUtility.ParseQueryString(uri.Query);

            string hostname = ExtendMethods.URLSafeString(uri.Host);
            string app      = appMethod[1];
            string method   = appMethod[2];
            string button   = query["button"];
            string modelId  = query["modelId"];

            return($"{hostname}_{app}_{method}_{button}_{modelId}");
        }
Ejemplo n.º 6
0
        public void TestConvertingDictionaryToEntry1WhereOneElementIsSet()
        {
            Dictionary <Object, Object> test = new Dictionary <Object, Object>();

            test.Add("1", 11);
            test.Add("21", 111);

            Entry1[] result = ExtendMethods.ConvertMap <Entry1>(test);

            foreach (Entry1 e1 in result)
            {
                Assert.IsTrue(test.ContainsKey(e1.key));
                Assert.AreEqual(test[e1.key], e1.value);
            }
        }
Ejemplo n.º 7
0
        public void TestConvertingDictionaryToMap()
        {
            // Map = EntryX[]
            Dictionary <Object, Object> test = new Dictionary <Object, Object>();

            test.Add("1", 11);
            test.Add("21", 111);

            Entry1[] result = (Entry1[])ExtendMethods.ConvertMap(test, typeof(Entry1));

            foreach (Entry1 e1 in result)
            {
                Assert.IsTrue(test.ContainsKey(e1.key));
                Assert.AreEqual(test[e1.key], e1.value);
            }
        }
Ejemplo n.º 8
0
        public void TestConvertingMapToDictionary()
        {
            // Map = EntryX[]
            Entry1[] test = new Entry1[]
            {
                new Entry1()
                {
                    key = "1", value = 11
                },
                new Entry1()
                {
                    key = "21", value = 21
                }
            };

            IDictionary <String, int> result = ExtendMethods.ConvertMap <String, int>(test);

            foreach (Entry1 e1 in test)
            {
                Assert.IsTrue(result.ContainsKey(e1.key));
                Assert.AreEqual(result[e1.key], e1.value);
            }
        }
Ejemplo n.º 9
0
        public void RemoveTest()
        {
            牌[] 一组牌 = new 牌[] {
                // 黑
                new 牌 {
                    数据 = 0x010101u
                },                      // A
                new 牌 {
                    数据 = 0x010102u
                },
                new 牌 {
                    数据 = 0x010103u
                },
                new 牌 {
                    数据 = 0x010104u
                },
                new 牌 {
                    数据 = 0x010105u
                },
                new 牌 {
                    数据 = 0x010106u
                },
                new 牌 {
                    数据 = 0x010107u
                },
                new 牌 {
                    数据 = 0x010108u
                },
                new 牌 {
                    数据 = 0x010109u
                },
                new 牌 {
                    数据 = 0x01010Au
                },                      // 10
                new 牌 {
                    数据 = 0x01010Bu
                },                      // J
                new 牌 {
                    数据 = 0x01010Cu
                },                      // Q
                new 牌 {
                    数据 = 0x01010Du
                },                      // K
            };
            牌[] 另一组牌 = new 牌[] {
                // 黑
                new 牌 {
                    数据 = 0x010101u
                },                      // A
                new 牌 {
                    数据 = 0x010102u
                },
                new 牌 {
                    数据 = 0x010103u
                },
                new 牌 {
                    数据 = 0x010104u
                },
                new 牌 {
                    数据 = 0x010105u
                },
                new 牌 {
                    数据 = 0x010106u
                },
                new 牌 {
                    数据 = 0x010107u
                },
                new 牌 {
                    数据 = 0x010108u
                },
                new 牌 {
                    数据 = 0x010109u
                },
            };
            牌[] 结果 = new 牌[] {
                // 黑
                new 牌 {
                    数据 = 0x01010Au
                },                      // 10
                new 牌 {
                    数据 = 0x01010Bu
                },                      // J
                new 牌 {
                    数据 = 0x01010Cu
                },                      // Q
                new 牌 {
                    数据 = 0x01010Du
                },                      // K
            };



            牌[] Source   = 一组牌;  // TODO: 初始化为适当的值
            牌[] Target   = 另一组牌; // TODO: 初始化为适当的值
            牌[] expected = 结果;   // TODO: 初始化为适当的值
            牌[] actual;
            actual = ExtendMethods.Remove(Source, Target);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("验证此测试方法的正确性。");
        }