1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace BeyondCode\DuskDashboard\Dusk\Concerns; |
4
|
|
|
|
5
|
|
|
use Closure; |
6
|
|
|
|
7
|
|
|
trait WaitsForElements |
8
|
|
|
{ |
9
|
|
|
/** {@inheritdoc} */ |
10
|
|
|
public function whenAvailable($selector, Closure $callback, $seconds = null) |
11
|
|
|
{ |
12
|
|
|
$this->actionCollector->collect(__FUNCTION__, func_get_args(), $this); |
|
|
|
|
13
|
|
|
|
14
|
|
|
return parent::whenAvailable($selector, $callback, $seconds); |
15
|
|
|
} |
16
|
|
|
|
17
|
|
|
/** {@inheritdoc} */ |
18
|
|
|
public function waitFor($selector, $seconds = null) |
19
|
|
|
{ |
20
|
|
|
$this->actionCollector->collect(__FUNCTION__, func_get_args(), $this); |
21
|
|
|
|
22
|
|
|
return parent::waitFor($selector, $seconds); |
23
|
|
|
} |
24
|
|
|
|
25
|
|
|
/** {@inheritdoc} */ |
26
|
|
|
public function waitUntilMissing($selector, $seconds = null) |
27
|
|
|
{ |
28
|
|
|
$this->actionCollector->collect(__FUNCTION__, func_get_args(), $this); |
29
|
|
|
|
30
|
|
|
return parent::waitUntilMissing($selector, $seconds); |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
/** {@inheritdoc} */ |
34
|
|
|
public function waitForText($text, $seconds = null) |
35
|
|
|
{ |
36
|
|
|
$this->actionCollector->collect(__FUNCTION__, func_get_args(), $this); |
37
|
|
|
|
38
|
|
|
return parent::waitForText($text, $seconds); |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** {@inheritdoc} */ |
42
|
|
|
public function waitForLink($link, $seconds = null) |
43
|
|
|
{ |
44
|
|
|
$this->actionCollector->collect(__FUNCTION__, func_get_args(), $this); |
45
|
|
|
|
46
|
|
|
return parent::waitForLink($link, $seconds); |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
/** {@inheritdoc} */ |
50
|
|
|
public function waitForLocation($path, $seconds = null) |
51
|
|
|
{ |
52
|
|
|
$this->actionCollector->collect(__FUNCTION__, func_get_args(), $this); |
53
|
|
|
|
54
|
|
|
return parent::waitForLocation($path, $seconds); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
/** {@inheritdoc} */ |
58
|
|
|
public function waitForRoute($route, $parameters = [], $seconds = null) |
59
|
|
|
{ |
60
|
|
|
$this->actionCollector->collect(__FUNCTION__, func_get_args(), $this); |
61
|
|
|
|
62
|
|
|
return parent::waitForRoute($route, $parameters, $seconds); |
63
|
|
|
} |
64
|
|
|
|
65
|
|
|
/** {@inheritdoc} */ |
66
|
|
|
public function waitUntil($script, $seconds = null, $message = null) |
67
|
|
|
{ |
68
|
|
|
$this->actionCollector->collect(__FUNCTION__, func_get_args(), $this); |
69
|
|
|
|
70
|
|
|
return parent::waitUntil($script, $seconds, $message); |
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
/** {@inheritdoc} */ |
74
|
|
|
public function waitForDialog($seconds = null) |
75
|
|
|
{ |
76
|
|
|
$this->actionCollector->collect(__FUNCTION__, func_get_args(), $this); |
77
|
|
|
|
78
|
|
|
return parent::waitForDialog($seconds); |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** {@inheritdoc} */ |
82
|
|
|
public function waitForReload($callback = null, $seconds = null) |
83
|
|
|
{ |
84
|
|
|
$this->actionCollector->collect(__FUNCTION__, func_get_args(), $this); |
85
|
|
|
|
86
|
|
|
return parent::waitForReload($callback, $seconds); |
87
|
|
|
} |
88
|
|
|
|
89
|
|
|
/** {@inheritdoc} */ |
90
|
|
|
public function waitUsing($seconds, $interval, Closure $callback, $message = null) |
91
|
|
|
{ |
92
|
|
|
$this->actionCollector->collect(__FUNCTION__, func_get_args(), $this); |
93
|
|
|
|
94
|
|
|
return parent::waitUsing($seconds, $interval, $callback, $message); |
95
|
|
|
} |
96
|
|
|
} |
97
|
|
|
|
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: