Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom fns not being attached to els returned from getListPo #8

Closed
tonybranfort opened this issue Aug 16, 2017 · 0 comments
Closed

Comments

@tonybranfort
Copy link
Owner

This fails with Failed: clientPo.payments.getRow(...).amount.addTen is not a function:

   // clientPo payments page object
  payments: {
    locator: by.repeater('payment in payments'),
    po: ngpo.makeListPo,
    els: {
      amountInput: {
        locator: by.model('payment.amount'),
        po: ngpo.makeInputPo,
        fns: {
          addTen: function(el, options) {
            return el.getValue()
            .then((val) => {return el.enterValue(Number(val) + 10);});
          }
        }
      },
      amount: {
        locator: by.binding('payment.amount'),
        po: ngpo.makeTextPo},
    },
  },

  // test
    it('should implement custom functions on elements in getListPo', () => {
      expect(clientPo.payments.getRow(0).amount.getValue()).toBe('5'); 
      clientPo.payments.getRow(0).amount.addTen(); 
      expect(clientPo.payments.getRow(0).amount.getValue()).toBe('15'); 
    });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant