test(select): update e2e tests to compare with v3 master

This commit is contained in:
Brandy Carney
2017-12-22 12:04:28 -05:00
parent c747f1e294
commit 2857f50b07
6 changed files with 26 additions and 27 deletions

View File

@ -8,13 +8,6 @@ class E2ETestPage extends Page {
constructor(driver, platform) {
super(driver, `http://localhost:3333/src/components/select/test/basic?ionicplatform=${platform}`);
}
present(buttonId) {
this.navigate();
this.driver.findElement(By.id(buttonId)).click();
this.driver.wait(until.elementLocated(By.css('.select-wrapper')));
return this.driver.wait(until.elementIsVisible(this.driver.findElement(By.css('.select-wrapper'))));
}
}
platforms.forEach(platform => {
@ -23,5 +16,15 @@ platforms.forEach(platform => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
});
register('should open gender single select', driver => {
const page = new E2ETestPage(driver, platform);
return page.present('#gender', { waitFor: '.alert-wrapper' });
});
register('should open custom action sheet select', driver => {
const page = new E2ETestPage(driver, platform);
return page.present('#customSelect', { waitFor: '.action-sheet-wrapper' });
});
});
});

View File

@ -21,7 +21,7 @@
<ion-item>
<ion-label>Gender</ion-label>
<ion-select class="e2eSelectGender" name="gender" placeholder="Select One">
<ion-select id="gender" placeholder="Select One">
<ion-select-option value="f">Female</ion-select-option>
<ion-select-option value="m">Male</ion-select-option>
</ion-select>
@ -29,7 +29,7 @@
<ion-item>
<ion-label>Hair Color</ion-label>
<ion-select value="brown" name="hairColor" ok-text="Okay" cancel-text="Dismiss">
<ion-select id="hairColor" value="brown" ok-text="Okay" cancel-text="Dismiss">
<ion-select-option value="brown" selected>Brown</ion-select-option>
<ion-select-option value="blonde">Blonde</ion-select-option>
<ion-select-option value="black">Black</ion-select-option>

View File

@ -8,13 +8,6 @@ class E2ETestPage extends Page {
constructor(driver, platform) {
super(driver, `http://localhost:3333/src/components/select/test/multiple-value?ionicplatform=${platform}`);
}
present(buttonId) {
this.navigate();
this.driver.findElement(By.id(buttonId)).click();
this.driver.wait(until.elementLocated(By.css('.select-wrapper')));
return this.driver.wait(until.elementIsVisible(this.driver.findElement(By.css('.select-wrapper'))));
}
}
platforms.forEach(platform => {
@ -23,5 +16,10 @@ platforms.forEach(platform => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
});
register('should open toppings multiple select', driver => {
const page = new E2ETestPage(driver, platform);
return page.present('#toppings', { waitFor: '.alert-wrapper'});
});
});
});

View File

@ -8,13 +8,6 @@ class E2ETestPage extends Page {
constructor(driver, platform) {
super(driver, `http://localhost:3333/src/components/select/test/single-value?ionicplatform=${platform}`);
}
present(buttonId) {
this.navigate();
this.driver.findElement(By.id(buttonId)).click();
this.driver.wait(until.elementLocated(By.css('.select-wrapper')));
return this.driver.wait(until.elementIsVisible(this.driver.findElement(By.css('.select-wrapper'))));
}
}
platforms.forEach(platform => {
@ -23,5 +16,10 @@ platforms.forEach(platform => {
const page = new E2ETestPage(driver, platform);
return page.navigate();
});
register('should open gender single select', driver => {
const page = new E2ETestPage(driver, platform);
return page.present('#gender', { waitFor: '.alert-wrapper'});
});
});
});

View File

@ -19,7 +19,7 @@
<ion-list>
<ion-item>
<ion-label stacked>Gender</ion-label>
<ion-select>
<ion-select id="gender">
<ion-select-option value="f">Female</ion-select-option>
<ion-select-option value="m">Male</ion-select-option>
</ion-select>

View File

@ -9,19 +9,19 @@
</head>
<body>
<ion-select name="gender" placeholder="Select One">
<ion-select id="gender" placeholder="Select One">
<ion-select-option value="f">Female</ion-select-option>
<ion-select-option value="m">Male</ion-select-option>
</ion-select>
<ion-select name="hairColor" ok-text="Okay" cancel-text="Dismiss">
<ion-select id="hairColor" ok-text="Okay" cancel-text="Dismiss">
<ion-select-option value="brown" selected>Brown</ion-select-option>
<ion-select-option value="blonde">Blonde</ion-select-option>
<ion-select-option value="black">Black</ion-select-option>
<ion-select-option value="red">Red</ion-select-option>
</ion-select>
<ion-select name="gaming" ok-text="Okay" cancel-text="Dismiss">
<ion-select id="gaming" ok-text="Okay" cancel-text="Dismiss">
<ion-select-option value="nes">NES</ion-select-option>
<ion-select-option value="n64">Nintendo64</ion-select-option>
<ion-select-option value="ps">PlayStation</ion-select-option>