chore(nxdev): enable e2e testing for nx-dev (#10088)

* chore(nxdev): enable e2e testing for nx-dev

* chore(nxdev): remove vercel github workflow, run on circle

* chore(repo): try and fix cypress on circle

* chore(repo): try and fix cypress on circle

* chore(repo): update node dep cache key to include package.json
This commit is contained in:
James Henry 2022-05-05 20:54:32 +04:00 committed by GitHub
parent 77cc38a624
commit 03c378cb35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 49 additions and 94 deletions

View File

@ -13,12 +13,14 @@ orbs:
machine:
pre:
- mkdir ~/.cache/yarn
- mkdir ~/.cache/Cypress
- mkdir ~/Library/Caches/Homebrew
- mkdir /usr/local/Homebrew
dependencies:
cache_directories:
- ~/.cache/yarn
- ~/.cache/Cypress
- /usr/local/Homebrew
- ~/Library/Caches/Homebrew
override:
@ -46,6 +48,25 @@ executors:
# COMMANDS
# -------------------------
commands:
run-yarn-install:
parameters:
os:
type: string
steps:
- restore_cache:
name: Restore Yarn Package Cache
keys:
- node-deps-{{ arch }}-v1-{{ checksum "package.json" }}-{{ checksum checksum "yarn.lock" }}
- run:
name: Install dependencies
command: yarn install --prefer-offline --frozen-lockfile --non-interactive --cache-folder ~/.cache/yarn
- save_cache:
name: Save Yarn Package Cache
key: node-deps-{{ arch }}-v1-{{ checksum "package.json" }}-{{ checksum checksum "yarn.lock" }}
paths:
- node_modules
- ~/.cache/yarn
- ~/.cache/Cypress
install-pnpm:
steps:
- run:
@ -80,9 +101,8 @@ commands:
- /usr/local/Homebrew
- ~/Library/Caches/Homebrew
- node/install-packages:
pkg-manager: yarn
include-branch-in-cache-key: false
- run-yarn-install:
os: << parameters.os >>
- when:
condition:
equal: [<< parameters.os >>, linux]
@ -197,7 +217,7 @@ jobs:
- run:
name: Run E2E Tests
command: |
npx nx affected --target=e2e --base=$NX_BASE --head=$NX_HEAD --exclude=e2e-detox,e2e-js,e2e-next,e2e-workspace-create,e2e-workspace-integrations,e2e-workspace-core,e2e-react,e2e-web,e2e-angular-extensions,e2e-angular-core,e2e-cli,e2e-nx-plugin,e2e-cypress,e2e-node,e2e-linter,e2e-jest,e2e-add-nx-to-monorepo --parallel=1
npx nx affected --target=e2e --base=$NX_BASE --head=$NX_HEAD --exclude=e2e-detox,e2e-js,e2e-next,e2e-workspace-create,e2e-workspace-integrations,e2e-workspace-core,e2e-react,e2e-web,e2e-angular-extensions,e2e-angular-core,e2e-cli,e2e-nx-plugin,e2e-cypress,e2e-node,e2e-linter,e2e-jest,e2e-add-nx-to-monorepo,nx-dev-e2e --parallel=1
no_output_timeout: 45m
- run:
name: Stop All Running Agents for This CI Run

View File

@ -1,14 +1,10 @@
{
"extends": ["plugin:cypress/recommended", "../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"rules": {},
"overrides": [
{
"files": ["src/plugins/index.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off",
"no-undef": "off"
}
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {}
}
]
}

View File

@ -3,10 +3,10 @@
"fixturesFolder": "./src/fixtures",
"integrationFolder": "./src/integration",
"modifyObstructiveCode": false,
"pluginsFile": "./src/plugins/index",
"supportFile": "./src/support/index.ts",
"pluginsFile": false,
"video": true,
"videosFolder": "../../dist/cypress/apps/documentation-e2e/videos",
"screenshotsFolder": "../../dist/cypress/apps/documentation-e2e/screenshots",
"videosFolder": "../../dist/cypress/apps/nx-dev-e2e/videos",
"screenshotsFolder": "../../dist/cypress/apps/nx-dev-e2e/screenshots",
"chromeWebSecurity": false
}

View File

@ -2,12 +2,11 @@
"sourceRoot": "nx-dev/nx-dev-e2e/src",
"projectType": "application",
"targets": {
"e2e-disabled": {
"e2e": {
"executor": "@nrwl/cypress:cypress",
"options": {
"cypressConfig": "nx-dev/nx-dev-e2e/cypress.json",
"tsConfig": "nx-dev/nx-dev-e2e/tsconfig.e2e.json",
"devServerTarget": "nx-dev:serve"
"devServerTarget": "nx-dev:serve:development"
},
"configurations": {
"production": {

View File

View File

@ -1,4 +0,0 @@
{
"name": "Using fixtures to represent data",
"email": "hello@cypress.io"
}

View File

@ -1,13 +1,10 @@
import { getGreeting } from '../support/app.po';
describe('documentation', () => {
describe('nx-dev', () => {
beforeEach(() => cy.visit('/'));
it('should display welcome message', () => {
// Custom command example, see `../support/commands.ts` file
cy.login('my-email@something.com', 'myPassword');
// Function helper example, see `../support/app.po.ts` file
getGreeting().contains('Welcome to documentation!');
it('should display the primary heading', () => {
cy.get('[data-cy="primary-heading"]').should(
'contain',
'Smart, Fast and Extensible Build System'
);
});
});

View File

@ -1,20 +0,0 @@
// ***********************************************************
// This example plugins/index.js can be used to load plugins
//
// You can change the location of this file or turn off loading
// the plugins file with the 'pluginsFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/plugins-guide
// ***********************************************************
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)
const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor');
module.exports = (on, config) => {
// `on` is used to hook into various events Cypress emits
// `config` is the resolved Cypress config
// Preprocess Typescript file using Nx helper
};

View File

@ -1 +0,0 @@
export const getGreeting = () => cy.get('h1');

View File

@ -1,33 +1,8 @@
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
// eslint-disable-next-line @typescript-eslint/no-namespace
declare namespace Cypress {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
interface Chainable<Subject> {
login(email: string, password: string): void;
}
}
//
// -- This is a parent command --
Cypress.Commands.add('login', (email, password) => {
console.log('Custom command example: Login', email, password);
});
//
// -- This is a child command --
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
//
//
// -- This is a dual command --
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
//
//
// -- This will overwrite an existing command --
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
declare namespace Cypress {}

View File

@ -1,10 +0,0 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"sourceMap": false,
"outDir": "../../dist/out-tsc",
"allowJs": true,
"types": ["cypress", "node"]
},
"include": ["src/**/*.ts", "src/**/*.js"]
}

View File

@ -1,10 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.e2e.json"
}
]
"compilerOptions": {
"sourceMap": false,
"outDir": "../dist/out-tsc",
"allowJs": true,
"types": ["cypress", "node"]
},
"include": ["src/**/*.ts", "src/**/*.js"]
}

View File

@ -92,7 +92,10 @@ export function Index(): ReactComponentElement<any> {
<div className="md:py-18 mx-auto max-w-screen-lg px-4 py-4 xl:max-w-screen-xl">
<div className="md:my-18 my-8 flex flex-col items-center justify-center 2xl:my-24">
<div className="flex w-full flex-col text-center">
<h1 className="mb-8 text-4xl font-extrabold leading-none tracking-tight sm:mt-10 sm:mt-14 sm:mb-10 sm:text-5xl lg:text-5xl">
<h1
className="mb-8 text-4xl font-extrabold leading-none tracking-tight sm:mt-10 sm:mt-14 sm:mb-10 sm:text-5xl lg:text-5xl"
data-cy="primary-heading"
>
<span className="block lg:inline">
Smart, Fast and Extensible
</span>{' '}