Comments (7)
@iezer Yeah, I think this would be great. Imo the most important thing is finding a good syntax for providing the message. Adding options: { message: '...' }
seems ok, but do you have any ideas for something terser?
from ember-cli-acceptance-test-helpers.
@bantic We were thinking expectElement(findButton('Save Profile'), 'Save button displays correctly');
where the message is an optional parameter. CC @iezer
from ember-cli-acceptance-test-helpers.
We can detect if the 3rd parameter is a string or an object. In the former case use that string as the message, and in the latter look for a msg
or message
property, so
expectElement(findButton('Save'), 1, 'Save Button');
and
expectElement(findButton('Save'), 1, { msg: 'Save Button' })
would both work.
In either case we should swap that message into the complete message from the helper so we would display Found 0 of 'Save Button' but expected 1
from ember-cli-acceptance-test-helpers.
something I have found useful in async tests, is the ability to pause and resume tests. At work we are using this, and its quite nice. This differs from a debugger, in that you can still use and interact with the paused application, and differs from the existing pauseTest helper, because it can be resumed.
example:
import pause from './helpers/pause';
test("fooo", async () => {
await visit('/foo');
await pause(); // will pause here, but can be resumed by typing `resume`
await click('#bar');
// some assertions
})
codez: https://gist.github.com/stefanpenner/0baadd08d0733f9e8ae0
from ember-cli-acceptance-test-helpers.
Submitted a PR. Please let me know if any feedback!
I think a good next step would be to change
expectElement(findButton('Save'), 1, { msg: 'Save Button' })
to just be
expectElement(findButton('Save'), 1, 'Save Button');
like assert.ok
syntax
but not sure how to do that yet since options
is { contains: 'foo', message: 'whatevs }
from ember-cli-acceptance-test-helpers.
@amyrlam Can I close this issue?
I've opened a separate issue #32 for @stefanpenner 's suggestion to add a pause
helper.
from ember-cli-acceptance-test-helpers.
👍 and thanks for the help
from ember-cli-acceptance-test-helpers.
Related Issues (17)
- jshint should not complain after installing the addon HOT 9
- feature request: expectLinkTo(pathName) HOT 1
- Using Mocha HOT 1
- expectElement greater than a certain count? HOT 3
- expectComponent with options gives wrong error if component not present
- expectComponent does not have count parameter
- tests test more than one feature in a single test HOT 1
- expectComponent does not work with hbs rendering HOT 5
- feature request: expectNoComponent HOT 3
- expectElement is not defined. HOT 2
- `clickComponent` lookupFactory of undefined error HOT 4
- Add Pause Helper HOT 1
- Update for ember-cli 2.10 HOT 11
- Prepare for ember 2.13.0
- Patch Version on 0.4.x series to throw deprecation warning
- minimatch security vulnerability HOT 1
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-acceptance-test-helpers.