title: Selenium Waits Logic
body: <p>I am building a testing framework for my website
  I want to fully separate the framework away from test
  the issue is when I write a test sometimes the Assert needs time until it can be true, for example if I am on Upload file page and when the file is uploaded the website should display File uploaded successfully page but it will need to much time until the browser reaches this page</p>
  
  <p>How should I force the Assert to wait sometime before it returns result?</p>
  
  <p>some code that might explain my current way of work:</p>
  
  <p>Upload Page Class</p>
  
  <pre><code>Public class UploadPage
  {
   [FindsBy(How = How.Name, Using = "upload-button")]
   public IWebElement BtnUpload { get; set; }
  
    public UploadPage()
    {
     PageFactory.InitElements(Driver, this);
    }
  
   public void UploadFile(string path)
    {
      //select file
      BtnUpload.Click();
    }
  }
  </code></pre>
  
  <p>Successful Upload Page:</p>
  
  <pre><code> Public class UploadSuccessfulPage
     {
       [FindsBy(How = How.Name, Using = "success-message")]
       public IWebElement LblSuccessMessage{ get; set; }
  
       public UploadSuccessfulPage()
       {
         PageFactory.InitElements(Driver, this);
       }
       public bool IsAt()
       {
        Driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(60))
        return Driver.url==configurations.UploadSuccessfulPageURL;
       }
     } 
  </code></pre>
  
  <p>Test Method:</p>
  
  <pre><code>public void TestUpload()
  {
   UploadPage uploadPage= new UploadPage ();
   uploadPage.UploadFile(path);
   UploadSuccessfulPage successPage= new UploadSuccessfulPage();
   Assert.IsTrue(successPage.IsAt());
  }
  </code></pre>
  
  <p>when I write my tests this way the assert do not wait despite that IsAt() contains implicit wait</p>
  
  <p>P.S: I am not intending to use Thread.Sleep();</p>