diff --git a/Aquality.Selenium.Core/src/Aquality.Selenium.Core/Aquality.Selenium.Core.csproj b/Aquality.Selenium.Core/src/Aquality.Selenium.Core/Aquality.Selenium.Core.csproj index d573712..92e85c5 100644 --- a/Aquality.Selenium.Core/src/Aquality.Selenium.Core/Aquality.Selenium.Core.csproj +++ b/Aquality.Selenium.Core/src/Aquality.Selenium.Core/Aquality.Selenium.Core.csproj @@ -18,6 +18,11 @@ true + + Aquality.Selenium.Core.xml + 1701;1702;1591 + + diff --git a/Aquality.Selenium.Core/src/Aquality.Selenium.Core/Aquality.Selenium.Core.xml b/Aquality.Selenium.Core/src/Aquality.Selenium.Core/Aquality.Selenium.Core.xml new file mode 100644 index 0000000..d20b1d4 --- /dev/null +++ b/Aquality.Selenium.Core/src/Aquality.Selenium.Core/Aquality.Selenium.Core.xml @@ -0,0 +1,719 @@ + + + + Aquality.Selenium.Core + + + + + Interface of any application controlled by Selenium WebDriver API + + + + + Current instance of driver + + + + + Sets implicit wait timeout to browser. + Method was extracted with purpose not to pass it to Driver if it is similar to previous value. + Simpliest implementation is: Driver.Manage().Timeouts().ImplicitlyWait = timeout + + timeout to set + + + + Allows to resolve dependencies for all services in the Aquality.Selenium.Core library + + + + + Used to configure dependencies for services of the current library + + Collection of service descriptors + function that provides an instance of + with settings for configuration of dependencies. + Pass the result of if you need to get settings from the embedded resource of your project. + + + + Provides a with settings. + If "profile" environment variable is defined, it will be used in the name : $"settings.{profile}.json"; + Otherwise, will use default name of settings file: "settings.json". + Will look for the resource file (copied to binaries/Resources/ folder); + If not found, will look for embedded resource in the calling assembly of this method + + An instance of settings JsonFile + + + + Describes logger configuration. + + + + + Gets language of framework. + + Supported language. + + + + Describes retry configuration. + + + + + Gets the number of attempts during retry. + + Number of retry attempts. + + + + Gets the polling interval used in retry. + + Polling interval for retry. + + + + Describes timeouts configuration. + + + + + Gets WedDriver ImplicitWait timeout. + + + + + Gets default ConditionalWait timeout. + + + + + Gets ConditionalWait polling interfal. + + + + + Gets Command timeout. + + + + + Provides logger configuration + + + + + Instantiates class using JSON file with general settings. + + JSON settings file. + + + + Provides retry configuration. + + + + + Instantiates class using JSON file with general settings. + + JSON settings file. + + + + Provides timeouts configuration. + + + + + Instantiates class using JSON file with general settings. + + JSON settings file. + + + + Defines desired state for element with ability to handle exceptions + + + + + Defines base class for any UI element. + + + + + Factory that creates elements. + + + + + Gets map between elements interfaces and their implementations. + Can be extended for custom elements with custom interfaces. + + Dictionary where key is interface and value is its implementation. + + + + Generates xpath locator for target element + + locator of parent element + target element + index of target element + target element's locator + + + + Resolves element supplier or return itself if it is not null + + type of target element + target element supplier + non-null element supplier + + + + Implementation of + + + + + Possible count of elements. + + + + + Possible states of element. + + + + + Delegate that defines constructor of element. + + Type of element that has to implement IElement interface + Element locator + Element name + Element state + Element instance of type T + + + + Describes behavior of any UI element. + + + + + Unique locator of element. + + Instance of + + + + Unique name of element. + + String representation of element name. + + + + Gets element state. + + Instance of + + + + Finds current element by specified + + Timeout to find element. Default: + Instance of if found. + Thrown when no elements found. + + + + Gets element text. + + + + + Gets element attribute value by its name. + + Name of attrbiute + Value of element attribute. + + + + Sends keys to element. + + Key to send. + + + + Clicks the element. + + + + + Defines the interface used to create the elements. + + + + + Create custom element according to passed parameters + + Type of the target element + Delegate that defines constructor of element + Locator of the target element + Name of the target element + State of the target element + Instance of custom element + + + + Finds child element by its locator relative to parent element. + + Type of child element that has to implement IElement + Parent element + Locator of child element relative to its parent + Delegate that defines constructor of element in case of custom element + Child element state + Thrown when the supplier is null, and no constructor with required arguments was found. + Instance of child element + + + + Finds list of elements by base locator. + + Type of elements that have to implement IElement + Base elements locator + Delegate that defines constructor of element in case of custom elements + Expected number of elements that have to be found (zero ot more then zero) + Elements state + Thrown when the supplier is null, and no constructor with required arguments was found. + List of elements that found by locator + + + + Provides ability to find elements in desired ElementState. + + + + + Finds element in desired ElementState. + + element locator + desired ElementState + timeout for search + Thrown if element was not found in time in desired state + Found element + + + + Finds element in state defined by predicate. + + elements locator + predicate to define element state + timeout for search + Thrown if element was not found in time in desired state + Found element + + + + Finds elements in desired ElementState. + + elements locator + desired ElementState + timeout for search + List of found elements + + + + Finds elements in state defined by predicate. + + elements locator + predicate to define elements state + timeout for search + List of found elements + + + + Finds elements in state defined by desired state. + + elements locator + desired elements state + timeout for search + List of found elements + + + + Provides ability to define element's state (whether it is displayed, exist or not). + Also provides respective positive and negative waiting methods. + + + + + Gets element's displayed state: true if displayed and false otherwise. + + + + + Gets element's exist state: true if element exists in DOM (without visibility check) and false otherwise. + + + + + Gets element's clickable state, which means element is displayed and enabled: true if element is clickable, false otherwise. + + + + + Gets element's Enabled state, which means element is Enabled and does not have "disabled" class: true if enabled, false otherwise. + + Throws when element not found. + + + + Waits for element is displayed on the page. + + Timeout for waiting. Default: + true if element displayed after waiting, false otherwise + + + + Waits for element is not displayed on the page. + + Timeout for waiting. Default: + true if element does not display after waiting, false otherwise + + + + Waits for element exists in DOM (without visibility check). + + Timeout for waiting. Default: + true if element exist after waiting, false otherwise + + + + Waits for element does not exist in DOM (without visibility check). + + Timeout for waiting. Default: + true if element does not exist after waiting, false otherwise + + + + Waits for element is enabled state which means element is Enabled and does not have "disabled" class. + + Timeout to get state. Default: + True if enabled, false otherwise. + Throws when timeout exceeded and element not found. + + + + Waits for element is not enabled state which means element is not Enabled or does have "disabled" class. + + Timeout to get state. Default: + True if not enabled, false otherwise. + Throws when timeout exceeded and element not found. + + + + Waits for element to become clickable which means element is displayed and enabled. + + Timeout for wait. Default: + Throws when timeout exceeded and element is not clickable. + + + + Defines behavior of element with child elements. + + + + + Finds child element of current element by its locator. + + Type of child element that has to implement IElement + Locator of child element. + Delegate that defines constructor of child element in case of custom element + Child element state + Instance of child element + + + + Log messages to different languages + + + + + This class is using for translation messages to different languages + + + + + Get localized message from resources by its key. + + Key in resource file. + Arguments, which will be provided to template of localized message. + Localized message. + + + + This class is using for a creating extended log. It implements a Singleton pattern. + + + + + Gets Logger instance. + + + + + Adds configuration (target). + + Target configuration to add. + Logger instance. + + + + Removes configuration (target). + + Target configuratio to remove. + Logger instance. + + + + Log debug message and optional exception. + + Message + Exception + + + + Log info message. + + Message + + + + Log warning message. + + Message + + + + Log error message. + + Message + + + + Log fatal message and exception. + + Message + Exception + + + + Retries an action or function when or occures. + + + + + Instantiates the class using retry configuration. + + + + + + Retries the action when or occures. + + Action to be applied. + + + + Retries the function when or occures. + + Return type of function. + Function to be applied. + Result of the function + + + + Simplifies converting values to enum + + + + + Converts object to enum. + If the object is int - casts it to enum directly; + Otherwise, calls and then + + Target enum type + Value to convert + Converted enum value + + + + Converts object to enum. + Asserts via that . + Then calls against passed values + + Target enum type + Value to convert + Converted enum value + + + + Environment variables reader. + + + + + Gets value of environment variable by key. + + Environment variable key. + Value of environment variable. + + + + Utility methods to read files. + + + + + Gets text from embedded resource file. + + Embedded resource path. + Assembly which resource belongs to. + Text of the file. + + + + Gets text from the file in the Resources folder (should be copied to output directory). + + Name of the resource file. + Text of the file. + + + + Checks whether file exists in Resources folder or not. + + Name of resource file. + True if exists and false otherwise + + + + Gets text from the file. + + Required file info. + Text of the file. + + + + Provides methods to get info from JSON files. + Note that the value can be overriden via Environment variable with the same name + (e.g. for json path ".timeouts.timeoutScript" you can set environment variable "timeouts.timeoutScript" + + + + + Inistantiates class using desired JSON fileinfo. + + JSON fileinfo. + + + + Inistantiates class using desired resource file info. + + + + + + Inistantiates class using desired embeded resource. + + Embeded resource name + Assembly which resource belongs to + + + + Gets value from JSON. + Note that the value can be overriden via Environment variable with the same name + (e.g. for json path ".timeouts.timeoutScript" you can set environment variable "timeouts.timeoutScript") + + Relative JsonPath to the value. + Type of the value. + Value from JSON/Environment by JsonPath. + Throws when there is no value found by jsonPath in desired JSON file. + + + + Gets list of values from JSON. + Note that the value can be overriden via Environment variable with the same name; values must be separated by ',' + (e.g. for json path ".driverSettings.chrome.startArguments" you can set environment variable "driverSettings.chrome.startArguments") + + Relative JsonPath to the values. + Type of the value. + Value from JSON/Environment by JsonPath. + Throws when there are no values found by jsonPath in desired JSON file. + + + + Gets dictionary of values from JSON. + Note that the value can be overriden via Environment variable with the same name; + (e.g. for json path ".timeouts.timeoutImplicit" you can set environment variable ".timeouts.timeoutImplicit") + + Relative JsonPath to the values. + Type of the value. + Value from JSON/Environment by JsonPath. + Throws when there are no values found by jsonPath in desired JSON file. + + + + Checks whether value present on JSON/Environment by JsonPath or not. + + Relative JsonPath to the object. + True if present and false otherwise. + + + + This class is using for waiting any conditions. + + + + + Instantiates the class using retry configuration. + + + + + + + Wait for some object from condition with timeout using Selenium WebDriver. + + Type of object which is waiting for + Function for waiting + Condition timeout. Default value is + Condition check interval. Default value is + Part of error message in case of Timeout exception + Possible exceptions that have to be ignored. Handles by default. + Condition result which is waiting for. + Throws when timeout exceeded and condition not satisfied. + + + + Wait for some condition within timeout. + + Predicate for waiting + Condition timeout. Default value is + Condition check interval. Default value is + True if condition satisfied and false otherwise. + + + + Wait for some condition within timeout. + + Predicate for waiting + Condition timeout. Default value is + Condition check interval. Default value is + Part of error message in case of Timeout exception + Throws when timeout exceeded and condition not satisfied. + + + diff --git a/Aquality.Selenium.Core/src/Aquality.Selenium.Core/Waitings/ConditionalWait.cs b/Aquality.Selenium.Core/src/Aquality.Selenium.Core/Waitings/ConditionalWait.cs index 9d1e957..4533ad2 100644 --- a/Aquality.Selenium.Core/src/Aquality.Selenium.Core/Waitings/ConditionalWait.cs +++ b/Aquality.Selenium.Core/src/Aquality.Selenium.Core/Waitings/ConditionalWait.cs @@ -21,8 +21,9 @@ public class ConditionalWait /// /// Instantiates the class using retry configuration. - /// - /// + /// + /// + /// public ConditionalWait(ITimeoutConfiguration timeoutConfiguration, IServiceProvider serviceProvider) { this.timeoutConfiguration = timeoutConfiguration;