public void DownloadImageFromInvalidUrl(bool shouldPressKeyboardReturnButton) { //Arrange //Act LoadImagePage.EnterUrl(LoadImagePage.InvalidUrl); //Assert Assert.AreEqual(LoadImageButtonTextConstants.DownloadImageFromUrlButtonText, LoadImagePage.LoadImageButtonText); //Act if (shouldPressKeyboardReturnButton) { LoadImagePage.TapKeyboardEnterButton(); } else { LoadImagePage.TapLoadImageButton(); } LoadImagePage.WaitForNoIsDownloadingActivityIndicator(); LoadImagePage.TapOkOnErrorPrompt(); //Assert Assert.IsFalse(LoadImagePage.IsDownloadedImageShown); Assert.AreEqual(LoadImageButtonTextConstants.DownloadImageFromUrlButtonText, LoadImagePage.LoadImageButtonText); }
public async Task DownloadImageFromInvalidUrl(bool shouldPressKeyboardReturnButton) { //Arrange //Act LoadImagePage.EnterUrl(LoadImagePage.InvalidUrl); //Assert Assert.AreEqual(LoadImageButtonTextConstants.DownloadImageFromUrlButtonText, LoadImagePage.LoadImageButtonText); //Act switch (shouldPressKeyboardReturnButton) { case true: LoadImagePage.TapKeyboardEnterButton(); break; case false: LoadImagePage.TapLoadImageButton(); break; } await LoadImagePage.WaitForNoIsDownloadingActivityIndicator(); LoadImagePage.TapOkOnErrorPrompt(); //Assert Assert.IsFalse(LoadImagePage.IsDownloadedImageShown); Assert.AreEqual(LoadImageButtonTextConstants.DownloadImageFromUrlButtonText, LoadImagePage.LoadImageButtonText); }