title: IOS UI Testing issue for Logout scenario
body: <p>I am facing an issue while writing UI test cases for IOS using XCTest framework.<br>
  Consider a 3 step signup process and 3 test cases for each step. And for running each test case, it requires the user to be logged out. So, I have written the code as</p>
  
  <pre><code>test1(){
      //some code here for step 1
  }
  
  test2(){
      test1()
      //some code here for step 2
  }
  
  test3(){
      test2()
      //some code here for step 3
  }
  </code></pre>
  
  <p>This works fine while running the test cases individually. But when running it collectively, the first test runs successfully but the second test fails, as it requires the registered user to logged out before running the text. 
  Now to solve this, I write the code as follows :</p>
  
  <pre><code>test1(){
      //some code here for step 1
      //logout code
  }
  
  test2(){
      test1()
      //some code here for step 2
      //logout code
  }
  
  test3(){
      test2()
      //some code here for step 3
      //logout code
  }
  </code></pre>
  
  <p>Now the issue is, while running the second test case, it calls the first function which logs out the user and we cannot reuse the code. 
  Any better way to do this?</p>