Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fff7bd0

Browse files
committed
chore: update ssr-e2e config
1 parent 7854af2 commit fff7bd0

13 files changed

+88
-46
lines changed

apps/ssr-e2e/cypress.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { nxE2EPreset } from '@nrwl/cypress/plugins/cypress-preset';
2+
import { defineConfig } from 'cypress';
3+
4+
export default defineConfig({
5+
e2e: nxE2EPreset(__dirname),
6+
});

apps/ssr-e2e/cypress.json

Lines changed: 0 additions & 12 deletions
This file was deleted.

apps/ssr-e2e/project.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
"e2e": {
88
"executor": "@nrwl/cypress:cypress",
99
"options": {
10-
"cypressConfig": "apps/ssr-e2e/cypress.json",
11-
"tsConfig": "apps/ssr-e2e/tsconfig.e2e.json",
12-
"devServerTarget": "ssr:serve-ssr"
10+
"cypressConfig": "apps/ssr-e2e/cypress.config.ts",
11+
"devServerTarget": "ssr:serve-ssr",
12+
"testingType": "e2e"
1313
}
1414
}
1515
},
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
describe('@rx-angular/template universal rendering', () => {
22
describe('PushPipe', () => {
33
it('should display green text', () => {
4-
cy.request('http://localhost:4200').its('body').then(
5-
html => {
4+
cy.request('http://localhost:4200')
5+
.its('body')
6+
.then((html) => {
67
const el = Cypress.$(html).find('#push');
78
expect(el).to.have.text('green');
8-
}
9-
)
9+
});
1010
});
1111
});
1212

1313
describe('LetDirective', () => {
1414
it('should display green text', () => {
15-
cy.request('http://localhost:4200').its('body').then(
16-
html => {
15+
cy.request('http://localhost:4200')
16+
.its('body')
17+
.then((html) => {
1718
const el = Cypress.$(html).find('#let');
1819
expect(el).to.have.text('green');
19-
}
20-
)
20+
});
2121
});
2222
});
2323

2424
describe('RxFor', () => {
2525
it('should display green and purple text', () => {
26-
cy.request('http://localhost:4200').its('body').then(
27-
html => {
26+
cy.request('http://localhost:4200')
27+
.its('body')
28+
.then((html) => {
2829
const el = Cypress.$(html).find('.for');
2930
expect(el.length).eq(2);
3031
expect(el.eq(0)).to.include.text('green');
3132
expect(el.eq(1)).to.include.text('purple');
32-
}
33-
)
33+
});
3434
});
3535
});
3636
});

apps/ssr-e2e/src/plugins/index.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

apps/ssr-e2e/src/support/app.po.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export const getGreeting = () => cy.get('h1');

apps/ssr-e2e/src/support/commands.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// ***********************************************
2+
// This example commands.js shows you how to
3+
// create various custom commands and overwrite
4+
// existing commands.
5+
//
6+
// For more comprehensive examples of custom
7+
// commands please read more here:
8+
// https://on.cypress.io/custom-commands
9+
// ***********************************************
10+
11+
// eslint-disable-next-line @typescript-eslint/no-namespace
12+
declare namespace Cypress {
13+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
14+
interface Chainable<Subject> {
15+
login(email: string, password: string): void;
16+
}
17+
}
18+
//
19+
// -- This is a parent command --
20+
Cypress.Commands.add('login', (email, password) => {
21+
console.log('Custom command example: Login', email, password);
22+
});
23+
//
24+
// -- This is a child command --
25+
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
26+
//
27+
//
28+
// -- This is a dual command --
29+
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
30+
//
31+
//
32+
// -- This will overwrite an existing command --
33+
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })

apps/ssr-e2e/src/support/e2e.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// ***********************************************************
2+
// This example support/index.js is processed and
3+
// loaded automatically before your test files.
4+
//
5+
// This is a great place to put global configuration and
6+
// behavior that modifies Cypress.
7+
//
8+
// You can change the location of this file or turn off
9+
// automatically serving support files with the
10+
// 'supportFile' configuration option.
11+
//
12+
// You can read more here:
13+
// https://on.cypress.io/configuration
14+
// ***********************************************************
15+
16+
// Import commands.js using ES2015 syntax:
17+
import './commands';

apps/ssr-e2e/src/support/index.ts

Whitespace-only changes.

apps/ssr-e2e/tsconfig.e2e.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

apps/ssr-e2e/tsconfig.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"extends": "../../tsconfig.base.json",
3-
"files": [],
4-
"include": [],
5-
"references": [
6-
{
7-
"path": "./tsconfig.e2e.json"
8-
}
9-
]
3+
"compilerOptions": {
4+
"sourceMap": false,
5+
"outDir": "../../dist/out-tsc",
6+
"allowJs": true,
7+
"types": ["cypress", "node"]
8+
},
9+
"include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"]
1010
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113
"debug": "^4.2.0",
114114
"eslint": "^8.34.0",
115115
"eslint-config-prettier": "^8.6.0",
116+
"eslint-plugin-cypress": "^2.10.3",
116117
"husky": "^8.0.3",
117118
"jest": "28.1.3",
118119
"jest-environment-jsdom": "28.1.3",

yarn.lock

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8768,6 +8768,13 @@ eslint-config-prettier@^8.6.0:
87688768
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348"
87698769
integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA==
87708770

8771+
eslint-plugin-cypress@^2.10.3:
8772+
version "2.13.2"
8773+
resolved "https://registry.yarnpkg.com/eslint-plugin-cypress/-/eslint-plugin-cypress-2.13.2.tgz#b42b763f449ff713cecf6bdf1903e7cee6e48bfc"
8774+
integrity sha512-LlwjnBTzuKuC0A4H0RxVjs0YeAWK+CD1iM9Dp8un3lzT713ePQxfpPstCD+9HSAss8emuE3b2hCNUST+NrUwKw==
8775+
dependencies:
8776+
globals "^11.12.0"
8777+
87718778
[email protected], eslint-scope@^5.1.1:
87728779
version "5.1.1"
87738780
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
@@ -9864,7 +9871,7 @@ global-prefix@^3.0.0:
98649871
kind-of "^6.0.2"
98659872
which "^1.3.1"
98669873

9867-
globals@^11.1.0:
9874+
globals@^11.1.0, globals@^11.12.0:
98689875
version "11.12.0"
98699876
resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e"
98709877
integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==

0 commit comments

Comments
 (0)