Skip to content

Commit

Permalink
test(input): basic e2e test of a sample form to validate the next but…
Browse files Browse the repository at this point in the history
…ton/arrow goes to next input (#11362)

basic e2e test of a sample form to validate the next button/arrow goes to next input field
  • Loading branch information
danbucholtz authored Apr 27, 2017
1 parent 991cadb commit b114427
Show file tree
Hide file tree
Showing 6 changed files with 129 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/components/input/test/basic-form/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Component } from '@angular/core';

import { RootPage } from '../pages/root-page/root-page';

@Component({
template: '<ion-nav [root]="root"></ion-nav>'
})
export class AppComponent {
root = RootPage;
}
19 changes: 19 additions & 0 deletions src/components/input/test/basic-form/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule } from '../../../../..';

import { AppComponent } from './app.component';
import { RootPageModule } from '../pages/root-page/root-page.module';

@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
IonicModule.forRoot(AppComponent),
RootPageModule
],
bootstrap: [IonicApp]
})
export class AppModule {}
5 changes: 5 additions & 0 deletions src/components/input/test/basic-form/app/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app.module';

platformBrowserDynamic().bootstrapModule(AppModule);
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<ion-header>
<ion-navbar>
<ion-title>Basic Form</ion-title>
</ion-navbar>
</ion-header>
<ion-content>
<form>
<ion-list>
<ion-item>
<ion-label floating>Username</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Password</ion-label>
<ion-input type="pass"></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Username</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Password</ion-label>
<ion-input type="pass"></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Username</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Password</ion-label>
<ion-input type="pass"></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Username</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Password</ion-label>
<ion-input type="pass"></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Username</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Password</ion-label>
<ion-input type="pass"></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Username</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
<ion-item>
<ion-label floating>Password</ion-label>
<ion-input type="pass"></ion-input>
</ion-item>
</ion-list>
</form>
</ion-content>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { NgModule } from '@angular/core';
import { IonicPageModule } from '../../../../../..';

import { RootPage } from './root-page';

@NgModule({
declarations: [
RootPage,
],
imports: [
IonicPageModule.forChild(RootPage)
]
})
export class RootPageModule {}
22 changes: 22 additions & 0 deletions src/components/input/test/basic-form/pages/root-page/root-page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Component } from '@angular/core';

@Component({
templateUrl: 'root-page.html'
})
export class RootPage {
myParam = '';
minValue = 8;
maxValue = 12;
stepValue = 2;

myValues = {
value1: 'Dynamic Input',
value2: 'Dynamic Textarea'
};

toggleValues() {
this.minValue === 8 ? this.minValue = 4 : this.minValue = 8;
this.maxValue === 12 ? this.maxValue = 20 : this.maxValue = 12;
this.stepValue === 2 ? this.stepValue = 4 : this.stepValue = 2;
}
}

0 comments on commit b114427

Please sign in to comment.