-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathIOSApp.php
74 lines (57 loc) · 2.4 KB
/
IOSApp.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
namespace Facebook\WebDriver;
require __dir__.'/vendor/autoload.php';
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Facebook\WebDriver\WebDriverBy;
use Facebook\WebDriver\WebDriverWait;
use Facebook\WebDriver\WebDriverExpectedCondition;
$caps = array(
"app"=>"lt://proverbial-ios", // Enter app_url here
"deviceName"=>"iPhone 11",
"platformName"=>"ios",
"isRealMobile"=>true,
"video"=>true,
"visual"=>true,
"queueTimeout"=>"300",
"name"=>"Php - iOS test",
"build" => "Php Vanilla - iOS"
);
$username = getenv("LT_USERNAME") ? getenv("LT_USERNAME") : "USERNAME"; //Enter username here
$accesskey = getenv("LT_ACCESS_KEY") ? getenv("LT_ACCESS_KEY") : "ACCESS_KEY"; //Enter accesskey here
@$driver = RemoteWebDriver::create("https://$username:[email protected]/wd/hub",$caps,3600000,3600000);
try{
$wait = new WebDriverWait($driver, 120);
$wait->until(WebDriverExpectedCondition::visibilityOfElementLocated(WebDriverBy::id('color')));
$color_element = $driver->findElement(WebDriverBy::id('color'));
$color_element->click();
$text_element = $driver->findElement(WebDriverBy::id('Text'));
$text_element->click();
$toast_element = $driver->findElement(WebDriverBy::id('toast'));
$toast_element->click();
$notification_element = $driver->findElement(WebDriverBy::id('notification'));
$notification_element->click();
sleep(2);
$wait->until(WebDriverExpectedCondition::visibilityOfElementLocated(WebDriverBy::id('geoLocation')));
$geolocation_element = $driver->findElement(WebDriverBy::id('geoLocation'));
$geolocation_element->click();
sleep(5);
$home_element = $driver->findElement(WebDriverBy::id('Back'));
$home_element->click();
$speedtest_element = $driver->findElement(WebDriverBy::id('speedTest'));
$speedtest_element->click();
sleep(5);
$home_element = $driver->findElement(WebDriverBy::id('Back'));
$home_element->click();
$browser_element = $driver->findElement(WebDriverBy::id('Browser'));
$browser_element->click();
$url_element = $driver->findElement(WebDriverBy::id('url'));
$url_element->sendKeys("https://www.lambdatest.com");
$find_element = $driver->findElement(WebDriverBy::id('find'));
$find_element->click();
sleep(2);
$driver->quit();
} finally {
$driver->quit();
}
?>