Skip to content

Commit

Permalink
Merge pull request #366 from manuelosorio/feature/add-cypress
Browse files Browse the repository at this point in the history
[Feature] Add cypress
  • Loading branch information
manuelosorio authored Sep 8, 2024
2 parents bbf20cf + 1b4c94d commit 17a2dde
Show file tree
Hide file tree
Showing 86 changed files with 901 additions and 111 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified .yarn/install-state.gz
Binary file not shown.
70 changes: 57 additions & 13 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,21 @@
"build": {
"builder": "@angular-builders/custom-esbuild:application",
"options": {
"plugins": ["./esbuild/plugins.ts"],
"plugins": [
"./esbuild/plugins.ts"
],
"outputPath": "dist",
"index": "src/index.html",
"browser": "src/main.ts",
"polyfills": ["src/polyfills.ts"],
"polyfills": [
"src/polyfills.ts"
],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "sass",
"stylePreprocessorOptions": {
"includePaths": [""]
"includePaths": [
""
]
},
"allowedCommonJsDependencies": [
"socket.io-client",
Expand All @@ -40,7 +46,9 @@
"src/assets",
"src/robots.txt"
],
"styles": ["src/styles.sass"],
"styles": [
"src/styles.sass"
],
"scripts": [],
"server": "src/main.server.ts",
"prerender": false,
Expand Down Expand Up @@ -110,20 +118,31 @@
"test": {
"builder": "@angular-builders/jest:run",
"options": {
"main": ["src/test.ts"],
"polyfills": ["src/polyfills.ts"],
"main": [
"src/test.ts"
],
"polyfills": [
"src/polyfills.ts"
],
"tsConfig": "tsconfig.spec.json",
"configPath": "./jest.config.ts",
"assets": ["src/favicon.ico", "src/assets", "src/robots.txt"],
"styles": ["src/styles.sass"],
"assets": [
"src/favicon.ico",
"src/assets",
"src/robots.txt"
],
"styles": [
"src/styles.sass"
],
"scripts": []
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"builder": "@cypress/schematic:cypress",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "listet:serve"
"devServerTarget": "listet:serve",
"watch": true,
"headless": false
},
"configurations": {
"production": {
Expand All @@ -134,14 +153,39 @@
"lint": {
"builder": "@angular-eslint/builder:lint",
"options": {
"lintFilePatterns": ["src/**/*.ts", "src/**/*.html"]
"lintFilePatterns": [
"src/**/*.ts",
"src/**/*.html"
]
}
},
"cypress-run": {
"builder": "@cypress/schematic:cypress",
"options": {
"devServerTarget": "listet:serve"
},
"configurations": {
"production": {
"devServerTarget": "listet:serve:production"
}
}
},
"cypress-open": {
"builder": "@cypress/schematic:cypress",
"options": {
"watch": true,
"headless": false
}
}
}
}
},
"cli": {
"schematicCollections": ["@angular-eslint/schematics"]
"schematicCollections": [
"@cypress/schematic",
"@angular-eslint/schematics",
"@schematics/angular"
]
},
"schematics": {
"@angular-eslint/schematics:application": {
Expand Down
7 changes: 7 additions & 0 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { defineConfig } from 'cypress';

export default defineConfig({
e2e: {
baseUrl: 'http://localhost:4200',
},
});
6 changes: 6 additions & 0 deletions cypress/e2e/spec.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
describe('My First Test', () => {
it('Visits the initial project page', () => {
cy.visit('/');
cy.get('title').should('contain', 'Listet');
});
});
5 changes: 5 additions & 0 deletions cypress/fixtures/example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Using fixtures to represent data",
"email": "[email protected]"
}

43 changes: 43 additions & 0 deletions cypress/support/commands.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// ***********************************************
// This example namespace declaration will help
// with Intellisense and code completion in your
// IDE or Text Editor.
// ***********************************************
// declare namespace Cypress {
// interface Chainable<Subject = any> {
// customCommand(param: any): typeof customCommand;
// }
// }
//
// function customCommand(param: any): void {
// console.warn(param);
// }
//
// NOTE: You can use it like so:
// Cypress.Commands.add('customCommand', customCommand);
//
// ***********************************************
// 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
// ***********************************************
//
//
// -- This is a parent command --
// Cypress.Commands.add("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) => { ... })
17 changes: 17 additions & 0 deletions cypress/support/e2e.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ***********************************************************
// This example support/e2e.ts is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// automatically serving support files with the
// 'supportFile' configuration option.
//
// You can read more here:
// https://on.cypress.io/configuration
// ***********************************************************

// When a command from ./commands is ready to use, import with `import './commands'` syntax
// import './commands';
8 changes: 8 additions & 0 deletions cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../tsconfig.json",
"include": ["**/*.ts"],
"compilerOptions": {
"sourceMap": false,
"types": ["cypress"]
}
}
32 changes: 0 additions & 32 deletions e2e/protractor.conf.js

This file was deleted.

25 changes: 0 additions & 25 deletions e2e/src/app.e2e-spec.ts

This file was deleted.

13 changes: 0 additions & 13 deletions e2e/src/app.po.ts

This file was deleted.

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

This file was deleted.

5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"snyk:protect": "snyk-protect",
"snyk:test": "snyk test",
"format:check": "npx prettier --check .",
"format:write": "npx prettier --write ."
"format:write": "npx prettier --write .",
"cypress:open": "cypress open",
"cypress:run": "cypress run"
},
"private": true,
"dependencies": {
Expand Down Expand Up @@ -62,6 +64,7 @@
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"browser-sync": "^3.0.2",
"cypress": "latest",
"dotenv": "^16.4.5",
"esbuild-plugin-define": "^0.5.0",
"eslint": "^9.0.0",
Expand Down
Loading

0 comments on commit 17a2dde

Please sign in to comment.