WIP: GMA UI-Test
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
import * as urls from "../config/urls.js";
|
||||
|
||||
// Definieren der grundlegenden Umgebungseinstellungen und Konfigurationen der Karte
|
||||
const mapVersion = "0.5.3"; // Die Version der verwendeten Karte
|
||||
const standardSideMenu = true; // Einstellung, ob ein standardmäßiges Seitenmenü verwendet wird
|
||||
const fullSideMenu = false; // Einstellung, ob ein vollständiges Seitenmenü verwendet wird
|
||||
|
||||
@@ -50,7 +49,6 @@ if (typeof window !== "undefined") {
|
||||
|
||||
// Export der definierten Variablen und URLs
|
||||
export {
|
||||
mapVersion,
|
||||
standardSideMenu,
|
||||
fullSideMenu,
|
||||
serverURL,
|
||||
|
||||
@@ -15,6 +15,7 @@ if (typeof window !== "undefined") {
|
||||
//OFFLINE_TILE_LAYER = "http://10.10.0.70:3000/mapTiles/{z}/{x}/{y}.png"; //Map von Talas_v5 Server
|
||||
//OFFLINE_TILE_LAYER = "http://10.10.0.70/talas5/nodeMap/public/mapTiles/{z}/{x}/{y}.png"; //Map von Talas_v5 Server
|
||||
OFFLINE_TILE_LAYER = `${originWithoutPort}/talas5/nodeMap/public/mapTiles/{z}/{x}/{y}.png`; //Map von Talas_v5 Server
|
||||
console.log("OFFLINE_TILE_LAYER: ", OFFLINE_TILE_LAYER);
|
||||
//OFFLINE_TILE_LAYER = `${originWithoutPort}:3000/mapTiles/{z}/{x}/{y}.png`;
|
||||
//OFFLINE_TILE_LAYER = `https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png`;
|
||||
MAP_TILES_LAYER = OFFLINE_TILE_LAYER; // Standardwert
|
||||
|
||||
@@ -1,52 +1,53 @@
|
||||
describe("GMA Markers Layer", () => {
|
||||
beforeEach(() => {
|
||||
// Besuche die Map-Seite
|
||||
cy.visit("http://192.168.10.33:3000/?m=12&u=484"); // Passe die URL an
|
||||
});
|
||||
|
||||
it("should display tooltip on hover over a marker", () => {
|
||||
// Simuliere einen Hover über einen Marker
|
||||
cy.get('.leaflet-marker-icon') // Selektor für Marker-Icons
|
||||
.first()
|
||||
.trigger("mouseover");
|
||||
|
||||
// Überprüfen, ob das Tooltip angezeigt wird
|
||||
cy.get('.leaflet-tooltip') // Selektor für Tooltip
|
||||
.should("be.visible")
|
||||
.and("contain", "LT"); // Teste auf Inhalt
|
||||
});
|
||||
|
||||
it("should open context menu on right-click on tooltip", () => {
|
||||
// Simuliere einen Rechtsklick auf einen Tooltip
|
||||
cy.get('.leaflet-marker-icon') // Selektor für Marker-Icons
|
||||
.first()
|
||||
.trigger("mouseover");
|
||||
|
||||
cy.get('.leaflet-tooltip') // Selektor für Tooltip
|
||||
.rightclick();
|
||||
|
||||
// Überprüfen, ob das Kontextmenü angezeigt wird
|
||||
cy.get('.custom-context-menu') // Selektor für Kontextmenü
|
||||
.should("be.visible")
|
||||
.and("contain", "Koordinaten anzeigen"); // Teste auf Inhalt
|
||||
});
|
||||
|
||||
it("should display coordinates when 'Koordinaten anzeigen' is clicked", () => {
|
||||
// Simuliere einen Rechtsklick und klicke auf "Koordinaten anzeigen"
|
||||
cy.get('.leaflet-marker-icon') // Selektor für Marker-Icons
|
||||
.first()
|
||||
.trigger("mouseover");
|
||||
|
||||
cy.get('.leaflet-tooltip') // Selektor für Tooltip
|
||||
.rightclick();
|
||||
|
||||
// Klick auf den Menüpunkt "Koordinaten anzeigen"
|
||||
cy.contains("Koordinaten anzeigen").click();
|
||||
|
||||
// Überprüfen, ob der Alert mit den Koordinaten angezeigt wird
|
||||
cy.on("window:alert", (text) => {
|
||||
expect(text).to.match(/Breitengrad: .* Längengrad: .*/);
|
||||
});
|
||||
before(() => {
|
||||
// Besuche die Map-Seite
|
||||
cy.visit("http://10.10.0.70:3000/?m=12&u=484"); // Passe die URL an
|
||||
});
|
||||
|
||||
it("should display tooltip on hover over a marker", () => {
|
||||
// Simuliere einen Hover über einen Marker
|
||||
cy.get(".leaflet-marker-icon") // Selektor für Marker-Icons
|
||||
.first()
|
||||
.trigger("mouseover");
|
||||
|
||||
// Überprüfen, ob das Tooltip angezeigt wird
|
||||
cy.get(".leaflet-tooltip") // Selektor für Tooltip
|
||||
.should("be.visible")
|
||||
.and("contain", "LT :"); // Teste auf spezifischen Inhalt
|
||||
});
|
||||
|
||||
it("should open context menu on right-click on tooltip", () => {
|
||||
// Simuliere einen Rechtsklick auf einen Marker
|
||||
cy.get(".leaflet-marker-icon") // Selektor für Marker-Icons
|
||||
.first()
|
||||
.trigger("mouseover");
|
||||
|
||||
// Füge einen Rechtsklick auf den Tooltip hinzu
|
||||
cy.get(".leaflet-tooltip") // Selektor für Tooltip
|
||||
.should("be.visible")
|
||||
.trigger("contextmenu"); // Trigger Kontextmenü
|
||||
|
||||
// Überprüfen, ob das Kontextmenü angezeigt wird
|
||||
cy.get(".custom-context-menu") // Selektor für Kontextmenü
|
||||
.should("be.visible")
|
||||
.and("contain", "Koordinaten anzeigen"); // Teste auf spezifischen Menüpunkt
|
||||
});
|
||||
|
||||
it("should display coordinates when 'Koordinaten anzeigen' is clicked", () => {
|
||||
// Simuliere einen Rechtsklick und klicke auf "Koordinaten anzeigen"
|
||||
cy.get(".leaflet-marker-icon") // Selektor für Marker-Icons
|
||||
.first()
|
||||
.trigger("mouseover");
|
||||
|
||||
cy.get(".leaflet-tooltip") // Selektor für Tooltip
|
||||
.trigger("contextmenu");
|
||||
|
||||
// Klick auf den Menüpunkt "Koordinaten anzeigen"
|
||||
cy.get(".custom-context-menu").contains("Koordinaten anzeigen").click();
|
||||
|
||||
// Überprüfen, ob der Alert mit den Koordinaten angezeigt wird
|
||||
cy.on("window:alert", (text) => {
|
||||
expect(text).to.match(/Breitengrad: .* Längengrad: .*/);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
describe("TK-Komponenten", () => {
|
||||
before(() => {
|
||||
// Lade die Seite nur einmal vor allen Tests
|
||||
cy.visit("http://192.168.10.33:3000/?m=12&u=484");
|
||||
cy.visit("http://10.10.0.70: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
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user