Comments (12)
Hi @wayne-o, what ember-cli
version are you using?
Cheers!
from ember-cli-page-object.
version: 1.13.8
node: 4.1.0
npm: 2.13.4
os: darwin x64
loving it so far btw :) really nice project - just deleted tons of code after converting a couple tests to page/object - always nice to be able to delete code :)
from ember-cli-page-object.
@wayne-o I will try installing the addon using a vanilla app to check if anything goes wrong, the last release included a lot of changes.
We are glad you like it! We love it too and we are planning to continue adding more cool features, you can write an issue if you want to propose new features or changes.
Thanks!
from ember-cli-page-object.
@wayne-o I tried to reproduce this issue but I couldn't.
$ ember --version
version: 1.13.8
node: 0.12.7
npm: 2.13.4
os: darwin x64
These are the steps I took to create the app:
$ ember new the-test
$ cd the-test/
$ ember install ember-cli-page-object
$ ember generate acceptance-test home
$ ember generate page-object my-page
and this is the code of the test and page object
tests/acceptance/home-test.js
import Ember from 'ember';
import { module, test } from 'qunit';
import startApp from 'the-test/tests/helpers/start-app';
import page from '../pages/my-page';
module('Acceptance | home', {
beforeEach: function() {
this.application = startApp();
},
afterEach: function() {
Ember.run(this.application, 'destroy');
}
});
test('visiting /home', function(assert) {
page.visit();
andThen(function() {
assert.equal(page.title(), 'Welcome to Ember');
});
});
tests/pages/my-page.js
import PageObject from '../page-object';
let {
visitable,
text
} = PageObject;
export default PageObject.build({
visit: visitable('/'),
title: text('#title')
});
and this is the output of ember test
command
$ ember test
version: 1.13.8
Built project successfully. Stored in "./the-test/tmp/class-tests_dist-HN8XOhE7.tmp".
ok 1 PhantomJS 1.9 - Acceptance | home: visiting /home
ok 2 PhantomJS 1.9 - JSHint - acceptance: acceptance/home-test.js should pass jshint
ok 3 PhantomJS 1.9 - JSHint - .: app.js should pass jshint
ok 4 PhantomJS 1.9 - JSHint - helpers: helpers/resolver.js should pass jshint
ok 5 PhantomJS 1.9 - JSHint - helpers: helpers/start-app.js should pass jshint
ok 6 PhantomJS 1.9 - JSHint - pages: pages/my-page.js should pass jshint
ok 7 PhantomJS 1.9 - JSHint - .: router.js should pass jshint
ok 8 PhantomJS 1.9 - JSHint - .: test-helper.js should pass jshint
1..8
# tests 8
# pass 8
# fail 0
# ok
Could you provide us more information on how to reproduce it? It would be great if you can upload a zip file with a project that has the issue.
from ember-cli-page-object.
Hi @wayne-o, did you had the chance to look at this issue?
from ember-cli-page-object.
@wayne-o, I couldn't reproduce the issue and we didn't receive more info about it. So I'll close the issue for now, if you can reproduce it, please re-open it.
Thanks.
from ember-cli-page-object.
Hey folks, I also ran into this problem (possibly the same as @wayne-o ) during installation, so time to flog this dead horse. 👊 🐴
TL;DR
If you use this in an addon project instead of an app, the test loader fails because the scaffolded code uses the addon's name as the namespace when it should use dummy
as the namespace
Howto: Reproduce
ember addon akari
cd akari
ember install ember-cli-page-object
ember generate acceptance-test aria
ember generate page-object aria/index
Open up tests/acceptance/aria.js
and add the following line at the top with the other import directives:
import AriaIndexPage from '../pages/aria/index';
Now, back to testing:
ember test
You should receive some version of the following error:
version: 2.3.0-beta.2
Could not start watchman; falling back to NodeWatcher for file system events.
Visit http://www.ember-cli.com/user-guide/#watchman for more info.
Built project successfully. Stored in "/home/aika/alice/alicia/akari/tmp/class-tests_dist-EgFz4G9q.tmp".
not ok 1 PhantomJS 2.1 - TestLoader Failures: dummy/tests/acceptance/aria-test: could not be loaded
---
actual: >
null
stack: >
The Blame-It-On-The-User Solution
An user may fix this bug by editing the scaffolded page-object file tests/pages/aria/index.js
From this:
import PageObject from 'akari/tests/page-object';
to
import PageObject from 'dummy/tests/page-object';
My Suggestions
Please consider detecting if we're in an app or an addon in lib/blueprints-helpers.js
, and using options.project.name()
if and only if we're in an addon.
from ember-cli-page-object.
Hi @foxnewsnetwork, thanks for the detailed bug report. Its definitely a bug.
As you said, the problem here it's how the generators point to the PageObject helper:
And here's how you do this properly, we should copy it
I think this is a different issue from the originally reported so it would be great to open a new issue, @foxnewsnetwork can you open a new issue?
from ember-cli-page-object.
Just happened to me with an app:
version: 2.4.2
node: 5.5.0
os: darwin x64
I installed it using ember install
:
> ember install ember-cli-page-object
version: 2.4.2
Installed packages for tooling via npm.
installing ember-cli-page-object
install bower package ceibo
Installing browser packages via Bower...
not-cached git://github.com/san650/ceibo.git#1.1.0
resolved git://github.com/san650/ceibo.git#1.1.0
Installed browser packages via Bower.
Installed addon package.
And tried to use ember generate ember-cli-page-object
(eg
is an alias to ember generate
):
> eg ember-cli-page-object
version: 2.4.2
installing ember-cli-page-object
install bower package ceibo
Installing browser packages via Bower...
cached git://github.com/san650/ceibo.git#1.1.0
Installed browser packages via Bower.
Let me know if you need any other detail.
from ember-cli-page-object.
Oh, I created a page object for a component:
eg page-object-component investment-profile-history-item
version: 2.4.2
installing page-object-component
create tests/pages/components/investment-profile-history-item.js
from ember-cli-page-object.
Solved it: stop the server, remove bower_components
, dist
, node_modules
and tmp
. Reinstall everything and restart the server.
from ember-cli-page-object.
@Serabe Glad it worked. Maybe we should mention in our release notes and installation notes that you should restart your dev server and test server after the installation in order to reload the dependencies... I'm not sure this is necessary but I can take a look at that.
Also, note that ember generate ember-cli-page-object
blueprint is used to install the bower dependencies and runs automatically if you do ember install ember-cli-page-object
. To generate a new page object definition you should use ember generate page-object foo
.
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.