Hi guys,
currently I am writing acceptence tests using chimp and I ran into a weird problem when testing an autoform.
IMPORTANT: This test works in chrome but NOT with phantomjs.
I have a collection that is rendered via autoform:
phones: {
type: [Object],
optional: true,
},
'phones.$.nr': {
type: String,
},
Within my test I want to ADD a new phone-number and click the PLUS-button in the autoform. In phantomjs I am getting a Uncaught RuntimeError: Element is not currently interactable and may not be manipulated
when trying to set a value via browser.setValue
.
NOTE: Taking a screenshot via browser.saveScreenshot()
shows that autoform DID NOT create a new field after the click.
This is the chimp code:
// Scenario: I can add a new phone-number via the autoform
// Given I have a list of phone-numbers (phones) with 1 field set.
// When I click the "PLUS"-button in order to ADD a new number
const addPhonesButton = `${formSelector} button.autoform-add-item[data-autoform-field="phones"]`
console.log(browser.isVisible(addPhonesButton)) // =true
browser.click(addPhonesButton)
browser.pause(2000)
// Then a new input field appears for me to enter the new phone-number
// NOTE: When I take a screenshot via browser.saveScreenshot() the autoform DOES NOT show a new input field!!!
const phoneInputField = `${formSelector} input[name="phones.1.nr"]`
console.log(browser.isExisting(phoneInputField)) // =true
console.log(browser.isVisible(phoneInputField)) // =false (!!!!)
browser.setValue(phoneInputField, '+1299288272') // FAILS(!!!) WITH "Uncaught RuntimeError: Element is not currently interactable and may not be manipulated"
Any ideas whats going on?