I am playing around with Siesta and some built in assertions.
I came across a problem with the elementIsNotEmpty() assertion.
I want to check if after typing an empty string in a login field, the field is really empty and nothing is displayed in it.
So mein Test-Chain looks something like this:
t.it("Login with non valid Data", function(t) {
t.diag("Failing the Login"),
t.chain(
// Login
t.loginFunction("", "alsoWrong"),
{
waitFor: 10000
},
t.elementIsNotEmpty(">>textfield[itemId=fldPassword]")
);
});
In My LoginFunction i work with the Same componentquery element, as you can see here:
{
action: 'type',
target: ">>textfield[itemId=fldName]",
text: user,
desc: "Type in username"
},
I get a warning at the line where i use elementIsNotEmpty, which says:
WARN: Your component query: "textfield[itemId=fldPassword]" returned no components
Wheres the problem here?
No we can't.
The one that complains looks for a textfield with
itemId:"fIdPassword", while the working example looks for a textfield withitemId:"fIdName"If that is not what the problem is about (i.e. just a typo), please show us the code that you are testing as well. With just the test itself, there is no way to tell if the tested code is working.