mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
test(segment): added e2e tests for segment
Cleaned up some of the UI for the tests
This commit is contained in:
12
ionic/components/segment/test/basic/e2e.ts
Normal file
12
ionic/components/segment/test/basic/e2e.ts
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
|
||||||
|
it('friends should be selected', function() {
|
||||||
|
element(by.css('.e2eSegmentFriends')).click();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('standard should be selected', function() {
|
||||||
|
element(by.css('.e2eSegmentStandard')).click();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('model c should be selected', function() {
|
||||||
|
element(by.css('.e2eSegmentModelC')).click();
|
||||||
|
});
|
@ -1,7 +1,7 @@
|
|||||||
<ion-toolbar>
|
<ion-toolbar>
|
||||||
<ion-title>
|
<ion-title>
|
||||||
<ion-segment>
|
<ion-segment>
|
||||||
<ion-segment-button>
|
<ion-segment-button class="e2eSegmentFriends">
|
||||||
Friends
|
Friends
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
<ion-segment-button>
|
<ion-segment-button>
|
||||||
@ -12,9 +12,11 @@
|
|||||||
</ion-toolbar>
|
</ion-toolbar>
|
||||||
|
|
||||||
<ion-content padding>
|
<ion-content padding>
|
||||||
|
<h4>Map mode: NgControl</h4>
|
||||||
|
|
||||||
<form (submit)="doSubmit($event)" [ng-form-model]="myForm">
|
<form (submit)="doSubmit($event)" [ng-form-model]="myForm">
|
||||||
<ion-segment ng-control="mapStyle" danger>
|
<ion-segment ng-control="mapStyle" danger>
|
||||||
<ion-segment-button value="standard">
|
<ion-segment-button value="standard" class="e2eSegmentStandard">
|
||||||
Standard
|
Standard
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
<ion-segment-button value="hybrid">
|
<ion-segment-button value="hybrid">
|
||||||
@ -24,26 +26,25 @@
|
|||||||
Satellite
|
Satellite
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
</ion-segment>
|
</ion-segment>
|
||||||
<button type="submit" button primary>Submit</button>
|
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
Map mode: <b>{{myForm.controls.mapStyle.value}}</b>
|
<p>
|
||||||
|
Map mode: <b>{{myForm.controls.mapStyle.value}}</b> -
|
||||||
|
|
||||||
<div [ng-switch]="myForm.controls.mapStyle.value">
|
<span [ng-switch]="myForm.controls.mapStyle.value">
|
||||||
<div *ng-switch-when="'standard'">
|
<span *ng-switch-when="'standard'">
|
||||||
<h2>Standard</h2>
|
<b>Standard</b>
|
||||||
</div>
|
</span>
|
||||||
<div *ng-switch-when="'hybrid'">
|
<span *ng-switch-when="'hybrid'">
|
||||||
<h2>Hybrid</h2>
|
<b>Hybrid</b>
|
||||||
</div>
|
</span>
|
||||||
<div *ng-switch-when="'sat'">
|
<span *ng-switch-when="'sat'">
|
||||||
<h2>Satellite!!</h2>
|
<b>Satellite</b>
|
||||||
</div>
|
</span>
|
||||||
</div>
|
</span>
|
||||||
|
</p>
|
||||||
|
|
||||||
<hr>
|
<h4>Model style: NgModel</h4>
|
||||||
|
|
||||||
<h3>NgModel</h3>
|
|
||||||
|
|
||||||
<ion-segment [(ng-model)]="modelStyle" dark>
|
<ion-segment [(ng-model)]="modelStyle" dark>
|
||||||
<ion-segment-button value="A">
|
<ion-segment-button value="A">
|
||||||
@ -52,10 +53,13 @@
|
|||||||
<ion-segment-button value="B">
|
<ion-segment-button value="B">
|
||||||
Model B
|
Model B
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
<ion-segment-button value="C">
|
<ion-segment-button value="C" class="e2eSegmentModelC">
|
||||||
Model C
|
Model C
|
||||||
</ion-segment-button>
|
</ion-segment-button>
|
||||||
|
<ion-segment-button value="D">
|
||||||
|
Model D
|
||||||
|
</ion-segment-button>
|
||||||
</ion-segment>
|
</ion-segment>
|
||||||
|
|
||||||
Model Style: <b>Model {{ modelStyle }}</b>
|
<p>Model Style: <b>Model {{ modelStyle }}</b></p>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
|
Reference in New Issue
Block a user