This is a short guide to get you started writing page objects and using them in your tests.
Suppose we have a simple login form component with the following result markup:
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
submit(e) { | |
e.preventDefault(); | |
} | |
}); |
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
a: Ember.inject.service(), | |
willDestroyElement() { | |
setTimeout(() => { | |
alert(`Component isDestroyed: ${this.isDestroyed}`); | |
alert(`service.title: ${this.get('a').title}`); | |
}, 1000) |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
actions: { | |
mouseWheel(e) { | |
if (document.hasFocus(e.target)) { | |
e.preventDefault() | |
} | |
} | |
} |
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
This is a short guide to get you started writing page objects and using them in your tests.
Suppose we have a simple login form component with the following result markup:
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
router: Ember.inject.service(), | |
queryParams: ['test'], | |
test: `I'm changed o_O`, | |
actions: { |