I am having a terrible timing getting the click method on the ST.button future to do anything in my tests of a real application. It seems I may be missing something.
So I have distilled it down to the simplest of test apps with the simplest of tests to try to figure out what is going on. But I still do not see anything happen when the click() method is called on the button future in the test.
Modern Application created with Ext 6.7.0
Code:
Ext.application({
name: 'ButtonTest',
launch: function () {
let p = Ext.create('Ext.Panel', {
fullscreen: true,
items: [
{
xtype: 'button',
text: 'click',
handler: function(){
Ext.ComponentQuery.query('#textFieldItemId')[0].setValue('Button was clicked');
}
},
{
xtype: 'textfield',
itemId: 'textFieldItemId',
value: 'button was not clicked yet'
}
]
});
p.show();
}
});
WebDriver test, which I am running against the above Sencha app watch with embedded Chrome
Code:
describe("ClickTest", function() {
it("button is visible", function() {
ST.button('button[text="click"]').visible();
});
it("updates text when button is clicked", function() {
ST.button('button[text="click"]').click();
ST.textField('#textFieldItemId').valueLike('Button was clicked');
});
});
The first test passes--button is visible.
The second test fails. If I step through it with the debugger on, nothing happens onscreen after the click() call.
If I run the application and click the button the text changes.
If anyone can help me identify what I am doing wrong I would much appreciate it.