Skip to content

Commit

Permalink
#15: install package from npmjs instead of github packages (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaswinkler authored Nov 7, 2023
1 parent 929b518 commit a6b4c16
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
19 changes: 7 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Contribute by raising pull requests. All commands must be documented and, if pos
- [Test access of DOM elements](#test-access-of-dom-elements)
- [Test requests](#test-requests)
- [Test interceptions](#test-interceptions)
- [Disclaimer](#disclaimer)

# Overview of commands

Expand All @@ -46,19 +47,11 @@ Current set of commands include

# Installation and setup

There is different ways to install and use the Cumulocity commands in your repository. Simplest way is to add npm package dependency.

Create or update `.npmrc` file in your project to configure the registry for `softwareag` the context.

```
@softwareag:registry=https://npm.pkg.github.com
```

Add dependency to your package.json.

```bash
npm install @softwareag/cumulocity-cypress --save-dev
yarn add -D @softwareag/cumulocity-cypress
npm install cumulocity-cypress --save-dev
yarn add -D cumulocity-cypress
```

You also need to have `@c8y/client` installed and make it available within the tested project as `cumulocity-cypress` defines `@c8y/client` as a peer-dependency. This is to ensure the version of `@c8y/client` to be used is the same as in the hosted test project.
Expand Down Expand Up @@ -86,13 +79,13 @@ Update your projects `e2e.supportFile` (e.g. `cypress/support/e2e.ts`) to make c
Import all commands:

```typescript
import "@softwareag/cumulocity-cypress/lib/commands/";
import "cumulocity-cypress/lib/commands/";
```

Import selected commands:

```typescript
import "@softwareag/cumulocity-cypress/lib/commands/request";
import "cumulocity-cypress/lib/commands/request";
```

With this, also in the support file of your Cypress project, you can init environment variables as for example with:
Expand Down Expand Up @@ -491,6 +484,8 @@ cy.disableGainsight()

-----------

# Disclaimer

These tools are provided as-is and without warranty or support. They do not constitute part of the Software AG product suite. Users are free to use, fork and modify them, subject to the license agreement. While Software AG welcomes contributions, we cannot guarantee to include every contribution in the master project.

For more information you can Ask a Question in the [TECH Community Forums](https://tech.forums.softwareag.com/tag/Cumulocity-IoT).
Expand Down
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@softwareag/cumulocity-cypress",
"version": "0.2.2",
"name": "cumulocity-cypress",
"version": "0.2.4",
"description": "Cypress commands for Cumulocity IoT",
"main": "lib/commands/index.js",
"scripts": {
Expand All @@ -14,15 +14,21 @@
"build": "npm run clean && npm run copy-files && tsc && cd dist/ && npm run clean-package-json",
"clean-package-json": "npm pkg delete 'devDependencies' && npm pkg delete 'scripts'"
},
"repository": "https://github.com/SoftwareAG/cumulocity-cypress.git",
"repository": {
"type": "git",
"url": "https://github.com/SoftwareAG/cumulocity-cypress.git"
},
"keywords": [
"Cypress",
"Cumulocity",
"IoT",
"Test"
],
"author": "Thomas Winkler",
"author": "twi@softwareag.com",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/SoftwareAG/cumulocity-cypress/issues"
},
"dependencies": {
"date-fns": "^2.30.0",
"semver": "^7.5.2"
Expand All @@ -38,6 +44,7 @@
"typescript": "^5.0.2"
},
"peerDependencies": {
"@c8y/client": ">=1015.0.0"
"@c8y/client": ">=1015.0.0",
"cypress": ">=12.0.0"
}
}

0 comments on commit a6b4c16

Please sign in to comment.