_setStrictVisibilityCheck(true); function AnalysePage() { this.$url = "analyse.html"; this.go = function(){ _navigateTo(this.$url);} this.goMainMenu = function(){ this.clickTab("Hauptmenü");} this.clickTab = function($name){ _click(_span($name)); } this.closeTab = function($name){ _click(_span("/x-tab-close-btn/", _near(_span($name))));} this.clickNewClient = function(){ _click(_link("neueMandantButton"));} this.clickEditClient = function(){ _click(_link("ladeMandantButton")); } this.clientFilterByName = function($fname, $lname) { _setValue(_textbox("vorname"), $fname); _setValue(_textbox("nachname"), $lname); _click(_span("Suche")); _wait(2000,!_isVisible(_div("Lade Daten...")) ); } this.clientFilterByBerater = function($filter,$item) { _setValue(_textbox("beraterSearchField"), $filter); _click(_div({className: "/x-boundlist-item/", sahiText : $item})); _click(_span("Suche")); _wait(2000,!_isVisible(_div("Lade Daten...")) ); } this.clickClient = function($fname,$lname) { this.clientFilterByName($fname,$lname); this.clickClientByName($fname,$lname); } this.clickClientByName = function($fname,$lname) { $rows = _count("_row","/x-grid-row.*x-grid-data-row/"); // get all rows with clients visible if($rows <= 0) _fail("no mandanten found"); _log($rows + " rows found"); for(var $i=0; $i<$rows; $i++) { $row = _row("/x-grid-row.*x-grid-data-row/["+$i+"]"); if($fname == _getCellText(_cell(0, _in($row))) && $lname == _getCellText(_cell(1, _in($row))) ){ //check firstname and lastname _doubleClick(_cell(0, _in($row))); return true; } } _fail("Mandant not found"); } this.clickTabPersönlicheAngaben = function() {this.clickTab("Persönliche Angaben")} this.clickTabVerträgeAngebote = function() {this.clickTab("Verträge & Angebote")} this.clickTabBeratungHandlungsempfehlung = function() {this.clickTab("Beratung - Handlungsempfehlung")} this.clickTabAngebotsrechner = function() {this.clickTab("Angebotsrechner")} this.clickTabDokumente = function() {this.clickTab("Dokumente")} this.clickTabWiedervorlagen = function() {this.clickTab("Wiedervorlagen")} this.clickTabKommunikation = function() {this.clickTab("Kommunikation")} this.deleteMandant = function($fname,$lname){ //start from main menu this.clientFilterByName($fname,$lname); $rows = _count("_row","/x-grid-row.*x-grid-data-row/"); _log($rows + " rows found"); for(var $i=0; $i<$rows; $i++) { $row = _row("/x-grid-row.*x-grid-data-row/["+$i+"]"); if($fname == _getCellText(_cell(0, _in($row))) && $lname == _getCellText(_cell(1, _in($row))) ){ //check firstname and lastname _click(_image("user_delete.png", _in($row))); //delete row _assertVisible(_span("Achtung")); _click(_link("Ja")); } } _click(_image("x-tool-img x-tool-close")); // close window } } function clickFormTrigger($inputElName){ // dropdown or calender icon _click(_div("/ x-form-trigger /", _near(_textbox($inputElName)))); } function setDropdownItem($inputElName, $item){ clickFormTrigger($inputElName); _click(_listItem($item)); } function checkFieldRequired($inputElName) { _assertEqual("/x-form-required-field/", _textbox($inputElName).className); } function checkFieldDisabled($inputElName) { _assertEqual(true, _textbox($inputElName).disabled); }