Skip to content

Improved conditions logging in errors and first experimental waiting hooks

Pre-release
Pre-release
Compare
Choose a tag to compare
@yashaka yashaka released this 13 May 22:49
  • improved error messsages
    • now condition in Should method will be rendered like:
      ... .Should(Be.Visible) over just ... .Visible
  • deprecated SeleneElement#config, use SeleneElement#Config instead (same for SeleneCollection)
    • yet be attentive... the fate of keeping SeleneElement#Config as public is also vague...
  • added experimental feature: Configuration._HookWaitAction
    • prefixed with underscore implies that this feature is kind of "publically available private property that might be changed/renamed/removed/etc in future;)", so use it on your own risk!!!
    • by default equals to null, making internally call waiting algorithm for actions as it is, without additional customization
    • specified to something like:
      Configuration._HookWaitAction = (entity_object, describe_computation, wait) => {
          Console.WriteLine($"STARTED WAITING FOR: {entity_object}.{describe_computation()}");
          try
          {
              wait();
              Console.WriteLine($"FINISHED WAITING FOR: {entity_object}.{describe_computation()}");
          }
          catch (Exception error)
          {
              Console.WriteLine($"FAILED WAITING FOR: {entity_object}.{describe_computation()}");
              throw error;
          }
      };
      
      • should provide some additinal logging for all Selene actions, called on entities (like SeleneElement, SeleneCollection)
      • under actions we mean "void commands" not "queries returning result".
        • void command like element.Should(condition) will return the element itself instead of void ;)