From 330a48f6bd19481e23567f8aef2d65f51cba5676 Mon Sep 17 00:00:00 2001 From: vulcangz Date: Thu, 3 Sep 2020 22:30:21 +0800 Subject: [PATCH] test(cypress/integration): add test cases --- cypress/integration/Map.js | 20 ++++++++++++++++++-- src/App.svelte | 24 +++++++++++++++--------- 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/cypress/integration/Map.js b/cypress/integration/Map.js index adf6a06..4735b87 100644 --- a/cypress/integration/Map.js +++ b/cypress/integration/Map.js @@ -5,7 +5,23 @@ context('Actions', () => { cy.visit('http://localhost:5000'); }); - it('Should render a greeting', () => { - cy.findByText('this is a map base demo').should('exist'); + it('Should render example1 map with center marker', () => { + cy.findByText('this is a map base demo').should('exist') + }); + + it('Example1 map contains label "中国国家博物馆"', () => { + cy.get('#example1').contains('中国国家博物馆').should('exist'); + }); + + it('Should render example2 map default without center marker', () => { + cy.get('#example2').contains('this is map point collection demo').should('not.exist'); + }); + + it('Example2 map should contain copyright control content', () => { + cy.findByText('山川异域,风月同天。').should('exist'); + }); + + it('Example2 map should contain copyright control content', () => { + cy.findByText('寄诸佛子,共结来缘。').should('exist'); }); }); diff --git a/src/App.svelte b/src/App.svelte index e643d26..74fd0fc 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -80,7 +80,7 @@ -
+
1)地图示例

地图展示及控件示例。

@@ -106,7 +106,7 @@
-
+
2)海量点示例

调用PointCollection海量点类。目前仅适用于html5浏览器。

@@ -119,14 +119,16 @@
- -
+ + + -
+ - + @@ -172,6 +177,7 @@ autoViewport="true" panel={"d-result"}> --> +