1. Go to this page and download the library: Download walterwhites/appium-module library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?phprequire_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
walterwhites / appium-module example snippets
/**
* @group register
* Tests the sign up
* @param User $params
*/publicfunctionregisterByEmail(User $params){
$this->test->clickOnButton('SIGN UP', 400);
$this->test->clickOnButton('SIGN UP WITH EMAIL', 400);
$this->test->setText('First name', $params->firstName);
$this->test->setText('Last name', $params->lastName);
$this->test->setText('Email address', $params->email);
$this->test->hideKeyboard();
sleep(2);
$this->test->touchPositionedButon(2);
sleep(2);
$this->test->touchPositionedButon(3);
$this->test->clickOnButton('SIGN UP', 300);
}
protected $locatorStrategy = ILocatorStrategy::class_chain;
protected $classChainSearch = IClassChainSearch::label;
useButton;
useTextField;
publicfunctionsetLocatorStrategy($locatorStrategy){
switch ($locatorStrategy) {
case ILocatorStrategy::class_chain:
$this->locatorStrategy = ILocatorStrategy::class_chain;
break;
case ILocatorStrategy::predicate_string:
$this->locatorStrategy = ILocatorStrategy::predicate_string;
break;
case ILocatorStrategy::accessibility_id:
$this->locatorStrategy = ILocatorStrategy::accessibility_id;
break;
}
}
publicfunctionsetClassChainSearch($classChainSearch){
switch ($classChainSearch) {
case IClassChainSearch::label:
$this->locatorStrategy = IClassChainSearch::label;
break;
case IClassChainSearch::name:
$this->locatorStrategy = IClassChainSearch::name;
break;
case IClassChainSearch::value:
$this->locatorStrategy = IClassChainSearch::value;
break;
}
}