Web based apps + C# windows native apps + Banking, fintech, online classifieds + Created automation in C#, PHP, Ruby + ISTQB Foundation + ISTQB Advanced Technical Test Analyst + I love cats - fb.com/azor.cat
= $this->sinon->createUser(); $this->api = new UserProfileApi($this->accessToken); $actualUser = $this->api->getUser($expectedUser->id); PHPUnit::assertEquals($expectedUser, $actualUser); } Entity retrieved from trojan Call to tested API Assertion on entities
source class UserFactory { public function createEntityFromJson($json) { // (...) return User($data); } public function createEntityFromArray(array $user) { // (...) return User($data); } }
/** @var TextField */ private $emailField; /** @var TextField */ private $passwordField; /** @var Button */ private $submitButton; // rest of page } Each element have own type Elements are reusable
// page elements as class vars public function __construct() { parent::__construct('login'); $this->emailField = new TextField(LocatorType:: ID, 'userEmail'); $this->passwordField = new TextField(LocatorType:: ID, 'userPass'); $this->submitButton = new Button(LocatorType:: ID, 'se_userLogin'); } // perform actions with usage of elements } Clear definition
// page elements as class vars public function __construct() { // init elements in constructor } public function fillLoginPassword( $password) { $this->passwordField->getElement($this)->setValue($password); } }
@var RemoteWebElement */ protected $element; public function getElement($page) { $this->element = $this->$page->find()->elementWithId( $this->locator); } } Abstraction over webdriver native element
function setValue($value) { $this->element->sendKeys($value); } public function getValue() { return $this->element->getAttribute( 'value'); } } Abstraction over webdriver native element Webdriver native methods
posting form$/ */ public function iNavigateToPostingForm() { $adPage = (new NewAdPageFactory())->getDesktopPage(); $adPage->open(); } One call for each country