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