PHPUnit Selenium2 calling a function to create and call my Admin Login Test



  • I am testing with PHPUnit and Selenium2. I am testing the admin panel. So, I need to add Admin Login Test into all my admin panel tests.

    I want to create a new Admin Login Test with a new file and I want to call this function from all my tests. How I can create and call my Admin Login Test ?



    1. Create function AdminLogin
      1. Create into each test class method SetUp (doc)
      2. Call admin_login by SetUp

    Looks like:

    protected function setUp()
    {
        AdminLogin();
    }
    

    This method calls before each test into test class

    Good luck!



Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2