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

8157 remove cypress nx generator - DO NOT MERGE UNTIL V2.0.7 published with deprecation notice #324

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
32 changes: 16 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,41 +130,41 @@ applicable:
own generator. Alternatively, if the additional behaviour is only small, you
could also consider adding this as a optional part of the init schema).

**_Cypress Example:_**
**_Playwright Example:_**

**@ensono-stacks/cypress:init** - Add a cypress testing framework to an
**@ensono-stacks/playwright:init** - Add a Playwright testing framework to an
application and configures everything surrounding the test execution and
reporting

**@ensono-stacks/cypress:init-deployment** - Adds e2e tests as a stage within
**@ensono-stacks/playwright:init-deployment** - Adds e2e tests as a stage within
pipeline execution and reporting to azure

**@ensono-stacks/cypress:accessibility** - Adds accessibility tests and it's
**@ensono-stacks/playwright:accessibility** - Adds accessibility tests and it's
dependencies/configuration to the application/project

### Development process

From a process perspective, it is recommended to develop your desired end state
first, which can then be reverse engineered back into a plugin/generators. Here
is an example of the process followed for creating our `@ensono-stacks/cypress`
is an example of the process followed for creating our `@ensono-stacks/playwright`
plugin:

**_Step 1: Creating your end state_**

- Create a baseline workspace with a Next.js application. Commit this to your
`main` branch

- Create a new branch, e.g. `cypress-baseline` for the _init_ generator. In
this branch, install and configure the Cypress testing framework with the
- Create a new branch, e.g. `playwright-baseline` for the _init_ generator. In
this branch, install and configure the Playwright testing framework with the
required configurations.

- Create a new branch from `cypress-baseline` for the _init-deployment_
generator (`cypress-deployment`), adding the additional requirements for
deploying your application with cypress tests.
- Create a new branch from `playwright-baseline` for the _init-deployment_
generator (`playwright-deployment`), adding the additional requirements for
deploying your application with Playwright tests.

- Create a new branch from `cypress-baseline` for the _accessibility_
generator (`cypress-accessibility`), adding the additional requirements for
adding accessibility tests using cypress to your application.
- Create a new branch from `playwright-baseline` for the _accessibility_
generator (`playwright-accessibility`), adding the additional requirements for
adding accessibility tests using Playwright to your application.

**_Step 2: Create your plugin, generators and unit tests._**

Expand All @@ -189,17 +189,17 @@ nx generate @nx/plugin:generator <generator name> --project=<plugin name>
```

- _init_ generator: Use Git to review the differences between the
`cypress-baseline` branch and the `main` branch. This will help identify the
`playwright-baseline` branch and the `main` branch. This will help identify the
files your generator needs to manipulate or create, then write all of the
unit tests to check that the desired end state is met.

- _init-deployment_ generator: Use Git to review the differences between the
`cypress-deployment` branch and the `cypress-baseline` branch. This will
`playwright-deployment` branch and the `playwright-baseline` branch. This will
help identify files which need to be amended/created on top of the _init_
files and create your unit tests.

- _accessibility_ generator: Use Git to review the differences between the
`cypress-accessibility` branch and the `cypress-baseline` branch. Again
`playwright-accessibility` branch and the `playwright-baseline` branch. Again
creating the relevant unit tests.

**_Step 3: Implementation_**
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ projects, we have several stacks plugins available!

| Plugin | Description |
| :------------------------------------------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`@ensono-stacks/create-stacks-workspace`](https://stacks.ensono.com/docs/getting_started/create-stacks-workspace/ensono-stacks-create-stacks-workspace) | Create an Nx workspace using stacks!<li>Create an Nx workspace for a Next application with your choice of testing framework!</li><li>Create a testing project for the generated Next application. Supported: Playwright & Cypress</li> |
| [`@ensono-stacks/create-stacks-workspace`](https://stacks.ensono.com/docs/getting_started/create-stacks-workspace/ensono-stacks-create-stacks-workspace) | Create an Nx workspace using stacks!<li>Create an Nx workspace for a Next application with your choice of testing framework!</li><li>Create a testing project for the generated Next application. Supported: Playwright</li> |
| [`@ensono-stacks/workspace`](https://stacks.ensono.com/docs/getting_started/workspace/ensono-stacks-workspace) | 'Stackify' your existing Nx workspace<li>Add build and deploy infrastructure to your workspace</li><li>Set up libraries to manage code & commit quality</li> |
| [`@ensono-stacks/next`](https://stacks.ensono.com/docs/getting_started/next/ensono-stacks-next) | Enhance your Next.js project with Stacks!<li>Add stacks configuration and developer tools to an existing next application</li><li>Add NextAuth.js to your next application</li><li>Add build and deploy infrastructure to your next application</li> |
| [`@ensono-stacks/azure-node`](https://stacks.ensono.com/docs/getting_started/azure-node/ensono-stacks-azure-node) | <li>Add Azure app insights to a node project in your stacks workspace</li> |
Expand Down
1 change: 0 additions & 1 deletion e2e/create-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"create",
"workspace",
"next",
"cypress",
"playwright"
],
"targets": {
Expand Down
18 changes: 0 additions & 18 deletions e2e/create-e2e/tests/create.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,24 +215,6 @@ describe('create', () => {
expect(() => run()).not.toThrow();
});

it('can install with cypress set as e2eTestRunner', async () => {
const run = () =>
execSync(
`npx --yes @ensono-stacks/create-stacks-workspace@latest proj --nxVersion=${nxVersion} --business.company=Ensono --business.domain=Stacks --business.component=Nx --cloud.platform=azure --cloud.region=euw --domain.internal=nonprod.amidostacks.com --domain.external=prod.amidostacks.com --terraform.group=tf-group --terraform.storage=tf-storage --terraform.container=tf-container --vcs.type=github --preset=next --appName=test-app --e2eTestRunner=cypress --nxCloud=skip --skipGit --no-interactive --verbose`,
{
cwd: temporaryDirectory,
stdio: 'inherit',
env: {
...process.env,
npm_config_cache: cacheDirectory,
HUSKY: '0',
},
},
);

expect(() => run()).not.toThrow();
});

it('can install different nx version', async () => {
const run = () =>
execSync(
Expand Down
16 changes: 0 additions & 16 deletions e2e/cypress-e2e/jest.config.ts

This file was deleted.

20 changes: 0 additions & 20 deletions e2e/cypress-e2e/project.json

This file was deleted.

146 changes: 0 additions & 146 deletions e2e/cypress-e2e/tests/cypress.spec.ts

This file was deleted.

10 changes: 0 additions & 10 deletions e2e/cypress-e2e/tsconfig.json

This file was deleted.

9 changes: 0 additions & 9 deletions e2e/cypress-e2e/tsconfig.spec.json

This file was deleted.

16 changes: 0 additions & 16 deletions migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,6 @@
"package": "@nx/jest",
"name": "move-options-to-target-defaults"
},
{
"cli": "nx",
"version": "16.8.0-beta.4",
"description": "Update to Cypress v13. Most noteable change is video recording is off by default. This migration will only update if the workspace is already on Cypress v12. https://docs.cypress.io/guides/references/migration-guide#Migrating-to-Cypress-130",
"implementation": "./src/migrations/update-16-8-0/cypress-13",
"package": "@nx/cypress",
"name": "update-16-8-0-cypress-13"
},
{
"cli": "nx",
"version": "18.1.0-beta.3",
"description": "Update to Cypress ^13.6.6 if the workspace is using Cypress v13 to ensure workspaces don't use v13.6.5 which has an issue when verifying Cypress.",
"implementation": "./src/migrations/update-18-1-0/update-cypress-version-13-6-6",
"package": "@nx/cypress",
"name": "update-cypress-version-13-6-6"
},
{
"cli": "nx",
"version": "17.2.7",
Expand Down
Loading
Loading