Skip to content

Commit

Permalink
chore: keep cypress-cloud name
Browse files Browse the repository at this point in the history
  • Loading branch information
agoldis committed Mar 9, 2023
1 parent 68797f9 commit 4ffd87d
Show file tree
Hide file tree
Showing 19 changed files with 100 additions and 94 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/1.bug.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Bug report
description: Create a report to help us improve @currents/cypress
description: Create a report to help us improve cypress-cloud
labels: bug

body:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmark-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
FORCE_COLOR: 2 # for chalk tests
COMMIT_INFO_MESSAGE: "[cypress-cloud] ${{ github.event.head_commit.message }}"
run: |
npm link @currents/cypress
npm link cypress-cloud
npx cypress-cloud run --record --parallel \
--spec "./cypress/e2e*/*.spec.js" \
--browser chrome --key ${{ secrets.CURRENTS_RECORD_KEY }} \ --ci-build-id "cloud-${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt}}" --tag cypress-cloud,gha
2 changes: 1 addition & 1 deletion .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
env:
CURRENTS_API_URL: http://localhost:1234
run: |
npm link @currents/cypress
npm link cypress-cloud
npx cypress-cloud run --record --parallel \
--spec "./cypress/e2e_smoke/*.spec.js" \
Expand Down
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Cypress Cloud (@currents/cypress)
# Cypress Cloud: Debug, troubleshoot and record Cypress CI tests in Cloud

Integrate Cypress with alternative cloud services like Currents or Sorry Cypress.

Expand All @@ -12,12 +12,16 @@ Integrate Cypress with alternative cloud services like Currents or Sorry Cypress

[Changelog](./CHANGELOG.md) | [License](./LICENSE)

## Requirements

The package requires cypress version 10+.

## Setup

The package requires cypress version 10+. Install the package:
Install the package:

```sh
npm install @currents/cypress
npm install cypress-cloud
```

Create a new configuration file: `currents.config.js` in the project’s root, set the `projectId` and the record key obtained from [Currents](https://app.currents.dev) or your self-hosted instance of Sorry Cypress:
Expand All @@ -30,12 +34,12 @@ module.exports = {
};
```

Add `@currents/cypress/plugin` plugin to `cypress.config.{js|ts|mjs}`
Add `cypress-cloud/plugin` to `cypress.config.{js|ts|mjs}`

```js
// cypress.config.js
const { defineConfig } = require("cypress");
const { cloudPlugin } = require("@currents/cypress/plugin");
const { cloudPlugin } = require("cypress-cloud/plugin");
module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
Expand Down Expand Up @@ -97,7 +101,7 @@ run(params: CurrentsRunParameters): Promise<CypressCommandLine.CypressRunResult
Example:

```ts
import { run } from "@currents/cypress";
import { run } from "cypress-cloud";

const results = await run({
reporter: "junit",
Expand Down
8 changes: 5 additions & 3 deletions examples/webapp/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Example Usage of Cypress Cloud (@currents/cypress)
# Example Usage of Cypress Cloud

## CLI Usage

To run the example, make sure that you have an account at https://app.currents.dev (or Sorry Cypress instance).

### E2E tests
### Configuration

Update `currents.config.js` with the `projectId`, `recordKey` obtained from a cloud orchestration service. Sorry Cypress users - use the director service URL as `recordServiceUrl`.

Update `currents.config.js` with the `projectId` obtained from a cloud orchestration service.
### E2E tests

```sh
npm install
Expand Down
2 changes: 1 addition & 1 deletion examples/webapp/currents.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ module.exports = {
},
projectId: !!(process.env.GITHUB_ACTION || process.env.CIRCLE_BRANCH)
? "Ij0RfK"
: "Ij0RfK",
: "l4zuz8",
// recordKey: process.env.CURRENTS_RECORD_KEY,
};
2 changes: 1 addition & 1 deletion examples/webapp/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import currents from "@currents/cypress/plugin";
import { defineConfig } from "cypress";
import currents from "cypress-cloud/plugin";

module.exports = defineConfig({
e2e: {
Expand Down
2 changes: 1 addition & 1 deletion examples/webapp/cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require("cypress-terminal-report/src/installLogsCollector")();
require("@currents/cypress/support");
require("cypress-cloud/support");
require("./commands");
beforeEach(() => {
cy.visit("/");
Expand Down
2 changes: 1 addition & 1 deletion examples/webapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"cypress:script": "ts-node scripts/currents-script.ts"
},
"dependencies": {
"@currents/cypress": "*",
"cypress-cloud": "*",
"cypress": "^12.6.0",
"cypress-terminal-report": "^5.0.0",
"next": "^13.2.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/webapp/scripts/currents-script.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { run } from "@currents/cypress";
import { run } from "cypress-cloud";

(async function runTests() {
const projectId = process.env.CURRENTS_PROJECT_ID || "";
Expand Down
127 changes: 63 additions & 64 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion packages/cypress-cloud/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module.exports = {
"^.+\\.tsx?$": "@swc/jest",
},
moduleNameMapper: {
"@currents/cypress/(.*)$": "<rootDir>/../cypress-cloud/$1",
"cypress-cloud/(.*)$": "<rootDir>/../cypress-cloud/$1",
},
transformIgnorePatterns: ["node_modules"],
moduleFileExtensions: ["ts", "js", "d.ts"],
Expand Down
6 changes: 3 additions & 3 deletions packages/cypress-cloud/lib/api/__tests__/api.run.test.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { createRun, CreateRunResponse } from "@currents/cypress/lib/api";
import { getBaseUrl } from "@currents/cypress/lib/httpClient/config";
import { createRun, CreateRunResponse } from "cypress-cloud/lib/api";
import { getBaseUrl } from "cypress-cloud/lib/httpClient/config";
import nock from "nock";
import { printWarnings } from "../warnings";
import { createRunPayload, createRunResponse } from "./fixtures/run";

jest.mock("../warnings");
jest.mock("@currents/cypress/lib/httpClient/config", () => ({
jest.mock("cypress-cloud/lib/httpClient/config", () => ({
getBaseUrl: jest.fn().mockReturnValue("http://localhost:1234"),
}));

Expand Down
2 changes: 1 addition & 1 deletion packages/cypress-cloud/lib/api/types/instance.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Platform, ScreenshotArtifact } from "@currents/cypress/types";
import { Platform, ScreenshotArtifact } from "cypress-cloud/types";
import { SetTestsPayload, Test } from "./test";

export interface Screenshot {
Expand Down
4 changes: 2 additions & 2 deletions packages/cypress-cloud/lib/api/types/run.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { CiParams, CiProvider } from "@currents/cypress/lib/ciProvider";
import { Platform } from "@currents/cypress/types";
import { CiParams, CiProvider } from "cypress-cloud/lib/ciProvider";
import { Platform } from "cypress-cloud/types";

export type CreateRunPayload = {
ci: {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import * as log from "@currents/cypress/lib/log";
import { expect } from "@jest/globals";
import * as log from "cypress-cloud/lib/log";
import nock from "nock";
import { makeRequest } from "../httpClient";
import { formatGenericError } from "../printErrors";

jest.mock("@currents/cypress/lib/log");
jest.mock("cypress-cloud/lib/log");

const apiMock = nock("https://cy.currents.dev");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import * as log from "@currents/cypress/lib/log";
import * as log from "cypress-cloud/lib/log";
import nock from "nock";
import { getBaseUrl, getDelay, isRetriableError } from "../config";
import { makeRequest } from "../httpClient";

jest.mock("../config");
jest.mock("@currents/cypress/lib/log");
jest.mock("cypress-cloud/lib/log");

(getBaseUrl as jest.Mock).mockReturnValue("http://localhost:1234");
const apiMock = nock(getBaseUrl()).persist();
Expand Down
2 changes: 1 addition & 1 deletion packages/cypress-cloud/lib/results/results.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
CypressResult,
ScreenshotArtifact,
TestsResult,
} from "@currents/cypress/types";
} from "cypress-cloud/types";
import Debug from "debug";
import { nanoid } from "nanoid";
import {
Expand Down
2 changes: 1 addition & 1 deletion packages/cypress-cloud/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@currents/cypress",
"name": "cypress-cloud",
"version": "1.0.0",
"main": "./out/index.js",
"types": "./index.ts",
Expand Down

0 comments on commit 4ffd87d

Please sign in to comment.