public void Select(MethodContext ctxt, string selector) { var elements = new ElementsQuery(browser); ctxt.Elements(elements); elements.AddSelect(selector); }
public void WithText(MethodContext ctxt, string text) { var elements = ctxt.Elements(); if (elements is null) { throw new InvalidOperationException(); } elements.AddWithText(text); }
public void Visible(MethodContext ctxt) { var elements = ctxt.Elements(); if (elements is null) { throw new InvalidOperationException(); } elements.AddVisible(); }
public void WithAttribute(MethodContext ctxt, string attributeName, string attributeValue) { var elements = ctxt.Elements(); if (elements is null) { throw new InvalidOperationException(); } elements.AddWithAttribute(attributeName, attributeValue); }
public void AssertExists(MethodContext ctxt) { var elements = ctxt.Elements(); if (elements is null) { throw new InvalidOperationException(); } if (!elements.Any()) { throw new AssertionException("Elements not found."); } }
public void Click(MethodContext ctxt) { var elements = ctxt.Elements(); if (elements is null) { throw new InvalidOperationException(); } var first = elements.FirstOrDefault(); if (first is null) { throw new AssertionException("No elements selected to click."); } first.Click(); }
public void GetInnerText(MethodContext ctxt) { var elements = ctxt.Elements(); if (elements is null) { throw new InvalidOperationException(); } var first = elements.FirstOrDefault(); if (first is null) { throw new AssertionException("No elements selected to get content from."); } ctxt.ChainValue = first.GetProperty("innerText"); }
public void Type(MethodContext ctxt, string text) { var elements = ctxt.Elements(); if (elements is null) { throw new InvalidOperationException(); } var first = elements.FirstOrDefault(); if (first is null) { throw new AssertionException("No element available to type into."); } first.SendKeys(text); }