Comments (9)
@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.
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.
@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.
I see. And you call these things properties
now?
from ember-cli-page-object.
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.
@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.
@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.
@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.
@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)
- How to replace deprecated `is(':focus')`? HOT 3
- Errors running tests since upgrading to v5 of `ember-qunit` HOT 7
- Deprecation calls need to be updated for compat with Ember 3.24 HOT 2
- Incompatible with Embroider 's `staticAddonTestSupportTrees` optimized mode HOT 10
- new deprecation: `create-url-argument` *always* throws when an object is passed to create. HOT 4
- Query Engines
- Assign is being referenced from @ember/polyfills. This prevents upgrade to Ember 4 HOT 4
- Update ember-cli-babel HOT 5
- migrate to v2 Addon Format HOT 4
- Types require allowSyntheticDefaultImports=true HOT 2
- Replace usage of ember-native-dom-helpers by @ember/test-helpers HOT 1
- is there a way to create recursive page object? HOT 2
- docs: clickable needs to be awaited HOT 2
- All imports must be declared as dependencies or peers HOT 3
- Fix support for @tsconfig/ember 3.0.0 error TS7016 HOT 6
- [Quest] Remove jquery
- get rid of `$.param(`
- `$.prop(`
- deprecate finders `scope` option
- string getters on a collection definition raise error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-cli-page-object.