Skip to content

Commit

Permalink
test(cypress/integration): add test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
vulcangz committed Sep 3, 2020
1 parent 7cef658 commit 330a48f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
20 changes: 18 additions & 2 deletions cypress/integration/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
});
24 changes: 15 additions & 9 deletions src/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
</blockquote>
</header>

<section class="container" id="examples">
<section class="container" id="example1">
<h5 class="title">1)地图示例</h5>
<p>地图展示及控件示例。</p>
<div class="row map-wrap">
Expand All @@ -106,7 +106,7 @@
</div>
</section>

<section class="container" id="examples">
<section class="container" id="example2">
<h5 class="title">2)海量点示例</h5>
<p>调用PointCollection海量点类。目前仅适用于html5浏览器。</p>
<div class="row map-wrap">
Expand All @@ -119,14 +119,16 @@
</Map>
</div>
</section>

<section class="container" id="examples">

<!--
<section class="container" id="example3">
<h5 class="title">3)本地检索示例</h5>
<p>位置检索、周边检索和范围检索。</p>
<div class="row map-wrap">
<div class="column column-70">
<Map options={ baseMapConfig }>
<NavigationControl />
<NavigationControl />
-->

<!-- 关键字检索 -->
<!--
Expand All @@ -140,6 +142,7 @@
-->

<!-- 圆形区域检索 -->
<!--
<LocalSearch nearby={nearby1} keyword={"餐馆"} autoViewport="true" panel={"r-result"} pageCapacity={4}>
</LocalSearch>
</Map>
Expand All @@ -148,17 +151,19 @@
<div id="r-result"></div>
</div>
</section>
-->

<section class="container" id="examples1">
<!--
<section class="container" id="examples4">
<h5 class="title">4)线路规划</h5>
<p>公交路线搜索;步行规划;公交路线规划;驾车线路规划。</p>
<div class="row map-wrap">
<div class="column column-70">
<Map options={ baseMapConfig }>
<NavigationControl position={"top-right"} />

-->
<!--<Bus location={"北京"} keyword={"331"} autoViewport="true" panel={"d-result"}/> <!-- ok -->
<Bus location={"广州"} keyword={"331"} autoViewport="true" panel={"d-result"}/> <!-- 331 增城 ok; BRT线路 B1,B2 等还不行 -->
<!--<Bus location={"广州"} keyword={"331"} autoViewport="true" panel={"d-result"}/> <!-- 331 增城 ok; BRT线路 B1,B2 等还不行 -->
<!--<Bus location={"广州"} keyword={"B2"} autoViewport="true" panel={"d-result"}/>-->
<!--<Walking start={"百度大厦"} end={"北京邮电大学西门"} autoViewport="true" location={"北京"} panel={"d-result"}>
</Walking>-->
Expand All @@ -172,14 +177,15 @@
autoViewport="true"
panel={"d-result"}>
</Driving> -->
<!--
</Map>
</div>
<div class="column column-30">
<div id="d-result"></div>
</div>
</div>
</section>
</section> -->

<footer class="footer">
<section class="container">
Expand Down

0 comments on commit 330a48f

Please sign in to comment.