I have an automated Appium test for a UWP Windows application. When a button is clicked it will fire an API call and then display something once the call has completed. Depending on how fast my test runs and the speed of the network call, immediately after clicking the button, I will be in one of two states:
- A progress spinner will be visible
- The progress spinner will not be visible (may have been and gone) and the result will be displayed.
I have written verbose code that checks for each of these conditions sequentially, however, it would nicer to combine it into one wait, that checks for either condition. It seems other language bindings have a way to combine expressions with an or (e.g. this answer for Java).
var wait = new WebDriverWait(_session.Driver, TimeSpan.FromSeconds(10));
// would like to combine the following conditions
wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.InvisibilityOfElementLocated(By.XPath("some Xpath"))));
wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementIsVisible(By.XPath("some other Xpath")));