BasePage.php 729 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace tests\_pages;
  3. class BasePage
  4. {
  5. // include url of current page
  6. public static $URL = '';
  7. /**
  8. * Declare UI map for this page here. CSS or XPath allowed.
  9. * public static $usernameField = '#username';
  10. * public static $formSubmitButton = "#mainForm input[type=submit]";
  11. */
  12. /**
  13. * Basic route example for your current URL
  14. * You can append any additional parameter to URL
  15. * and use it in tests like: EditPage::route('/123-post');
  16. */
  17. public static function route($param)
  18. {
  19. return static::$URL.$param;
  20. }
  21. /**
  22. * @var
  23. */
  24. protected $guy;
  25. public function __construct($I)
  26. {
  27. $this->guy = $I;
  28. }
  29. /**
  30. * @return $this
  31. */
  32. public static function of($I)
  33. {
  34. return new static($I);
  35. }
  36. }