Get help with testing, discuss unit testing strategies etc.


Post by patmona »

I am trying to automate log in into the site but I keep getting an error
Test threw an exception
ReferenceError: Class is not defined
I am unfamiliar with Siesta but I am thoroughly delving into the documentation for classes. Is there something else I need to do to the class or to the index.js/index.html? Below is the login test class that I set up.
Class('login.LoginTestClass', {
	isa: Siesta.Test.ExtJS,

	 methods : {

        login : function () {
           t.chain(
			function (next) {
				t.type('>> #username', 'username',next);
			},
			function (next) {
				t.type('>> #password','password', next)
			},
			function (next) {
				t.click('>> #submit', next)
			}
		);
        }
    }
});
Any little bit of help will be great. :D

Post by nickolay »

You need to include the file with your test class on the harness page, not in the "preload". Also, in the test class methods, instead of "t" use "this".

Check this guide: https://bryntum.com/docs/siesta/#!/guide ... test_class

Post by patmona »

I have looked at that guide but I am still lost. I am trying to call a class from a testing file but it does not seem to work. Am I supposed to set up a separate file to recall the login information or do I reference it in the test file.
 test file -> reference login class
--or--
test file,
reference file --> reference login class
I appreciate the help. I am a newbie at Siesta :lol:

Post by nickolay »

Try to repeat all the steps in the guide, it contains pretty detailed instruction.

Post Reply