1 | <?php |
||
13 | class BrowserSession extends CrawlerSession |
||
14 | { |
||
15 | /** |
||
16 | * @var BrowserInterface |
||
17 | */ |
||
18 | private $browser; |
||
19 | |||
20 | /** |
||
21 | * @param BrowserInterface $browser |
||
22 | */ |
||
23 | public function __construct(BrowserInterface $browser) { |
||
24 | |||
25 | $this->browser = $browser; |
||
26 | |||
27 | parent::__construct($browser); |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * @return BrowserInterface |
||
32 | */ |
||
33 | 1 | public function getBrowser() |
|
37 | |||
38 | /** |
||
39 | * @return string |
||
40 | */ |
||
41 | public function getAlertText() |
||
45 | |||
46 | /** |
||
47 | * @param string $confirm |
||
48 | */ |
||
49 | 1 | public function confirm($confirm) |
|
55 | |||
56 | /** |
||
57 | * @return self |
||
58 | */ |
||
59 | 1 | public function removeAllCookies() |
|
65 | |||
66 | /** |
||
67 | * @param string $javascript |
||
68 | * @return mixed |
||
69 | */ |
||
70 | public function executeJs($javascript) |
||
74 | |||
75 | /** |
||
76 | * @param string $filename |
||
77 | * @throws InvalidArgumentException if directory doesnt exist or is not writable |
||
78 | * @return self |
||
79 | */ |
||
80 | 1 | public function saveScreenshot($filename) |
|
88 | |||
89 | /** |
||
90 | * @param Node $node |
||
91 | * @return self |
||
92 | */ |
||
93 | 1 | public function hoverNode(Node $node) |
|
99 | |||
100 | /** |
||
101 | * @param string $selector |
||
102 | * @return self |
||
103 | */ |
||
104 | 1 | public function hover($selector) |
|
110 | |||
111 | /** |
||
112 | * @param string $selector |
||
113 | * @return self |
||
114 | */ |
||
115 | 1 | public function hoverButton($selector) |
|
121 | |||
122 | /** |
||
123 | * @param string $selector |
||
124 | * @return self |
||
125 | */ |
||
126 | 1 | public function hoverField($selector) |
|
132 | } |
||
133 |