I just started to use Bryntum Siesta and ExtJs for Automated testing. My first, very simple test work like i expected. Now i came across a problem with DRY-Code.
I am trying to write DRY Code for a Login Test.
There are actually two cases here: - a Login with valid data - a login with non-valid data (wrong password AND/OR Username)
In java it would work with global variables/functions. And i thought, that i've done something like javascript global variables before. But it doesn't work.
So i have my tryout function:
var testFunction = function(){
console.log("I am a global function, and i am working!");
};
and my goal is to call it in my t.chain() in my Testfile:
{
type: LoginUsername,
target: ">>#loginviewIdemId #loginForm #pwTriggerForm #fldName",
desc: 'Type in Username',
},
function(next) {
testFunction();
next();
},
When i call a function that was created in this testfile above the chain, it does work. I am sorry if it some basic javascript question, but im getting devastated :D
Thanks in advance!