use data-test-subj click create button in a less fragile manner

This commit is contained in:
Matthew Bargar 2016-01-25 17:09:15 -05:00
parent af9c3dd8ce
commit d262deaba2
2 changed files with 4 additions and 5 deletions

View file

@ -167,6 +167,7 @@
</div> </div>
<button <button
data-test-subj="submitCreateIndexPatternFromExistingForm"
ng-disabled="form.$invalid || index.fetchFieldsError" ng-disabled="form.$invalid || index.fetchFieldsError"
ng-class="index.fetchFieldsError ? 'btn-default' : 'btn-success'" ng-class="index.fetchFieldsError ? 'btn-default' : 'btn-success'"
type="submit" type="submit"

View file

@ -130,13 +130,11 @@ define(function (require) {
}, },
getCreateButton: function () { getCreateButton: function () {
return this.remote.setFindTimeout(defaultTimeout) return common.findTestSubject('submitCreateIndexPatternFromExistingForm');
.findByCssSelector('.btn');
}, },
clickCreateButton: function () { clickCreateButton: function () {
return this.remote.setFindTimeout(defaultTimeout) return common.findTestSubject('submitCreateIndexPatternFromExistingForm').click();
.findByCssSelector('.btn').click();
}, },
clickDefaultIndexButton: function () { clickDefaultIndexButton: function () {
@ -309,7 +307,7 @@ define(function (require) {
return common.tryForTime(defaultTimeout, function () { return common.tryForTime(defaultTimeout, function () {
return self.selectTimeFieldOption('@timestamp') return self.selectTimeFieldOption('@timestamp')
.then(function () { .then(function () {
return self.getCreateButton().click(); return self.clickCreateButton();
}); });
}) })
.then(function () { .then(function () {