Cypress Umgebung ok
This commit is contained in:
46
cypress/e2e/kue705fo.cy.ts
Normal file
46
cypress/e2e/kue705fo.cy.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
describe('Kue705FO Integration Tests', () => {
|
||||
beforeEach(() => {
|
||||
// Besuche die Seite, auf der die Komponente gerendert wird
|
||||
//cy.visit('/path-to-your-component'); // Passe den Pfad an deine App an
|
||||
cy.visit('http://localhost:3000/kabelueberwachung');
|
||||
});
|
||||
|
||||
it('should render the component with default props', () => {
|
||||
// Überprüfe, ob der Modulname und die Slotnummer angezeigt werden
|
||||
cy.contains('KÜ705-FO').should('be.visible');
|
||||
cy.contains('Modul 1').should('be.visible'); // Beispiel für den Modulnamen
|
||||
});
|
||||
|
||||
it('should update display when TDR button is clicked', () => {
|
||||
// Klicke auf den TDR-Button
|
||||
cy.contains('TDR').click();
|
||||
|
||||
// Überprüfe, ob der Text aktualisiert wurde
|
||||
cy.contains('Entfernung [Km]').should('be.visible');
|
||||
});
|
||||
|
||||
it('should switch back to Schleife display', () => {
|
||||
// Klicke auf TDR, dann zurück zu Schleife
|
||||
cy.contains('TDR').click();
|
||||
cy.contains('Schleife').click();
|
||||
|
||||
// Überprüfe, ob der Text aktualisiert wurde
|
||||
cy.contains('Schleifenwiderstand [kOhm]').should('be.visible');
|
||||
});
|
||||
|
||||
it('should disable TDR button when tdrActive is 0', () => {
|
||||
// Dies erfordert eine benutzerdefinierte Backend-Konfiguration oder Redux-Manipulation
|
||||
cy.contains('TDR').should('be.disabled');
|
||||
});
|
||||
|
||||
it('should open and close the settings modal', () => {
|
||||
// Öffne das Modal
|
||||
cy.contains('⚙').click();
|
||||
cy.contains('KUE Einstellung - Slot 1').should('be.visible');
|
||||
|
||||
// Schließe das Modal
|
||||
cy.contains('×').click();
|
||||
cy.contains('KUE Einstellung - Slot 1').should('not.exist');
|
||||
});
|
||||
});
|
||||
|
||||
5
cypress/fixtures/example.json
Normal file
5
cypress/fixtures/example.json
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"name": "Using fixtures to represent data",
|
||||
"email": "hello@cypress.io",
|
||||
"body": "Fixtures are a great way to mock data for responses to routes"
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 123 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 109 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 122 KiB |
37
cypress/support/commands.ts
Normal file
37
cypress/support/commands.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
/// <reference types="cypress" />
|
||||
// ***********************************************
|
||||
// This example commands.ts 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) => { ... })
|
||||
//
|
||||
// declare global {
|
||||
// namespace Cypress {
|
||||
// interface Chainable {
|
||||
// login(email: string, password: string): Chainable<void>
|
||||
// drag(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
|
||||
// dismiss(subject: string, options?: Partial<TypeOptions>): Chainable<Element>
|
||||
// visit(originalFn: CommandOriginalFn, url: string, options: Partial<VisitOptions>): Chainable<Element>
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
17
cypress/support/e2e.ts
Normal file
17
cypress/support/e2e.ts
Normal file
@@ -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
|
||||
// ***********************************************************
|
||||
|
||||
// Import commands.js using ES2015 syntax:
|
||||
import './commands'
|
||||
Reference in New Issue
Block a user