Skip to content

Commit

Permalink
feat: e2e testing try
Browse files Browse the repository at this point in the history
  • Loading branch information
cmoinier committed Feb 21, 2025
1 parent 2df0bc0 commit 91cced1
Show file tree
Hide file tree
Showing 24 changed files with 126 additions and 3,850 deletions.
14 changes: 12 additions & 2 deletions apps/webcomponents-e2e/cypress.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
import { defineConfig } from 'cypress'
import { nxE2EPreset } from '@nx/cypress/plugins/cypress-preset.js'
import { configureCommonPlugins } from '../../tools/e2e/plugins.js'
import { cypressBrowserPermissionsPlugin } from 'cypress-browser-permissions'
import { fileURLToPath } from 'url'
import { configureCommonPlugins } from '../../tools/e2e/plugins.js'

export default defineConfig({
component: {
...nxE2EPreset(fileURLToPath(import.meta.url)),
devServer: {
framework: "angular",
bundler: "webpack",
},
supportFile: "src/support/component.ts",
specPattern: "**/*.cy.ts",
setupNodeEvents(on, config) {
cypressBrowserPermissionsPlugin(on, config)
configureCommonPlugins(on, config)
},
},
})
});
18 changes: 14 additions & 4 deletions apps/webcomponents-e2e/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,21 @@
"implicitDependencies": ["webcomponents"],
"targets": {
"component": {
"devServer": {
"framework": "angular",
"bundler": "webpack"
"executor": "@nx/cypress:cypress",
"options": {
"cypressConfig": "apps/webcomponents-e2e/cypress.config.js",
"testingType": "component",
"devServerTarget": "webcomponents:serve"
},
"configurations": {
"production": {
"devServerTarget": "webcomponents:serve:production"
},
"ci": {
"devServerTarget": "webcomponents:serve:ci"
}
},
"specPattern": "**/*.cy.ts"
"specPattern": "apps/webcomponents-e2e/src/**/*.cy.ts"
},
"lint": {
"executor": "@nx/eslint:lint",
Expand Down
20 changes: 20 additions & 0 deletions apps/webcomponents-e2e/src/component/GnSearchInputComponent.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { GnSearchInputComponent } from '../../../webcomponents/src/app/components/gn-search-input/gn-search-input.component'

describe('BaseInplaceTextArea', () => {
beforeEach(() => {
cy.viewport(370, 1024)
})

describe('non renseigné', () => {
beforeEach(() => {
cy.mount(GnSearchInputComponent, {})
})

it('devrait afficher un placeholder', () => {
cy.get('[data-test="inplace-text-area-display-placeholder"]').should(
'contain',
'Saisir un intitulé'
)
})
})
})
12 changes: 0 additions & 12 deletions apps/webcomponents-e2e/src/fixtures/config-with-all-filters.toml

This file was deleted.

26 changes: 0 additions & 26 deletions apps/webcomponents-e2e/src/fixtures/config-with-geometry.toml

This file was deleted.

This file was deleted.

44 changes: 0 additions & 44 deletions apps/webcomponents-e2e/src/fixtures/covoit-mel.json

This file was deleted.

Loading

0 comments on commit 91cced1

Please sign in to comment.