Created
July 28, 2016 15:31
-
-
Save sebastienvermeille/96d3c102830ba062feddfe46798e9806 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var PatientPage=require('./patient.page.js'); | |
var UpdatePatientPage = Object.create(new PatientPage()); | |
var UpdatePatientPage=function(){ | |
var HeaderPage=require('./../../common/pages/header.page.js'); | |
this.header=new HeaderPage(); | |
this.patient=element(by.binding('vm.patient')); | |
this.firstname=element(by.css("input#patient-firstname")); | |
this.lastname=element(by.css("input#patient-lastname")); | |
this.gender=element(by.css('pqm-json-list#patient-gender')); | |
this.patientID=element(by.css('input#patient-id')); | |
this.lastBreadcrumbItem=element(by.css("div#breadcrumb > span")); | |
this.saveButton=element(by.css('button#saveButton')); | |
this.newButton=element(by.css('button#createButton')); | |
// var PatientPage=require('./patient.page.js'); | |
this.get=function(patientID){ | |
browser.get("http://localhost:9999/physioqmap/#/patienten/edit/" + patientID); // Load the page | |
browser.waitForAngular(); | |
browser.sleep(1000); | |
}; | |
this.setFirstname=function(firstname){ | |
this.firstname.sendKeys(firstname); | |
}; | |
this.getFirstname=function(firstname){ | |
return this.firstname.getAttribute('value'); | |
}; | |
this.setLastname=function(lastname){ | |
this.lastname.sendKeys(lastname); | |
}; | |
this.getLastname=function(lastname){ | |
return this.lastname.getAttribute('value'); | |
}; | |
this.getPatientID=function(){ | |
return this.patientID.getAttribute('value'); | |
}; | |
/** | |
* MALE | FEMALE | |
* @param gender | |
*/ | |
this.setGender=function(gender){ | |
this.gender.click(); | |
browser.waitForAngular(); | |
element(by.css('.md-select-menu-container.md-active md-option[value="' + gender + '"]')).click(); | |
browser.waitForAngular(); | |
}; | |
this.clickSave=function(){ | |
this.saveButton.click(); | |
browser.sleep(2000); | |
}; | |
this.clickNew=function(){ | |
this.newButton.click(); | |
browser.sleep(2000); | |
}; | |
this.getHeader=function(){ | |
return this.header; | |
}; | |
}; | |
module.exports=UpdatePatientPage; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment