1: <?php
2: namespace Azalea\Selenium\App\Scheduler;
3:
4: use Azalea\Selenium\Toolkit\View;
5: use DateTime;
6:
7: class Scheduler extends View
8: {
9: /**
10: * Goes to a particular location in the scheduler.
11: *
12: * @param int $loc_id
13: *
14: * @return $this
15: */
16: public function changeLocation($loc_id)
17: {
18: $this->spinWait(function ($driver) use ($loc_id) {
19: $driver->querySelector("#loc$loc_id")->click();
20: return true;
21: });
22:
23: return $this;
24: }
25:
26: /**
27: * Goes to a particular day in the scheduler.
28: *
29: * @param DateTime $dt
30: *
31: * @return $this
32: */
33: public function goToDate(DateTime $dt)
34: {
35: $this->updateHash("/scheduler/d/".$dt->format("Ymd"));
36: return $this;
37: }
38:
39: /**
40: * Scroll to a partiuclar time in the scheduler, expressed
41: * as hhmm in military time. Ex: 1730 for 5:30pm.
42: *
43: * @param string $time
44: *
45: * @return this
46: */
47: public function scrollTo($time)
48: {
49: $this->javascript('$("#sd_body").scrollTo("#sd_row'.$time.'");');
50: $this->wait(2);
51: return $this;
52: }
53: }
54:
55: ?>
56: