Binding expression "true" cannot be assigned to

Hello,
I’m automating UI tests of an Aurelia application(which use binding events in web elements) with Cypress, but I’m getting this error ‘Binding expression "true" cannot be assigned to.’ when calling cypress actions (check, select, click …) on elements.
Here is the testes application HTML code


I have reported a bug to Cypress team but they said that the error seems to be coming from the application code.
Here is the link to the project repository: Aurelia-app, to run the app :

  1. Download or clone the app
  2. Run sudo npm install -g aurelia-cli
  3. Run cd path/to/project
  4. Run npm install
  5. Run au run --open

Hi, in Aurelia, the focus attribute is implemented as a two-way binding. This way, when you write

focus.bind="true"

when your element loses focus, the framework tries to set “true” to “false”. This raises the error.
One solution would be to declare this binding as one way:

focus.one-way="true"

This should do the work.

Best regards.

1 Like

Hello @ormasoftchile,
It works fine, thank you very much