Skip to content

Commit

Permalink
Add cypress config
Browse files Browse the repository at this point in the history
  • Loading branch information
Onitoxan committed Sep 19, 2024
1 parent 7f8682a commit ee846b9
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 15 deletions.
15 changes: 15 additions & 0 deletions apps/hpc-ftsadmin-e2e/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { defineConfig } from 'cypress';

export default defineConfig({
e2e: {
fileServerFolder: '.',
fixturesFolder: './src/fixtures',
modifyObstructiveCode: false,
supportFile: './src/support/index.ts',
specPattern: './src/tests/**/*.cy.{js,jsx,ts,tsx}',
video: true,
videosFolder: '../../dist/cypress/apps/hpc-ftsadmin-e2e/videos',
screenshotsFolder: '../../dist/cypress/apps/hpc-ftsadmin-e2e/screenshots',
chromeWebSecurity: false,
},
});
11 changes: 0 additions & 11 deletions apps/hpc-ftsadmin-e2e/cypress.json

This file was deleted.

8 changes: 7 additions & 1 deletion apps/hpc-ftsadmin-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,18 @@
"e2e": {
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/hpc-ftsadmin-e2e/cypress.json",
"cypressConfig": "apps/hpc-ftsadmin-e2e/cypress.config.ts",
"devServerTarget": "hpc-ftsadmin:serve"
},
"configurations": {
"production": {
"devServerTarget": "hpc-ftsadmin:serve:production"
},
"dev-live": {
"devServerTarget": "hpc-ftsadmin:serve:dev-live"
},
"dummy": {
"devServerTarget": "hpc-ftsadmin:serve"
}
}
},
Expand Down
13 changes: 13 additions & 0 deletions apps/hpc-ftsadmin-e2e/src/tests/test.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
describe('hpc-ftsadmin', () => {
beforeEach(() => cy.visit('/'));

it('redirects to /flows when logged in', () => {
cy.login('Admin User');
cy.visit('/');
cy.location('pathname', { timeout: 2000 }).should('eq', '/flows');
});

it("doesn't redirect if not logged in", () => {
cy.location('pathname').should('not.eq', '/flows');
});
});
6 changes: 4 additions & 2 deletions apps/hpc-ftsadmin-e2e/tsconfig.e2e.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"declaration": true,
"sourceMap": false,
"outDir": "../../dist/out-tsc",
"allowJs": true
"allowJs": true,
"composite": true
},
"include": ["src/**/*.ts", "src/**/*.js"]
"include": ["**/*.ts", "**/*.js", "../../libs/hpc-dummy/src/index.ts"]
}
1 change: 0 additions & 1 deletion apps/hpc-ftsadmin/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"build": {
"executor": "@nx/webpack:webpack",
"outputs": ["{options.outputPath}"],
"defaultConfiguration": "production",
"options": {
"compiler": "babel",
"outputPath": "dist/apps/hpc-ftsadmin",
Expand Down

0 comments on commit ee846b9

Please sign in to comment.