I have started the testing journey recently. Mainly, I am focusing on UI tests for now.
I have implemented a method to test crud actions for a webapp(implemented in extjs) with more than 600 screens. Things look smooth till now. However, I am facing some tiny issues and I would need your guidance.
Sometimes, when it happens to delete a record, there is always a messagebox alert.
I use recorder to get dom elements which are in two forms:
1.
{waitForCQ: "#myAppName-messgbox title[text=Do you want to delete this record\?]"},
{click: "messagebox[title=Do you want to delete this record\?]#myAppName-messgbox #yes => .x-btn-inner-default-small"},
{waitForCQ: '#myAppName-messgbox title[text=Do you want to delete this record\?]'},
{click: '#myAppName-messgbox #yes => .x-btn-button'}
example:
delAction.it("is clicking trash icon", function(del){
if(screenName === 'employee'){ // there are more screens to be added to this condition
del.chain(
waitForCQ: '#myAppName-messgbox title[text=Do you want to delete this record\?]'},
{click: "messagebox[title=Do you want to delete this record\?]#myAppName-messgbox #yes => .x-btn-inner-default-small"'}
)
}else{
del.chain({waitForCQ: '#myAppName-messgbox title[text=Do you want to delete this record\?]'},
{click: '#myAppName-messgbox #yes => .x-btn-button'})
}
})
Here is the image of the messagebox:
Thanks