1 | <?php |
||
11 | class PhantomJSDriver extends BasePhantomJSDriver { |
||
12 | |||
13 | use SessionTrait; |
||
14 | use NavigationTrait; |
||
15 | use CookieTrait; |
||
16 | use HeadersTrait; |
||
17 | use JavascriptTrait; |
||
18 | use MouseTrait; |
||
19 | use PageContentTrait; |
||
20 | use KeyboardTrait; |
||
21 | use FormManipulationTrait; |
||
22 | use WindowTrait; |
||
23 | |||
24 | /** |
||
25 | * Sets the basic auth user and password |
||
26 | * @param string $user |
||
27 | * @param string $password |
||
28 | */ |
||
29 | public function setBasicAuth($user, $password) { |
||
32 | |||
33 | /** |
||
34 | * Gets the tag name of a given xpath |
||
35 | * @param string $xpath |
||
36 | * @return string |
||
37 | * @throws DriverException |
||
38 | */ |
||
39 | public function getTagName($xpath) { |
||
43 | |||
44 | /** |
||
45 | * Gets the attribute value of a given element and name |
||
46 | * @param string $xpath |
||
47 | * @param string $name |
||
48 | * @return string |
||
49 | * @throws DriverException |
||
50 | */ |
||
51 | public function getAttribute($xpath, $name) { |
||
55 | |||
56 | /** |
||
57 | * Check if element given by xpath is visible or not |
||
58 | * @param string $xpath |
||
59 | * @return bool |
||
60 | * @throws DriverException |
||
61 | */ |
||
62 | public function isVisible($xpath) { |
||
66 | |||
67 | /** |
||
68 | * Drags one element to another |
||
69 | * @param string $sourceXpath |
||
70 | * @param string $destinationXpath |
||
71 | * @throws DriverException |
||
72 | */ |
||
73 | public function dragTo($sourceXpath, $destinationXpath) { |
||
78 | |||
79 | /** |
||
80 | * Upload a file to the browser |
||
81 | * @param string $xpath |
||
82 | * @param string $path |
||
83 | * @throws DriverException |
||
84 | */ |
||
85 | public function attachFile($xpath, $path) { |
||
107 | |||
108 | /** |
||
109 | * Puts the browser control inside the IFRAME |
||
110 | * You own the control, make sure to go back to the parent calling this method with null |
||
111 | * @param string $name |
||
112 | */ |
||
113 | public function switchToIFrame($name = null) { |
||
122 | |||
123 | /** |
||
124 | * Focus on an element |
||
125 | * @param string $xpath |
||
126 | * @throws DriverException |
||
127 | */ |
||
128 | public function focus($xpath) { |
||
132 | |||
133 | /** |
||
134 | * Blur on element |
||
135 | * @param string $xpath |
||
136 | * @throws DriverException |
||
137 | */ |
||
138 | public function blur($xpath) { |
||
142 | |||
143 | /** |
||
144 | * Finds elements with specified XPath query. |
||
145 | * @param string $xpath |
||
146 | * @return string[] |
||
147 | * @throws DriverException When the operation cannot be done |
||
148 | */ |
||
149 | protected function findElementXpaths($xpath) { |
||
162 | |||
163 | } |
||
164 |