The first two actions (action1 and action2) are the same across test scripts.
I would like to make action1 and action2 into a action group and import the action group in each test scripts.
That is, is it possible to make the test scripts looks as following? testA.t.js
StartTest(function(t) {
{
// import action group
},
{
// action A
}
});
testB.t.js
StartTest(function(t) {
{
// import action group
},
{
// action B
}
});
Thanks for the reply.
I have read that article one months ago. But I don't think it's something related to my question.
Could you give me more specific example?
Class('Test.ExtendingTestClass', {
isa: Siesta.Test.ExtJS,
methods: {
clickMyButton: function () {
var t = this;
// how could I execute my first two actions here?
}
}
});
And how to apply clickMyButton() to test script?
StartTest(function (t) {
// clickMyButton() is a method instead of action object.
// So, how to apply clickMyButton() here?
});
I have another idea.
There is a JS file containing the action group like: Steps.js
var Steps = Steps || {};
Steps.actionGroup = [
function(next){
// action1
console.log(foo); // I want to use the variable defined in *.t.js
next();
},{
// action2
}];
In my test.t.js file, it do start to run Steps.actionGroup.
But, the variable foo defined in test.t.js is not accessible by Steps.js.
How could I resolve it?
StartTest(function(t) {
var foo = 0;
t.chain(
Steps.actionGroup
);
});
But, we have more than one developers, so we want to have multiple extended test classes for different modular testing.
Does testClass support an array of extended test classes?