Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make it node.js compatible #512

Open
8 of 9 tasks
ro0gr opened this issue Jun 20, 2020 · 2 comments
Open
8 of 9 tasks

make it node.js compatible #512

ro0gr opened this issue Jun 20, 2020 · 2 comments

Comments

@ro0gr
Copy link
Collaborator

ro0gr commented Jun 20, 2020

With adapters we should be able to configure page object interactions per different environments. However, there are still some blockers to make page objects work cross-env. The goal of the ticket is to build a path forward for page objects to work in node, and probably other envs like different FWs etc.

@ember/*

There are some of ember packages we do currently depend on, and they don't have standalone packages published.

"jquery" VS "-jquery"

-jquery is a synthetic module (#1, #2), which is only needed to ensure we use the same instance of jQuery, in case if an app depends on jQuery events. However, when ec-page-object tries to import it in node env, it fails, cause there is no EmberCli build process envolved, and -jquery is not liseted in the package.json.

I think we should isolate -jquery imports in the ember adapters, and use jquery for the rest of the places. So it stays resolvable for node, until Ember specific adapters are used.

Ceibo

seems it does no support node require. Needs some attention.

Test

  • A node.js test needed. It should serve a dummy page, page.visit((via a custom Adapter for node.js), and do a smoke test of the page object. Node test #538
@patrickberkeley
Copy link

I'm running into needing this. We use ember-cli-page-object in a number of apps and addons. Now we would like to reuse those page objects outside of ember for end-to-end testing with a tool like cypress.io, selenium, bigtest.

Due to the structure of this repo (index.js, package.json, exports, etc.) it's proving difficult to make ember-cli-page object's functions available outside of an ember app.

In addition to the issues listed above in this issue description (decoupling from ember specific dependencies), I'm wondering if it would make sense to split the core functionality for creating and querying page objects into a separate non-ember node package. Then consume that new package in ember-cli-page-object. This is a similar pattern to what ember-cli-mirage did with miragejs I believe, and would allow – and ensure – the core functionality is usable outside of ember.

@ro0gr
Copy link
Collaborator Author

ro0gr commented Sep 22, 2020

I'm wondering if it would make sense to split the core functionality for creating and querying page objects into a separate non-ember node package.

Yes, definitely! My current intention is to make ec-page-object node.js compatible at the first place. This way, from the node.js user's perspective, the import paths would be ugly, like:

// since we would not do the ember-cli pipeline tricks with the import paths
import { clickable } from 'ember-cli-page-object/addon-test-support';

After that, when all the internals are ready, we can extract the core into a framework independent package with the minimal changes, and provide better import paths for the end user of the core.

ro0gr added a commit to ro0gr/ember-cli-page-object that referenced this issue Nov 22, 2020
in main collection.

This is done in scope of removing depdencies on Ember
see san650#512
ro0gr added a commit to ro0gr/ember-cli-page-object that referenced this issue Nov 22, 2020
in the main `collection`.

This is done in scope of removing depdencies on Ember
see san650#512
ro0gr added a commit that referenced this issue Jan 6, 2021
in the main `collection`.

This is done in scope of removing depdencies on Ember
see #512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants