del: cypress deinstall
This commit is contained in:
@@ -24,4 +24,4 @@ NEXT_PUBLIC_USE_MOCKS=true
|
||||
# z.B. http://10.10.0.13/xyz/index.aspx -> basePath in config.json auf /xyz setzen
|
||||
# basePath wird jetzt in public/config.json gepflegt
|
||||
# App-Versionsnummer
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.321
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.322
|
||||
|
||||
@@ -25,4 +25,4 @@ NEXT_PUBLIC_USE_MOCKS=false
|
||||
# basePath wird jetzt in public/config.json gepflegt
|
||||
|
||||
# App-Versionsnummer
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.321
|
||||
NEXT_PUBLIC_APP_VERSION=1.1.322
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
describe("setupPOIs Icon-Mapping intern", () => {
|
||||
it("ordnet korrektes Icon anhand idPoi zu", () => {
|
||||
const mockPoiData = [{ idPoi: 7, path: "poi-marker-icon-2.png" }];
|
||||
const iconMap = new Map();
|
||||
mockPoiData.forEach((item) => iconMap.set(item.idPoi, item.path));
|
||||
const result = iconMap.get(7);
|
||||
expect(result).toBe("poi-marker-icon-2.png");
|
||||
});
|
||||
|
||||
it("gibt undefined zurück wenn idPoi nicht existiert", () => {
|
||||
const iconMap = new Map();
|
||||
iconMap.set(1, "icon-1.png");
|
||||
const result = iconMap.get(99);
|
||||
expect(result).toBeUndefined();
|
||||
});
|
||||
});
|
||||
@@ -1,17 +0,0 @@
|
||||
const { defineConfig } = require("cypress");
|
||||
|
||||
module.exports = defineConfig({
|
||||
e2e: {
|
||||
setupNodeEvents(on, config) {
|
||||
// Node-Event-Listeners hier konfigurieren
|
||||
},
|
||||
experimentalStudio: true, // Studio aktivieren
|
||||
},
|
||||
|
||||
component: {
|
||||
devServer: {
|
||||
framework: "next",
|
||||
bundler: "webpack",
|
||||
},
|
||||
},
|
||||
});
|
||||
@@ -1,63 +0,0 @@
|
||||
describe("contextmenuTest", () => {
|
||||
it("contetmenu Station öffnen (Tab)", () => {
|
||||
cy.log("Test startet jetzt");
|
||||
|
||||
// 1. Viewport einstellen
|
||||
cy.viewport(1920, 1080);
|
||||
cy.log("Viewport eingestellt auf 1920x1080");
|
||||
|
||||
// 2. Seite besuchen
|
||||
cy.visit("http://10.10.0.13:3000/?m=12&u=484");
|
||||
cy.wait(5000); // Wartezeit nach dem Laden
|
||||
cy.log("Seite geöffnet");
|
||||
|
||||
// 3. Sicherstellen, dass die Karte geladen ist
|
||||
cy.get("#map", { timeout: 15000 }).should("be.visible");
|
||||
cy.log("Karte geladen");
|
||||
|
||||
// 4. Wartezeit zum Stabilisieren der Karte
|
||||
cy.wait(2000);
|
||||
|
||||
// 5. Marker suchen und Rechtsklick simulieren
|
||||
cy.get('img[src*="img/icons/marker-icon-20.svg"]') // Marker suchen
|
||||
.filter(":visible") // Nur sichtbare Marker
|
||||
.first() // Ersten Marker auswählen
|
||||
.scrollIntoView() // Marker in den sichtbaren Area scrollen
|
||||
.should("be.visible") // Sicherstellen, dass Marker sichtbar ist
|
||||
.trigger("mouseover") // Mouseover simulieren
|
||||
.wait(500) // Wartezeit nach Mouseover
|
||||
.rightclick({ force: true }); // Rechtsklick auf den Marker
|
||||
cy.log("Rechtsklick auf Marker ausgeführt");
|
||||
|
||||
// Screenshot nach Rechtsklick zum Debugging
|
||||
// cy.screenshot("nach-rechtsklick");
|
||||
|
||||
// 6. Kontextmenü prüfen mit explizitem Selektor
|
||||
cy.get(".leaflet-contextmenu-item") // Suche alle Menüeinträge mit der Klasse
|
||||
.contains("Station öffnen (Tab)", { timeout: 5000 }) // Prüfe Text innerhalb des Eintrags
|
||||
.should("be.visible"); // Sichtbarkeit sicherstellen
|
||||
cy.log("Menüeintrag gefunden");
|
||||
|
||||
// 7. URL abfangen und testen, bevor der Tab geöffnet wird
|
||||
const targetUrl = "http://10.10.0.13/talas5/devices/cpl.aspx?ver=35&kue=24&id=50922";
|
||||
|
||||
// HTTP-Anfrage zur Überprüfung des Status
|
||||
cy.request(targetUrl).then((response) => {
|
||||
expect(response.status).to.eq(200); // Erwartet HTTP 200 OK
|
||||
cy.log("URL ist erreichbar, Status 200");
|
||||
});
|
||||
|
||||
// 8. Menüeintrag auswählen (öffnet den neuen Tab)
|
||||
cy.get(".leaflet-contextmenu-item") // Explizit Menüeintrag mit Klasse auswählen
|
||||
.contains("Station öffnen (Tab)")
|
||||
.click(); // Menüeintrag anklicken
|
||||
cy.log("Menüeintrag ausgewählt");
|
||||
|
||||
// 9. Klick auf die Karte, um Kontextmenü zu schließen
|
||||
cy.get("#map").click(100, 100); // Klick auf eine leere Stelle
|
||||
cy.log("Kontextmenü geschlossen");
|
||||
|
||||
// 10. Optionaler Screenshot nach Abschluss
|
||||
// cy.screenshot("test-abgeschlossen");
|
||||
});
|
||||
});
|
||||
@@ -1,54 +0,0 @@
|
||||
describe("GMA Markers Layer", () => {
|
||||
before(() => {});
|
||||
|
||||
it("Der Test stellt sicher, dass das GMA Tooltip-Element für 'Rastede' angezeigt ist und die erwarteten Werte wie LT:, FBT:, GT: und RLF: enthält.", () => {
|
||||
// Testbeschreibung: Dieser Test überprüft, ob der Tooltip selbst korrekt dargestellt wird und den erwarteten Inhalt anzeigt.
|
||||
|
||||
// Besuche die Map-Seite
|
||||
//cy.visit("http://10.10.0.13:3000/?m=12&u=484"); // Passe die URL an
|
||||
cy.visit("http://127.0.0.1:3000/?m=12&u=484");
|
||||
|
||||
cy.contains(".leaflet-tooltip", "Rastede")
|
||||
// Wählt das Tooltip-Element mit der Klasse `leaflet-tooltip`, das den Text "Rastede" enthält.
|
||||
.first();
|
||||
|
||||
cy.get(".leaflet-tooltip")
|
||||
// Wählt das Tooltip-Element erneut aus, um weitere Überprüfungen durchzuführen.
|
||||
.should("be.visible")
|
||||
// Überprüft, ob das Tooltip sichtbar ist.
|
||||
.and("contain", "LT:")
|
||||
// Stellt sicher, dass der Tooltip den Text "LT :" enthält.
|
||||
.and("contain", "FBT:")
|
||||
// Stellt sicher, dass der Tooltip auch den Text "FBT:" enthält.
|
||||
.and("contain", "GT:")
|
||||
// Stellt sicher, dass der Tooltip auch den Text "GT:" enthält.
|
||||
.and("contain", "RLF:");
|
||||
// Stellt sicher, dass der Tooltip auch den Text "RLF:" enthält.
|
||||
});
|
||||
|
||||
it("should open context menu on right-click on tooltip", () => {
|
||||
// Testbeschreibung: Dieser Test überprüft, ob ein Rechtsklick auf den Tooltip das Kontextmenü öffnet.
|
||||
|
||||
// Besuche die Map-Seite
|
||||
cy.visit("http://127.0.0.1:3000/?m=12&u=484"); // Passe die URL an
|
||||
//warte 2 Sekunden
|
||||
cy.wait(2000);
|
||||
|
||||
cy.contains(".leaflet-tooltip", "Rastede")
|
||||
// Wählt das Tooltip-Element mit der Klasse `leaflet-tooltip`, das den Text "Rastede" enthält.
|
||||
.first()
|
||||
.should("be.visible") // Überprüft, ob das Tooltip sichtbar ist.
|
||||
.trigger("contextmenu"); // Führt einen Rechtsklick (Kontextmenü-Ereignis) auf das Tooltip aus.
|
||||
|
||||
cy.get(".custom-context-menu")
|
||||
// Wählt das Element aus, das das Kontextmenü darstellt.
|
||||
.should("be.visible") // Überprüft, ob das Kontextmenü sichtbar ist.
|
||||
.and("contain", "Station öffnen (Tab)") // Überprüft, ob der Eintrag "Station öffnen (Tab)" vorhanden ist.
|
||||
.and("contain", "Koordinaten anzeigen") // Überprüft, ob der Eintrag "Koordinaten anzeigen" vorhanden ist.
|
||||
.and("contain", "Reinzoomen") // Überprüft, ob der Eintrag "Reinzoomen" vorhanden ist.
|
||||
.and("contain", "Rauszoomen") // Überprüft, ob der Eintrag "Rauszoomen" vorhanden ist.
|
||||
.and("contain", "Hier zentrieren"); // Überprüft, ob der Eintrag "Hier zentrieren" vorhanden ist.
|
||||
});
|
||||
|
||||
//-----------------------------------------------
|
||||
});
|
||||
@@ -1,29 +0,0 @@
|
||||
//TDD Test Driven Development
|
||||
// Dieser Test überprüft die Karteninteraktion: Eingabe von Koordinaten und Zentrieren der Karte
|
||||
// Schritte:
|
||||
// 1. Öffnen der Karte auf einer bestimmten Seite.
|
||||
// 2. Eingeben von Koordinaten in ein Eingabefeld.
|
||||
// 3. Klicken auf einen Button, um die Karte zu den Koordinaten zu zoomen.
|
||||
// 4. Überprüfen, ob die Karte korrekt zentriert wurde.
|
||||
//--------------------------------------------------------------Test4 git config --global user.email "ismailali1553@gmail.com" in Terminal eingegeben und
|
||||
// benutzer email adresse eingegeben git config --global user.name "ismailali1553"
|
||||
describe("Karteninteraktion", () => {
|
||||
it("zoomt zu den eingegebenen Koordinaten", () => {
|
||||
// Öffne die Seite mit der Karte
|
||||
cy.visit("http://127.0.0.1:3000/?m=12&u=484"); // Passe den Pfad an deine Karte an
|
||||
|
||||
// Gebe Koordinaten in das Eingabefeld ein
|
||||
cy.get('input[placeholder="Koordinaten eingeben (lat,lng)"]').type("52.52,13.405");
|
||||
|
||||
// Klicke auf den Button "Zu Marker zoomen"
|
||||
cy.get("button").contains("Zu Marker zoomen").click();
|
||||
|
||||
// Überprüfe, ob die Karte die eingegebenen Koordinaten korrekt zentriert hat
|
||||
cy.window().then((win) => {
|
||||
const map = win.map; // Zugriff auf die Leaflet-Instanz
|
||||
const center = map.getCenter(); // Aktuelles Zentrum der Karte abrufen
|
||||
expect(center.lat).to.be.closeTo(52.52, 0.01); // Latitude überprüfen
|
||||
expect(center.lng).to.be.closeTo(13.405, 0.01); // Longitude überprüfen
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,20 +0,0 @@
|
||||
//cypress/e2e/poiUpdateModal.cy.js
|
||||
describe("POI bearbeiten – Typ-Auswahl prüfen", () => {
|
||||
beforeEach(() => {
|
||||
cy.visit("http://localhost:3000/?m=12&u=484");
|
||||
cy.get(".leaflet-container", { timeout: 10000 }).should("be.visible");
|
||||
cy.get(".leaflet-marker-icon", { timeout: 10000 }).should("have.length.greaterThan", 0);
|
||||
});
|
||||
|
||||
it("sollte beim Öffnen des Modals den richtigen POI-Typ anzeigen", () => {
|
||||
cy.get('svg[aria-label="Bearbeitungsmodus aktivieren"]').click({ force: true });
|
||||
cy.wait(5000);
|
||||
|
||||
cy.get('img[src="/img/icons/pois/poi-marker-icon-4.png"]', { timeout: 10000 }).should("be.visible");
|
||||
cy.get('img[src="/img/icons/pois/poi-marker-icon-4.png"]').first().rightclick({ force: true });
|
||||
|
||||
cy.contains("POI Bearbeiten").click({ force: true });
|
||||
|
||||
cy.get("#idPoiTyp", { timeout: 10000 }).should("exist").find("[class*='singleValue']").should("not.contain.text", "Typ auswählen");
|
||||
});
|
||||
});
|
||||
@@ -1,35 +0,0 @@
|
||||
describe("TK-Komponenten", () => {
|
||||
before(() => {
|
||||
// Lade die Seite nur einmal vor allen Tests
|
||||
cy.visit("http://10.10.0.13:3000/?m=12&u=484");
|
||||
//cy.wait(5000); // Wartezeit, bis die Seite vollständig geladen ist, cypress macht automatisch , alsobrauchen wir im moment kein wait() wenn cy. schafft
|
||||
});
|
||||
|
||||
it("soll alle Tests in Reihenfolge ausführen", () => {
|
||||
// Test 1: Sicherstellen, dass die Checkbox vorhanden und sichtbar ist
|
||||
cy.get("input[type='checkbox'][id='system-10']")
|
||||
.should("exist")
|
||||
.and("be.visible")
|
||||
.then(() => {
|
||||
cy.log("Die Checkbox mit ID 'system-10' ist vorhanden und sichtbar.");
|
||||
});
|
||||
|
||||
// Test 2: Sicherstellen, dass die Checkbox aktiviert ist
|
||||
cy.get("input[type='checkbox'][id='system-10']").then(($checkbox) => {
|
||||
if (!$checkbox.prop("checked")) {
|
||||
// Falls die Checkbox nicht aktiviert ist, aktiviere sie
|
||||
cy.wrap($checkbox).check({ force: true });
|
||||
cy.log("Die Checkbox war deaktiviert und wurde jetzt aktiviert.");
|
||||
} else {
|
||||
cy.log("Die Checkbox ist bereits aktiviert.");
|
||||
}
|
||||
});
|
||||
|
||||
// Test 3: Checkbox deaktivieren und Marker verschwinden lassen
|
||||
cy.get("input[type='checkbox'][id='system-10']")
|
||||
.uncheck({ force: true })
|
||||
.then(() => {
|
||||
cy.log("Die Checkbox wurde deaktiviert.");
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
"name": "Using fixtures to represent data",
|
||||
"email": "hello@cypress.io",
|
||||
"body": "Fixtures are a great way to mock data for responses to routes"
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
describe("Map Initial Load Test", () => {
|
||||
it("should load the map with the correct center and zoom", () => {
|
||||
// Besuche die Seite, auf der die Karte angezeigt wird
|
||||
cy.visit("http://192.168.10.167:3000/?m=12&u=485");
|
||||
|
||||
// Überprüfe, ob das Kartenelement existiert
|
||||
cy.get("#map").should("be.visible");
|
||||
|
||||
// Überprüfe, ob die Karte das korrekte Zentrum und den korrekten Zoom hat
|
||||
cy.window().then((win) => {
|
||||
const map = win.L.map;
|
||||
const center = map.getCenter();
|
||||
const zoom = map.getZoom();
|
||||
|
||||
expect(center.lat).to.be.closeTo(53.111111, 0.0001);
|
||||
expect(center.lng).to.be.closeTo(8.4625, 0.0001);
|
||||
expect(zoom).to.eq(12);
|
||||
});
|
||||
});
|
||||
});
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 72 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 618 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 72 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 587 KiB |
@@ -1,25 +0,0 @@
|
||||
// ***********************************************
|
||||
// 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) => { ... })
|
||||
@@ -1,14 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<title>Components App</title>
|
||||
<!-- Used by Next.js to inject CSS. -->
|
||||
<div id="__next_css__DO_NOT_USE__"></div>
|
||||
</head>
|
||||
<body>
|
||||
<div data-cy-root></div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,27 +0,0 @@
|
||||
// ***********************************************************
|
||||
// This example support/component.js 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'
|
||||
|
||||
// Alternatively you can use CommonJS syntax:
|
||||
// require('./commands')
|
||||
|
||||
import { mount } from 'cypress/react18'
|
||||
|
||||
Cypress.Commands.add('mount', mount)
|
||||
|
||||
// Example use:
|
||||
// cy.mount(<MyComponent />)
|
||||
@@ -1,56 +0,0 @@
|
||||
// ***********************************************************
|
||||
// Diese Datei wird automatisch geladen, bevor Tests ausgeführt werden.
|
||||
//
|
||||
// Dies ist ein guter Platz für globale Konfigurationen
|
||||
// und Änderungen, die Cypress beeinflussen.
|
||||
//
|
||||
// Weitere Infos: https://on.cypress.io/configuration
|
||||
// ***********************************************************
|
||||
|
||||
// Importiere zusätzliche Befehle
|
||||
import "./commands";
|
||||
|
||||
// Alternativ: CommonJS-Syntax verwenden
|
||||
// require('./commands')
|
||||
|
||||
// Verstecke unnötige Logs für XHR- und Fetch-Anfragen
|
||||
const app = window.top;
|
||||
if (!app.document.head.querySelector("[data-hide-command-log-request]")) {
|
||||
const style = app.document.createElement("style");
|
||||
style.innerHTML = `
|
||||
.command-name-request, .command-name-xhr {
|
||||
display: none; /* Verstecke Fetch- und XHR-Logs */
|
||||
}
|
||||
.runnable-pass .collapsible-header {
|
||||
display: none; /* Verstecke den Header erfolgreicher Tests */
|
||||
}
|
||||
`;
|
||||
style.setAttribute("data-hide-command-log-request", "");
|
||||
app.document.head.appendChild(style);
|
||||
}
|
||||
|
||||
// Globale Ereignisse für Cypress konfigurieren
|
||||
Cypress.on("test:after:run", (test, runnable) => {
|
||||
// Minimiert die Logs für erfolgreiche Tests
|
||||
if (test.state === "passed") {
|
||||
runnable._testConfigBody = null; // Löscht den Test Body
|
||||
}
|
||||
});
|
||||
|
||||
// Schließe automatisch erfolgreiche Tests in der GUI
|
||||
Cypress.on("log:added", (log) => {
|
||||
if (log.state === "passed") {
|
||||
log.displayName = ""; // Versteckt Log-Details für erfolgreiche Schritte
|
||||
}
|
||||
});
|
||||
|
||||
// Screenshot nach jedem fehlgeschlagenen Test
|
||||
Cypress.on("fail", (error, runnable) => {
|
||||
cy.screenshot(`error-${runnable.title}`); // Screenshot für Fehler erstellen
|
||||
throw error; // Fehler weitergeben
|
||||
});
|
||||
|
||||
// Logge die Dauer jedes Tests
|
||||
Cypress.on("test:after:run", (test) => {
|
||||
cy.log(`Test "${test.title}" abgeschlossen in ${test.duration} ms`);
|
||||
});
|
||||
BIN
nodemap-1.1.321.zip
Normal file
BIN
nodemap-1.1.321.zip
Normal file
Binary file not shown.
1367
package-lock.json
generated
1367
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "nodemap",
|
||||
"version": "1.1.321",
|
||||
"version": "1.1.322",
|
||||
"dependencies": {
|
||||
"@emotion/react": "^11.13.3",
|
||||
"@emotion/styled": "^11.13.0",
|
||||
@@ -51,7 +51,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"cross-env": "^7.0.3",
|
||||
"cypress": "^13.17.0",
|
||||
"husky": "^9.1.7",
|
||||
"identity-obj-proxy": "^3.0.0",
|
||||
"jest-environment-jsdom": "^29.7.0",
|
||||
|
||||
Reference in New Issue
Block a user