I'm trying to create a simple test for creating of new record.
test('Create dataset', function(assert) {
expect(1);
visit('/add');
fillIn('input.name', 'some name');
fillIn('input.description', 'some description');
//this part is to click on custom dropdown and select first option
click('.select2-container input'); //after this action a list of options is generated
click('.select2-drop ul li:first'); //but this action runs before the list was generated, so it gives me an error that this element does not exist
click('button[type="submit"]');
});
Is there any way to pause the test untill the list as rendered?
For example something like waitFor('.select2-drop ul li:first')
Aucun commentaire:
Enregistrer un commentaire