Skip to content

Instantly share code, notes, and snippets.

@DanielGallo
Last active January 28, 2019 20:37
Show Gist options
  • Save DanielGallo/a64233b640b0be7ef0a7f6077624cb7c to your computer and use it in GitHub Desktop.
Save DanielGallo/a64233b640b0be7ef0a7f6077624cb7c to your computer and use it in GitHub Desktop.
MouseOver on Component in WebDriver scenario (Sencha Test)
// Scenario URL: http://examples.sencha.com/extjs/6.5.3/examples/kitchensink/frame-index.html?classic#locking-grid
describe('Grid column tests', function() {
it('Should lock the Change column', function() {
var driver = ST.defaultContext.driver;
// This code moves the mouse over one of the column's headers which
// shows the trigger to display the column menu
ST.element('gridcolumn[text=Change] => .x-column-header-text-container')
.get('id')
.and(function() {
// "this.future.data" is provided by Sencha Test and contains the results from the "get" API above.
// Here we use WebDriverIO's "moveToObject" to focus on the column header, making the column header trigger visible.
driver.moveToObject('#' + this.future.data.id);
});
// This clicks the column header trigger which displays the column menu
ST.element('gridcolumn[text=Change] => .x-column-header-trigger')
.click();
// This references the column header menu and clicks the "Lock" option
ST.component('menu[activeHeader]')
.gotoComponent('menuitem[text=Lock]')
.click();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment