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

Convert to v2 addon #576

Merged
merged 6 commits into from
Jul 30, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

root = true


[*]
end_of_line = lf
charset = utf-8
Expand Down
69 changes: 54 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,72 +2,105 @@ name: CI

on:
push:
pull_request:
branches:
- main
- master
pull_request: {}

concurrency:
group: ci-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
test:
name: "Tests"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Node
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: 12.x
cache: npm

- name: npm8
run: npm install -g npm@8
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm@8 is needed for workspaces support


- name: Install Dependencies
run: npm ci
- name: Lint js
run: npm run lint:js
- name: Lint hbs
run: npm run lint:hbs

- name: Lint Addon
run: npm run lint
working-directory: addon

- name: Lint Test App
run: npm run lint
working-directory: test-app

- name: Run Tests
run: npm run test:ember
- name: Pack
run: npm pack
working-directory: test-app

floating:
name: "Floating Dependencies"
name: "Floating Dependencies ${{ matrix.node-version }}"
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [12.x, 14.x]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: npm8
run: npm install -g npm@8

- name: Install Dependencies
run: npm install --no-package-lock

- name: Run Tests
run: npm run test:ember
working-directory: test-app

node-tests:
name: "Node tests ${{ matrix.try-scenario }}"
name: "Node tests ${{ matrix.node-version }}"
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [12.x, 14.x, 16.x]

steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: npm8
run: npm install -g npm@8

- name: Install Dependencies
run: npm ci

- name: Run Tests
run: npm run nodetest
run: npm run test
working-directory: addon

try-scenarios:
name: ${{ matrix.try-scenario }}
runs-on: ubuntu-latest
needs: 'test'

strategy:
fail-fast: false
matrix:
try-scenario:
- ember-lts-3.24
Expand All @@ -87,7 +120,13 @@ jobs:
with:
node-version: 12.x
cache: npm

- name: npm8
run: npm install -g npm@8

- name: Install Dependencies
run: npm ci

- name: Run Tests
run: ./node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
run: ../node_modules/.bin/ember try:one ${{ matrix.try-scenario }}
working-directory: test-app
42 changes: 18 additions & 24 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,34 +1,28 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# See https://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist/
/tmp/
/tmp_docs
dist/
tmp_docs/

# dependencies
/bower_components/
/node_modules/
yarn.lock
node_modules/

# *.md copies from release
/addon/README.md
/addon/LICENSE.md

# misc
/.sass-cache
/.eslintcache
/connect.lock
/coverage/
/libpeerconnection.log
.env*
.eslintcache
.pnp*
.sass-cache
connect.lock
coverage/
libpeerconnection.log
npm-debug.log*
testem.log
LICENSE.md
/docs
/_site
/yarn-error.log
jsconfig.json
yarn-error.log
.DS_Store

# IDE/editor files
/.idea/
/*.iml

# ember-try
/.node_modules.ember-try/
/bower.json.ember-try
/package.json.ember-try
/*.iml
33 changes: 22 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
# How To Contribute

This repo is divided into multiple packages using npm workspaces:

- `addon` is the actual ember-cli-page-object addon
- `test-app` is its test suite
- `docs` is the documentation/marketing site

## Installation

* `git clone <repository-url>`
* `cd my-addon`
* `git clone https:/san650/ember-cli-page-object.git`
* `cd ember-cli-page-object`
* `npm install`

## Linting

* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint:js -- --fix`
Inside any of the packages you can run:

* `npm run lint`
* `npm run lint:fix`

## Running tests

* `ember test` – Runs the test suite on the current Ember version
* `ember test --server` – Runs the test suite in "watch mode"
* `ember try:each` – Runs the test suite against multiple Ember versions
* `cd addon && npm run start` – Builds the addon in "watch mode" so changes picked up by test app.
* `cd test-app && ember test` – Runs the test suite on the current Ember version
* `cd test-app && ember test --server` – Runs the test suite in "watch mode"
* `cd test-app && ember try:each` – Runs the test suite against multiple Ember versions

During development, if you'd like test app to pick up changes in the addon, make sure to run both
`cd addon && npm run start` and `cd test-app && ember test --server` in different terminals.

## Running the dummy application
## Running the test application

* `ember serve`
* Visit the dummy application at [http://localhost:4200](http://localhost:4200).
* `cd test-app && ember serve`
* Visit the test application at [http://localhost:4200](http://localhost:4200).

For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/).
19 changes: 0 additions & 19 deletions LICENSE

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2021
Copyright (c) 2015-2022 Santiago Ferreira

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
38 changes: 13 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Ember Page Objects
# Ember CLI Page Object

[![Build Status](https://travis-ci.org/san650/ember-cli-page-object.svg?branch=master)](https://travis-ci.org/san650/ember-cli-page-object)
[![Ember Observer Score](http://emberobserver.com/badges/ember-cli-page-object.svg)](http://emberobserver.com/addons/ember-cli-page-object)
Expand All @@ -24,9 +24,12 @@ You can find more information about this design pattern here:
* [Page Objects - Selenium wiki](https:/SeleniumHQ/selenium/wiki/PageObjects)
* [PageObject - Martin Fowler](http://martinfowler.com/bliki/PageObject.html)

Compatibility
------------------------------------------------------------------------------

* Ember.js v3.16 or above
* Ember CLI v2.13 or above
* Node.js v10 or above
* Node.js v12 or above
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

engines field already requires v12, hence it's not technically dropping support for Node.js v10 but a correction in readme


Let's work together to improve this addon!

Expand All @@ -45,11 +48,13 @@ Or you can install the NPM package directly.
$ npm install --save-dev ember-cli-page-object
```

## Documentation
Documentation
------------------------------------------------------------------------------

Check the [site](http://ember-cli-page-object.js.org/) for full documentation.

## Blueprints
Blueprints
------------------------------------------------------------------------------

The addon includes the following blueprints

Expand All @@ -66,27 +71,10 @@ installing
create tests/pages/users.js
```

## Development

### Installation

```sh
$ git clone https:/san650/ember-cli-page-object.git
$ cd $_
$ yarn install # or npm install
```

### Linting

* `npm run lint:hbs`
* `npm run lint:js`
* `npm run lint:js -- --fix`

### Running Tests
Contributing
------------------------------------------------------------------------------

* `ember test` – Runs the test suite on the current Ember version
* `ember test --server` – Runs the test suite in "watch mode"
* `ember try:each` – Runs the test suite against multiple Ember versions
See the [Contributing](CONTRIBUTING.md) guide for details.

### Project's health

Expand All @@ -110,4 +98,4 @@ $ yarn install # or npm install

ember-cli-page-object is licensed under the MIT license.

See [LICENSE](./LICENSE) for the full license text.
See [LICENSE](./LICENSE.md) for the full license text.
15 changes: 15 additions & 0 deletions addon/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# unconventional js
/blueprints/*/files/

# compiled output
/dist/
/tmp/

# dependencies
/node_modules/

# misc
/coverage/
!.*
.*/
.eslintcache
Loading