My script is written within the following module:
var customSearch = function () {
this.clickSearch = function (value) {
element(by.id('searchbutton')).click();
};
this.waitElementFound = function (value) {
var EC = protractor.ExpectedConditions;
browser.wait(EC.presenceof(value), 35000);
};
};
module.exports = new customSearch();
In order to call this function in my spec file, I have included the following code:
var searchFunction = require('customSearch');
var inputText = element(by.id('text'));
it('waits for the element', function(){
searchFunction.waitElementFound(inputText);
searchFunction.clickSearch();
});
Upon running the test, I encountered an error stating 'undefined function'. I am unsure of what the issue might be. Any assistance would be appreciated. Thank you.