/// <summary>
 /// is enable manipulatives: yes checked?
 /// </summary>
 /// <returns>true or false</returns>
 public bool IsSelectedEnableManipulativesYes()
 {
     Yes.Wait(3);
     //debugging
     Yes.Selected = FakeDummyBooleanValue;
     return(Yes.Selected);
 }
 /// <summary>
 /// is enable manipulatives: yes displayed?
 /// </summary>
 /// <returns>true or false</returns>
 public bool IsDisplayedEnableManipulativesYes()
 {
     Yes.WaitUntilExists(3);
     //debugging
     Yes.Displayed = FakeDummyBooleanValue;
     return(Yes.Displayed);
 }
        public virtual void CopyValueToCurrentValueColumn()
        {
            PartnershipHelper partnershipHelper = ClassFactory.Get <PartnershipHelper>(new ConstructorArgument("userConnection", UserConnection));
            Guid   parameterValueTypeId         = Entity.GetTypedColumnValue <Guid>("ParameterValueTypeId");
            string columnValueName = partnershipHelper.GetColumnValueNameByType(parameterValueTypeId);

            switch (columnValueName)
            {
            case "BooleanValue":
                var boolValue = Entity.GetTypedColumnValue <Boolean>(columnValueName);
                Entity.SetColumnValue("CurrentValue", boolValue ? Yes.ToString() : No.ToString());
                break;

            case "ListItemValue":
                Guid listItemValueId = Entity.GetTypedColumnValue <Guid>("ListItemValueId");
                Guid guidValue       = Entity.GetTypedColumnValue <Guid>("GuidValue");
                Guid categoryId      = Entity.GetTypedColumnValue <Guid>("PartnerParamCategoryId");
                Entity.SetColumnValue("CurrentValue",
                                      guidValue.Equals(Guid.Empty) ?
                                      listItemValueId.ToString() :
                                      getLookupDisplayValueByCategory(categoryId, guidValue)
                                      );
                break;

            default:
                Entity.SetColumnValue("CurrentValue", Entity.GetTypedColumnValue <string>(columnValueName));
                break;
            }
        }
Exemplo n.º 4
0
        public AdventureCommandRegistry(IReadonlyAdventureGame game)
        {
            var lookCommand      = new Look(game, "look", "l");
            var helpCommand      = new Help(game, "help");
            var moveCommand      = new Move(game, "move", "go", "walk", "run", "climb", "crawl");
            var takeCommand      = new Take(game, "take", "get", "grab");
            var dropCommand      = new Drop(game, "drop");
            var magicWord1       = new Xyzzy(game, "xyzzy");
            var magicWord2       = new Plugh(game, "plugh");
            var inventoryCommand = new Carrying(game, "inventory", "inv");
            var interactCommand  = new Interact(game, "use"); // Do not add aliases for this command
            var yes = new Yes(game, "yes", "y");
            var no  = new No(game, "no", "n");
            var say = new Say(game, "say");

            RegisteredCommands = new List <IAdventureCommand> {
                lookCommand,
                helpCommand,
                moveCommand,
                takeCommand,
                dropCommand,
                magicWord1,
                magicWord2,
                inventoryCommand,
                interactCommand,
                yes,
                no,
                say,
            };
        }
Exemplo n.º 5
0
 internal void DeleteShareSkill()
 {
     try
     {
         //Click on Manage Listings
         ManageListings.Click();
         GlobalDefinitions.ExcelLib.PopulateInCollection(Base.ManageListingExcelPath, "ManageListings");
         string FirstPath  = "//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[";
         string SecondPath = "]/td[3]";
         string getTitle   = null;
         bool   flag       = false;
         int    temp       = 0;
         while (true)
         {
             for (int rownum = 1; rownum <= (Totalrows.Count); rownum++)
             {
                 getTitle = GlobalDefinitions.driver.FindElement(By.XPath(FirstPath + rownum + SecondPath)).Text;
                 temp     = 1;
                 if (getTitle == GlobalDefinitions.ExcelLib.ReadData(2, "Title"))
                 {
                     if (GlobalDefinitions.ExcelLib.ReadData(2, "Deleteaction") == "Yes")
                     {
                         //Click on Delete
                         GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + rownum + "]/td[8]/div/button[3]/i")).Click();
                         GlobalDefinitions.wait(10000);
                         Yes.Click();
                         GlobalDefinitions.wait(10000);
                         Assert.Pass("Record is successfully deleted");
                         flag = true;
                         return;
                     }
                     else
                     {
                         //Click on Delete
                         GlobalDefinitions.driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[" + rownum + "]/td[8]/div/button[3]/i")).Click();
                         GlobalDefinitions.wait(10000);
                         No.Click();
                         GlobalDefinitions.wait(10000);
                         Assert.Pass("There is matching record but it is not deleted");
                         flag = true;
                         return;
                     }
                 }
             }
             if (flag == false)
             {
                 NextPage.Click();
             }
             if (temp == 1)
             {
                 Assert.Pass("There is no matching record to delete");
             }
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex.Message);;
     }
 }
 /// <summary>
 /// select enable manipulatives: yes
 /// </summary>
 public void SelectEnableManipulativesYes()
 {
     Yes.Wait(3).Click();
     //debugging
     Yes.Selected             = true;
     No.Selected              = false;
     UseItemSettings.Selected = false;
 }
Exemplo n.º 7
0
        public override DeterminatieResultaat Determineer(Klimatogram klimatogram)
        {
            var para1          = ParameterFactory.CreateParameter(Voorwaarde.BaseValue).Execute(klimatogram);
            var p2             = ParameterFactory.CreateParameter(Voorwaarde.ComparingValue);
            var para2          = p2 == null ? Voorwaarde.ComparingValue : p2.Execute(klimatogram).First();
            var baseValue      = double.Parse(para1.First());
            var comparingValue = double.Parse(para2);
            var oper           = OperatorFactory.CreateOperator(Voorwaarde.Operator);

            return(OperatorFactory.ExecuteOperator(oper, baseValue, comparingValue)
                ? Yes.Determineer(klimatogram)
                : No.Determineer(klimatogram));
        }
 /// <summary>
 /// Clean up any resources being used.
 /// </summary>
 /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
 protected override void Dispose(bool disposing)
 {
     if (disposing && (components != null))
     {
         components.Dispose();
     }
     if (disposing)
     {
         Yes.Dispose();
         TotalYes.Dispose();
         TotalNo.Dispose();
         ServerOnline.Dispose();
     }
     base.Dispose(disposing);
 }
Exemplo n.º 9
0
 private void DrawYesButton()
 {
     if (_dialogType == DialogType.No)
     {
         return;
     }
     GUI.enabled = _yesPossible;
     if (!GUILayout.Button(_yes))
     {
         return;
     }
     Yes.Raise((T)this);
     if (_closeOnYes)
     {
         Close();
     }
 }
Exemplo n.º 10
0
        public override void Execute()
        {
            AWSAuthConnection svc = new AWSAuthConnection();

            if (prefix.EndsWith("*"))
            {
                prefix = prefix.Substring(0, prefix.Length - 1);
            }

            int  fileCount = 0, errorCount = 0;
            long fileSize = 0;

            foreach (ListEntry e in new IterativeList(bucket, prefix, regex))
            {
                string prompt = string.Format("{0}\t{1,14:##,#}\t{2}", e.LastModified, e.Size, e.Key);
                if (Yes.Confirm(prompt))
                {
                    Response response = svc.delete(bucket, e.Key, null);
                    response.Connection.Close();
                    if (response.Status != System.Net.HttpStatusCode.NoContent)
                    {
                        Console.Error.WriteLine(" error: {0}", response.Status);
                        errorCount++;
                    }
                    else
                    {
                        fileCount++;
                        fileSize += e.Size;
                    }
                }
                else
                {
                }
            }
            if (0 == errorCount)
            {
                Console.Error.WriteLine(string.Format("{0} files, {1:##,#} bytes", fileCount, fileSize));
            }
            else
            {
                Console.Error.WriteLine(string.Format("{0} files, {1:##,#} bytes; {2} errors", fileCount, fileSize, errorCount));
            }
        }
Exemplo n.º 11
0
        public override void Serialize(IGenericWriter writer)
        {
            base.Serialize(writer);

            writer.WriteEncodedInt(0); // version

            writer.WriteEncodedInt(Topic.Length);

            for (var i = 0; i < Topic.Length; i++)
            {
                writer.Write(Topic[i]);
            }

            Yes.Tidy();
            writer.Write(Yes);

            No.Tidy();
            writer.Write(No);
        }
Exemplo n.º 12
0
 private void textBox_PreviewKeyDown(object sender, KeyEventArgs e)
 {
     if ((e.Key == Key.B) && (YesBind != null))
     {
         YesBind.Invoke(this, new EventArgs());
     }
     else if ((e.Key == Key.Y) && (Yes != null))
     {
         Yes.Invoke(this, new EventArgs());
     }
     else if (((e.Key == Key.N) || (e.Key == Key.Enter) || (e.Key == Key.Space)) && (No != null))
     {
         No.Invoke(this, new EventArgs());
     }
     else if ((e.Key == Key.Escape) && (Cancel != null))
     {
         Cancel.Invoke(this, new EventArgs());
     }
     e.Handled = true;
 }
Exemplo n.º 13
0
 internal Guess dialog()
 {
     if (askQuestion("May be, " + Question + " (y/n) ? "))
     {
         if (Yes == null)
         {
             Console.WriteLine("It was very simple question for me...");
         }
         else
         {
             Guess clarify = Yes.dialog();
             if (clarify != null)
             {
                 Yes = clarify;
             }
         }
     }
     else
     {
         if (No == null)
         {
             if (Yes == null)
             {
                 return(whoIsIt(Database, this));
             }
             else
             {
                 No = whoIsIt(Database, null);
             }
         }
         else
         {
             Guess clarify = No.dialog();
             if (clarify != null)
             {
                 No = clarify;
             }
         }
     }
     return(null);
 }
Exemplo n.º 14
0
        public AdventureCommandRegistry(IReadonlyAdventureGame game)
        {
            var lookCommand      = new Look(game, "look", "l");
            var helpCommand      = new Help(game, "help");
            var moveCommand      = new Move(game, "move", "go", "walk", "run", "climb", "crawl", "head");
            var takeCommand      = new Take(game, "take", "get", "grab");
            var dropCommand      = new Drop(game, "drop", "discard");
            var magicWord1       = new Xyzzy(game, "xyzzy");
            var magicWord2       = new Plugh(game, "plugh");
            var inventoryCommand = new Carrying(game, "inventory", "inv");
            var interactCommand  = new Interact(game, "use"); // Do not add aliases for this command
            var yes    = new Yes(game, "yes", "y");
            var no     = new No(game, "no", "n");
            var say    = new Say(game, "say");
            var back   = new Back(game, "back", "retreat");
            var give   = new Give(game, "give");
            var attack = new Attack(game, "attack", "assault", "kill", "murder", "slay");

            // ToDo: Remove this as its for TESTING ONLY
            var teleport = new Teleport(game, "teleport");

            RegisteredCommands = new List <IAdventureCommand> {
                lookCommand,
                helpCommand,
                moveCommand,
                takeCommand,
                dropCommand,
                magicWord1,
                magicWord2,
                inventoryCommand,
                interactCommand,
                yes,
                no,
                say,
                back,
                teleport,
                give,
                attack,
            };
        }
Exemplo n.º 15
0
 public bool HasVoted(Mobile from)
 {
     return(Yes.Contains(from) || No.Contains(from));
 }
Exemplo n.º 16
0
 public void ClearVotes()
 {
     Yes.Clear();
     No.Clear();
 }
Exemplo n.º 17
0
 public bool HasVoted(Mobile from) => Yes.Contains(from) || No.Contains(from);
Exemplo n.º 18
0
        public override bool FillStringValue()
        {
            var attributeTypeId = string.Empty;
            var attributeValue  = string.Empty;

            if (Entity.SiteEventAttributeId == Guid.Empty)
            {
                return(true);
            }
            ;
            var esqResult = new EntitySchemaQuery(UserConnection.EntitySchemaManager, "SiteEventAttribute");

            esqResult.AddColumn("Type");
            var attributeEntity = esqResult.GetEntity(UserConnection, Entity.SiteEventAttributeId);

            attributeTypeId = attributeEntity.GetTypedColumnValue <string>("TypeId");

            // if not string value
            if (attributeTypeId != "e9da1be2-b0b9-478f-8290-b84a0091ec81")
            {
                Entity.SetColumnValue("StringValue", string.Empty);
            }
            ;

            switch (attributeTypeId)
            {
            // string type
            case ("e9da1be2-b0b9-478f-8290-b84a0091ec81"):
                Entity.SetColumnValue("IntValue", 0);
                Entity.SetColumnValue("FloatValue", 0.0);
                Entity.SetColumnValue("BooleanValue", false);
                Entity.SetColumnValue("ListItemValueId", null);
                Entity.SetColumnValue("ProductValueId", null);
                Entity.SetColumnValue("ProductTypeValueId", null);
                Entity.SetColumnValue("ProductCategoryValueId", null);
                Entity.SetColumnValue("ProductTradeMarkValueId", null);
                return(true);

            // int type
            case ("30dc6786-9179-4e6c-9e09-3c00b98bd3ef"):
                attributeValue = Entity.GetTypedColumnValue <string>("IntValue");
                Entity.SetColumnValue("FloatValue", 0.0);
                Entity.SetColumnValue("BooleanValue", false);
                Entity.SetColumnValue("ListItemValueId", null);
                Entity.SetColumnValue("ProductValueId", null);
                Entity.SetColumnValue("ProductTypeValueId", null);
                Entity.SetColumnValue("ProductCategoryValueId", null);
                Entity.SetColumnValue("ProductTradeMarkValueId", null);
                break;

            // float type
            case ("21b7b386-0ce4-48d3-9b4d-6616407dedb0"):
                attributeValue = Entity.GetTypedColumnValue <string>("FloatValue");
                Entity.SetColumnValue("IntValue", 0);
                Entity.SetColumnValue("BooleanValue", false);
                Entity.SetColumnValue("ListItemValueId", null);
                Entity.SetColumnValue("ProductValueId", null);
                Entity.SetColumnValue("ProductTypeValueId", null);
                Entity.SetColumnValue("ProductCategoryValueId", null);
                Entity.SetColumnValue("ProductTradeMarkValueId", null);
                break;

            // boolean type
            case ("5762dce0-54fd-4da5-859d-323003b8a9e2"):
                if (Entity.GetTypedColumnValue <bool>("BooleanValue"))
                {
                    attributeValue = Yes.ToString();
                }
                else
                {
                    attributeValue = No.ToString();
                }
                Entity.SetColumnValue("FloatValue", 0.0);
                Entity.SetColumnValue("IntValue", 0);
                Entity.SetColumnValue("ListItemValueId", null);
                Entity.SetColumnValue("ProductValueId", null);
                Entity.SetColumnValue("ProductTypeValueId", null);
                Entity.SetColumnValue("ProductCategoryValueId", null);
                Entity.SetColumnValue("ProductTradeMarkValueId", null);
                break;

            // list item value
            case ("23332960-c76a-4c53-a4e6-f0447b8d0018"):
                Entity.SetColumnValue("IntValue", 0);
                Entity.SetColumnValue("FloatValue", 0.0);
                Entity.SetColumnValue("BooleanValue", false);
                Entity.SetColumnValue("ProductValueId", null);
                Entity.SetColumnValue("ProductTypeValueId", null);
                Entity.SetColumnValue("ProductCategoryValueId", null);
                Entity.SetColumnValue("ProductTradeMarkValueId", null);
                attributeValue = GetColumnDisplayValue("SiteEventAttrListItem", Entity.ListItemValueId);
                break;

            // product item value
            case ("28979594-4b11-4bd8-86d2-f2252f508edd"):
                Entity.SetColumnValue("BooleanValue", false);
                Entity.SetColumnValue("FloatValue", 0.0);
                Entity.SetColumnValue("IntValue", 0);
                Entity.SetColumnValue("ListItemValueId", null);
                Entity.SetColumnValue("ProductTypeValueId", null);
                Entity.SetColumnValue("ProductCategoryValueId", null);
                Entity.SetColumnValue("ProductTradeMarkValueId", null);
                attributeValue = GetColumnDisplayValue("Product", Entity.ProductValueId);
                break;

            // product trademark item value
            case ("5262af16-0914-4f73-a1e9-20cbebd766f9"):
                Entity.SetColumnValue("BooleanValue", false);
                Entity.SetColumnValue("FloatValue", 0.0);
                Entity.SetColumnValue("IntValue", 0);
                Entity.SetColumnValue("ListItemValueId", null);
                Entity.SetColumnValue("ProductTypeValueId", null);
                Entity.SetColumnValue("ProductTradeMarkValueId", null);
                attributeValue = GetColumnDisplayValue("ProductCategory", Entity.ProductCategoryValueId);
                break;

            // product type item value
            case ("e29b09bb-0f52-4eb4-847d-3b6235f5424a"):
                Entity.SetColumnValue("BooleanValue", false);
                Entity.SetColumnValue("FloatValue", 0.0);
                Entity.SetColumnValue("IntValue", 0);
                Entity.SetColumnValue("ListItemValueId", null);
                Entity.SetColumnValue("ProductCategoryValueId", null);
                Entity.SetColumnValue("ProductTradeMarkValueId", null);
                attributeValue = GetColumnDisplayValue("ProductType", Entity.ProductTypeValueId);
                break;

            // product trademark item value
            case ("71fae7e0-2a9c-4aea-9a87-e23eee66b01d"):
                Entity.SetColumnValue("BooleanValue", false);
                Entity.SetColumnValue("FloatValue", 0.0);
                Entity.SetColumnValue("IntValue", 0);
                Entity.SetColumnValue("ListItemValueId", null);
                Entity.SetColumnValue("ProductTypeValueId", null);
                Entity.SetColumnValue("ProductCategoryValueId", null);
                attributeValue = GetColumnDisplayValue("TradeMark", Entity.ProductTradeMarkValueId);
                break;

            default: return(true);
            }
            ;
            Entity.SetColumnValue("StringValue", attributeValue);
            return(true);
        }
Exemplo n.º 19
0
 /// <summary>
 ///     Handles a change in PlayerKeyState.
 /// </summary>
 /// <param name="sender">Sender of the event.</param>
 /// <param name="e">Object containing information about the event.</param>
 public void Handle(object sender, KeyStateChangedEventArgs e)
 {
     if (Action != null && _check(e, Keys.Action))
     {
         Action.Handle(sender, e);
     }
     if (Crouch != null && _check(e, Keys.Crouch))
     {
         Crouch.Handle(sender, e);
     }
     if (Fire != null && _check(e, Keys.Fire))
     {
         Fire.Handle(sender, e);
     }
     if (Sprint != null && _check(e, Keys.Sprint))
     {
         Sprint.Handle(sender, e);
     }
     if (SecondaryAttack != null && _check(e, Keys.SecondaryAttack))
     {
         SecondaryAttack.Handle(sender, e);
     }
     if (Jump != null && _check(e, Keys.Jump))
     {
         Jump.Handle(sender, e);
     }
     if (LookRight != null && _check(e, Keys.LookRight))
     {
         LookRight.Handle(sender, e);
     }
     if (Handbrake != null && _check(e, Keys.Handbrake))
     {
         Handbrake.Handle(sender, e);
     }
     if (Aim != null && _check(e, Keys.Aim))
     {
         Aim.Handle(sender, e);
     }
     if (LookLeft != null && _check(e, Keys.LookLeft))
     {
         LookLeft.Handle(sender, e);
     }
     if (Submission != null && _check(e, Keys.Submission))
     {
         Submission.Handle(sender, e);
     }
     if (Walk != null && _check(e, Keys.Walk))
     {
         Walk.Handle(sender, e);
     }
     if (AnalogUp != null && _check(e, Keys.AnalogUp))
     {
         AnalogUp.Handle(sender, e);
     }
     if (AnalogDown != null && _check(e, Keys.AnalogDown))
     {
         AnalogDown.Handle(sender, e);
     }
     if (AnalogLeft != null && _check(e, Keys.AnalogLeft))
     {
         AnalogLeft.Handle(sender, e);
     }
     if (AnalogRight != null && _check(e, Keys.AnalogRight))
     {
         AnalogRight.Handle(sender, e);
     }
     if (Yes != null && _check(e, Keys.Yes))
     {
         Yes.Handle(sender, e);
     }
     if (No != null && _check(e, Keys.No))
     {
         No.Handle(sender, e);
     }
     if (CtrlBack != null && _check(e, Keys.CtrlBack))
     {
         CtrlBack.Handle(sender, e);
     }
 }
Exemplo n.º 20
0
 void onOkButtonClick(object sender, EventArgs e)
 {
     Yes.Raise(this, null);
     close();
 }
Exemplo n.º 21
0
        // Update is called once per frame
        void Update()
        {
            Okay.GetComponent <Button> ().onClick.AddListener(delegate {
                if (click)
                {
                    BlackFadeU.gameObject.SetActive(true);
                    Confirm.gameObject.SetActive(true);
                    Yes.gameObject.SetActive(true);
                    No.gameObject.SetActive(true);
                }
            });

            Yes.GetComponent <Button> ().onClick.AddListener(delegate {
                if (click)
                {
                    BlackFadeU.gameObject.SetActive(false);
                    BlackFade.gameObject.SetActive(true);
                    Success.gameObject.SetActive(true);
                    Confirm.gameObject.SetActive(false);
                    Yes.gameObject.SetActive(false);
                    No.gameObject.SetActive(false);

                    B1.gameObject.SetActive(false);
                    B2.gameObject.SetActive(false);
                    B3.gameObject.SetActive(false);
                    B4.gameObject.SetActive(false);
                    B5.gameObject.SetActive(false);
                    B6.gameObject.SetActive(false);
                    I1.gameObject.SetActive(false);
                    I2.gameObject.SetActive(false);
                    I3.gameObject.SetActive(false);
                    S1.gameObject.SetActive(false);
                    S2.gameObject.SetActive(false);
                    S3.gameObject.SetActive(false);

                    PlayerPrefs.DeleteKey("Badge1");
                    PlayerPrefs.DeleteKey("Badge2");
                    PlayerPrefs.DeleteKey("Badge3");
                    PlayerPrefs.DeleteKey("Badge4");
                    PlayerPrefs.DeleteKey("Badge5");
                    PlayerPrefs.DeleteKey("Badge6");

                    PlayerPrefs.DeleteKey("ID1");
                    PlayerPrefs.DeleteKey("ID2");
                    PlayerPrefs.DeleteKey("ID3");

                    PlayerPrefs.DeleteKey("Secret1");
                    PlayerPrefs.DeleteKey("Secret2");
                    PlayerPrefs.DeleteKey("Secret3");
                }
            });

            No.GetComponent <Button> ().onClick.AddListener(delegate {
                if (click)
                {
                    BlackFadeU.gameObject.SetActive(false);
                    BlackFade.gameObject.SetActive(false);
                    Confirm.gameObject.SetActive(false);
                    Yes.gameObject.SetActive(false);
                    No.gameObject.SetActive(false);
                }
            });

            BlackFade.GetComponent <Button> ().onClick.AddListener(delegate {
                if (click)
                {
                    BlackFadeU.gameObject.SetActive(false);
                    BlackFade.gameObject.SetActive(false);
                    Success.gameObject.SetActive(false);
                }
            });
        }
        public void DeleteManageListing()
        {
            //Click on Managelisting Link

            manageListingsLink.Click();
            GlobalDefinitions.wait(30);
            String DelStatus = "False";
            int    i;

            //Itertaing Through The table


            try
            {
                while (DelStatus == "False")
                {
                    for (i = 1; i <= 5; i++)
                    {
                        //Get the Text of CATEGORY
                        var CtgryTxt = GlobalDefinitions.driver.FindElement(By.XPath("/html/body/div/div/div/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[2]")).Text;

                        //Get the  Text of TITLE
                        var TitleTxt = GlobalDefinitions.driver.FindElement(By.XPath("/html/body/div/div/div/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[3]")).Text;

                        //Get The Text of DESCRIPTION
                        var DscrptnTxt = GlobalDefinitions.driver.FindElement(By.XPath("/html/body/div/div/div/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[4]")).Text;

                        //Get the Text of SERVICE TYPE
                        var SrvcType = GlobalDefinitions.driver.FindElement(By.XPath("/html/body/div/div/div/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[5]")).Text;

                        //Assert.AreEqual(CtgryTxt, "Programming & Tech");
                        //Assert.AreEqual(TitleTxt, "Software Tester");
                        //Assert.AreEqual(DscrptnTxt, "Api , Selenium C Tester");
                        //Assert.AreEqual(SrvcType, "Hourly");

                        if (CtgryTxt == "Programming & Tech" && TitleTxt == "Software Tester" && DscrptnTxt == "Api , Selenium C Tester" && SrvcType == "Hourly")
                        {
                            //Identify Delete CROSS SIGN
                            IWebElement Delete = GlobalDefinitions.driver.FindElement(By.XPath("/html/body/div/div/div/div[2]/div[1]/div[1]/table/tbody/tr[" + i + "]/td[8]/div/button[3]/i"));

                            //Click On delete
                            Delete.Click();

                            //Click on Yes
                            Yes.Click();
                            DelStatus = "True";
                            break;
                        }
                    }

                    if (DelStatus == "False")
                    {
                        i = 0;
                        //Click on Next Page
                        NextPage.Click();
                    }
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Exemplo n.º 23
0
        public void DeleteDetails()
        {
            bool ServiceMatchFound = false;

            try
            {
                //Get the list of rows in the table for the last Page
                IList <IWebElement> ListingRows = ManageListingsTable.FindElements(By.TagName("tr"));

                //If there is a single service listed
                if (ListingRows.Count == 2)
                {
                    if (driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[position()=1]/td[3]")).Text == TitleDelete)
                    {
                        ServiceMatchFound = true;
                        DeleteDetailsIcon.Click();
                    }
                    else
                    {
                        TestContext.WriteLine("The service to be deleted is not present in the Manage listings");
                    }
                }

                //If there are more than a service listed
                else
                {
                    //Check for the services to be edited based on the title
                    for (int entry = 1; entry < ListingRows.Count; entry++)
                    {
                        if (driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[position()=" + entry + "]/td[3]")).Text == TitleDelete)
                        {
                            driver.FindElement(By.XPath("//*[@id='listing-management-section']/div[2]/div[1]/div[1]/table/tbody/tr[position()=" + entry + "]/td[8]/div/button[3]/i")).Click();
                            Thread.Sleep(500);
                            ServiceMatchFound = true;
                            break;
                        }
                    }
                    //If the services to be deleted is not present in the listings
                    if (ServiceMatchFound == false)
                    {
                        TestContext.WriteLine("The service to be deleted is not present in the Manage listings");
                    }
                }
            }
            catch (Exception e)
            {
                TestContext.WriteLine("There are no services listed in the page", e.Message);
            }

            //Proceed to delete only if the match is found
            if (ServiceMatchFound == true)
            {
                //Wait for Delete your service Text Box to be visible
                Wait.ElementIsVisible(driver, "XPath", "/html/body/div[2]/div/div[3]/button[2]");

                //Click on 'Yes' button
                Yes.Click();

                //Wait for Delete your service Text Box to be visible
                Wait.ElementIsVisible(driver, "XPath", "//div[@class='ns-box-inner']");

                //Get the text from the pop up
                String msg            = driver.FindElement(By.XPath("//div[@class='ns-box-inner']")).Text;
                String DeletePopUpMsg = $"{TitleDelete} has been deleted";

                //Check for the Pop message for delete
                Assert.That(msg, Is.EqualTo(DeletePopUpMsg));
            }
        }
Exemplo n.º 24
0
 protected void RaiseYes()
 {
     Yes.Raise((T)this);
     Close();
 }