GithubHelp home page GithubHelp logo

Comments (9)

juanazam avatar juanazam commented on May 22, 2024

@kmiyashiro, there are multiple ways to move away from customHelper, it depends for what you are using it, can you show a particular case you might be worried about?

WIth 1.0.0, we have changed the way we generate PageObjects completely. The idea is that user would move away from customHelper to building their own Ceibo descriptors (all existing properties of the project have been moved to that format). This will give users all the necessary power to build whatever they need.

from ember-cli-page-object.

kmiyashiro avatar kmiyashiro commented on May 22, 2024

I use customHelper to add a keyEvent and triggerEvent helpers

/* global keyEvent */

import PageObject from '../../page-object';

function _keyEvent(selector) {
  return function(eventName, keyCode) {
    return keyEvent(selector, eventName || 'keypress', keyCode || 13);
  };
}

export default PageObject.customHelper(_keyEvent);

from ember-cli-page-object.

juanazam avatar juanazam commented on May 22, 2024

@kmiyashiro we have the same code on one project I found this very funny 😄

You can build a property in the v1 way, for example: https://github.com/san650/ember-cli-page-object/blob/master/test-support/page-object/properties/fillable.js.

export function _keyEvent(selector, options = {}) {
  return {
    isDescriptor: true,

    value(eventName, keyCode) {
      let processedSelector = buildSelector(selector, options);
      /* global keyEvent */
      return keyEvent(selector, eventName || 'keypress', keyCode || 13);
    }
  }
}

On this exampe I'm using the buildSelector helper to build a selector based on where the Ceibo descriptor is within the PageObject definition and also allows the usage of options suchs scope, resetScope and at.

You can see how that works over here: http://github.com/san650/ember-cli-page-object/blob/master/test-support/page-object/helpers.js#L88

Anyway, we are aiming to write about this on the site so users know how can they do this.

Hope this is helpful.

from ember-cli-page-object.

kmiyashiro avatar kmiyashiro commented on May 22, 2024

I see. And you call these things properties now?

from ember-cli-page-object.

juanazam avatar juanazam commented on May 22, 2024

On the page object project we have properties that are Ceibo descriptors. Example: clickable property is build using Ceibo we say it is a Ceibo descriptor.

from ember-cli-page-object.

juanazam avatar juanazam commented on May 22, 2024

@kmiyashiro we have finally released v1, I added this example to the official documentation. You can join the ember-cli-page-object channel in slack if you have more doubts. I'm closing this issue.

from ember-cli-page-object.

san650 avatar san650 commented on May 22, 2024

@kmiyashiro I add a helper to do this in another project, https://github.com/san650/tajpado/blob/9e34624bd60251f2163614aaa41555027ff975a4/tests/pages/activity.js#L3-L11

Also, as Juan said, this link has an example http://ember-cli-page-object.js.org/docs/v1.0.x/components#customhelper

Maybe we could add the a keyEvent property action to ember-cli-page-object, What do you think @kmiyashiro

from ember-cli-page-object.

kmiyashiro avatar kmiyashiro commented on May 22, 2024

@san650 I think adding a keyEvent action would be a good idea, key events are almost as common as clicks when testing apps.

from ember-cli-page-object.

juanazam avatar juanazam commented on May 22, 2024

@kmiyashiro I have thought about adding event actions on every component might be a good idea. keyEvent, blur and other.

@san650 what do you think?

from ember-cli-page-object.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.