Last active
November 27, 2020 05:09
-
-
Save migbar/3d961ddb7aaad1588949 to your computer and use it in GitHub Desktop.
ember-cli-page-object extension for ember-power-select
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// helpers/ember-cli-page-object-extensions.js | |
import { buildSelector } from '../page-object'; | |
let selectableChoose = function(selector, options = {}) { | |
return { | |
isDescriptor: true, | |
value(textToSelect) { | |
wait().then(function() { | |
selectChoose(buildSelector(this, selector, options), textToSelect); | |
}); | |
return this; | |
} | |
}; | |
} | |
let selectableSearch = function(selector, options = {}) { | |
return { | |
isDescriptor: true, | |
value(textToSearch) { | |
wait().then(function() { | |
selectSearch(buildSelector(this, selector, options), textToSearch); | |
}); | |
return this; | |
} | |
}; | |
} | |
export default { | |
selectableChoose, | |
selectableSearch | |
} | |
//use it from a page object scope: | |
customer: { | |
scope: '.customer', | |
selectTitle: selectableChoose('.title') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This only works for acceptance tests, correct?