I have 2 different js file: abc.js and func_abc.js
Previously i write all my function in my abc.js and call it from same file. There is no problem this way.
But since it is getting bigger, i am thinking to manage it in separate file as i intended to use it for other file as well.
I am not sure how to call function that i have written in func_abc.js into abc.js
I tried to use export and require but it says Title is not defined.
File func_abc.js:
function Title(title) {
patient.titleselect.click().then(function () {
element(by.cssContainingText('mat-option',title)).click().then(function () {
console.log("Successfully select title");
});
});
};
function Gender(sex) {
element(by.cssContainingText('mat-radio-button',sex)).click().then(function () {
console.log("Successfully select gender");
})
};
File abc.js:
it('Create new patient', function(){
Title("Mr");
Gender("M");
}