1: <?php
2: namespace Azalea\Selenium\App\Encounters;
3:
4: use Azalea\Selenium\Toolkit\View;
5:
6: class EncounterProcedureCodes extends View
7: {
8:
9: 10: 11:
12:
13: public function fillQuickSubmit($code, $box = 1)
14: {
15: $this->querySelector('[name="cpt_'.$box.'"]')->value($code);
16: return $this;
17: }
18:
19: public function submitQuickSubmit()
20: {
21: $this->clickElement("#cpt_submit");
22: $this->driver->waitForAjax();
23: }
24:
25: public function search()
26: {
27: $this->filter("#cpt_quick_submit")->press("Search");
28: $this->driver->wait(1);
29: return $this;
30: }
31:
32: public function removeAll()
33: {
34: $total = count($this->querySelectorAll('[data-grid-row] .ecp_code'));
35: for ($i = $total; $i > 0; $i--) {
36: try {
37: $this->querySelector('[data-grid-row="0"] .delete')->click();
38: } catch (\PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {
39: break;
40: }
41:
42: $this->driver->getApp()->popup->confirmYes();
43: $this->driver->waitForAjax();
44: $this->spinWait(function ($driver) use ($i) {
45: return (count($driver->querySelectorAll('[data-grid-row] .ecp_code')) < $i);
46: });
47: }
48: return $this;
49: }
50: }
51:
52: ?>