-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create dhis2 cypress utility lib
- Loading branch information
0 parents
commit c07e3a4
Showing
31 changed files
with
8,232 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
> 0.5% | ||
last 2 versions | ||
Firefox ESR | ||
not ie 11 | ||
not dead |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
version: 1 | ||
|
||
update_configs: | ||
- package_manager: 'javascript' | ||
directory: '/' | ||
update_schedule: 'daily' | ||
version_requirement_updates: 'increase_versions' | ||
target_branch: 'master' | ||
automerged_updates: | ||
- match: | ||
dependency_name: '@dhis2/*' | ||
dependency_type: 'all' | ||
update_type: 'semver:minor' | ||
- match: | ||
dependency_type: 'all' | ||
update_type: 'security:patch' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# For more information about the properties used in | ||
# this file, please see the EditorConfig documentation: | ||
# https://editorconfig.org/ | ||
|
||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const { config } = require('@dhis2/cli-style') | ||
|
||
module.exports = { | ||
extends: [config.eslint], | ||
globals: { | ||
cy: "readonly", | ||
Cypress: "readonly", | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
titleOnly: false | ||
commitsOnly: false | ||
titleAndCommits: true | ||
allowMergeCommits: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_extends: .github |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules/ | ||
dist/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const { config } = require('@dhis2/cli-style') | ||
const husky = require(config.husky) | ||
|
||
const tasks = arr => arr.join(' && ') | ||
|
||
module.exports = { | ||
hooks: { | ||
...husky.hooks, | ||
'pre-commit': tasks([ | ||
'd2-style js check --staged', | ||
'd2-style text check --staged', | ||
]), | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const { config } = require('@dhis2/cli-style') | ||
|
||
module.exports = { | ||
...require(config.prettier), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# cli- | ||
|
||
> This package is part of the [@dhis2/cli](https://github.com/dhis2/cli) | ||
> commandline interface. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env node | ||
const { makeEntryPoint, notifyOfUpdates } = require('@dhis2/cli-helpers-engine') | ||
|
||
const pkgJson = require('../package.json') | ||
const command = require('../src') | ||
|
||
notifyOfUpdates(pkgJson) | ||
makeEntryPoint(command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const cucumber = require('cypress-cucumber-preprocessor').default | ||
|
||
module.exports = cucumber |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- [**Getting Started**](getting-started) | ||
- | ||
- [API Reference](api) | ||
- [Changelog](CHANGELOG) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Install the tool | ||
|
||
First up, add the tool as a development dependency in your project. | ||
|
||
``` | ||
yarn add --dev @dhis2/cli-utils-cypress | ||
``` | ||
|
||
From here, it is possible to use Yarn/npx to execute the tool: | ||
|
||
``` | ||
yarn d2-utils-cypress | ||
npx --no-install d2-utils-cypress | ||
``` | ||
|
||
We are going to use `d2-utils-cypress` in this document, so prefix the | ||
commands with your preference. | ||
|
||
# Setup Cypress for your project | ||
|
||
The CLI module provides an `install` command, that will set up some | ||
prerequisites for Cypress, and guide you through generating a | ||
configuration and a local environment configuration file. | ||
|
||
``` | ||
d2-utils-cypress install | ||
``` | ||
|
||
There are additional options to do more specific configuration as well, | ||
check out all the options with the `--help` command. | ||
|
||
E.g. to set up Cypress without the support scripts: | ||
|
||
``` | ||
d2-utils-cypress install --no-support | ||
``` | ||
|
||
And to install without the Cypress configuration, for example on a | ||
developer machine: | ||
|
||
``` | ||
d2-utils-cypress install \ | ||
--no-cypress-config \ | ||
--no-support | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[build] | ||
command = "yarn build" | ||
publish = "dist" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{ | ||
"name": "@dhis2/cli-utils-cypress", | ||
"description": "DHIS2 Cypress configuration and utilities", | ||
"repository": "[email protected]:dhis2/cli-utils-helper.git", | ||
"bin": { | ||
"d2-utils-cypress": "./bin/d2-utils-cypress" | ||
}, | ||
"version": "1.0.0", | ||
"author": "Viktor Varland <[email protected]>", | ||
"license": "BSD-3-Clause", | ||
"private": false, | ||
"scripts": { | ||
"lint": "yarn lint:js && yarn lint:text", | ||
"lint:js": "d2-style js check", | ||
"lint:text": "d2-style text check", | ||
"lint:staged": "yarn lint:js --staged && yarn lint:text --staged", | ||
"format": "yarn format:js && yarn format:text", | ||
"format:js": "d2-style js apply", | ||
"format:text": "d2-style text apply", | ||
"format:staged": "yarn format:js --staged && yarn format:text --staged", | ||
"build": "d2-utils-docsite build ./docs -o ./dist --jsdoc src/ --jsdocOutputFile api.md", | ||
"start": "d2-utils-docsite serve ./docs -o ./dist --jsdoc src/ --jsdocOutputFile api.md" | ||
}, | ||
"dependencies": { | ||
"@dhis2/cli-helpers-engine": "^1.5.0", | ||
"cross-spawn": "^7.0.1", | ||
"cypress": "^4.0.1", | ||
"cypress-cucumber-preprocessor": "^2.0.1", | ||
"fs-extra": "^8.1.0", | ||
"inquirer": "^7.0.4" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"devDependencies": { | ||
"@dhis2/cli-style": "^6.0.0", | ||
"@dhis2/cli-utils-docsite": "^1.3.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
const plugins = require('./src/cypress/plugins.js') | ||
|
||
module.exports = plugins |
Oops, something went wrong.