Skip to content

Commit a52f0cc

Browse files
akshaysonvaneaebadirad
authored andcommitted
Dhfprod 662 qs stuck (#1726)
* Updated logic to enable finished button Added finished method * Updated UI test to click Finished button after Installation
1 parent a6b8fc3 commit a52f0cc

File tree

6 files changed

+30
-16
lines changed

6 files changed

+30
-16
lines changed

quick-start/e2e/page-objects/auth/login.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export class LoginPage extends AppPage {
8383
}
8484

8585
get finishedButton() {
86-
return element(by.css('#finished-button'));
86+
return element(by.buttonText('Finished'));
8787
}
8888

8989
get dataHubNameLabel() {
@@ -148,6 +148,10 @@ export class LoginPage extends AppPage {
148148
await element(by.css('#installer-button')).click();
149149
}
150150

151+
async clickFinished() {
152+
await this.finishedButton.click();
153+
}
154+
151155
//get userName element
152156
get userName(){
153157
return element(by.css('input#username'))

quick-start/e2e/specs/auth/authenticated.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,14 +199,15 @@ export default function(tmpDir) {
199199
console.log('modified jasmine timeout: ' + jasmine.DEFAULT_TIMEOUT_INTERVAL);
200200
browser.wait(EC.presenceOf(loginPage.installProgress), 600000, 'install progress is not present');
201201
expect(loginPage.installProgress.isDisplayed()).toBe(true);
202-
browser.wait(EC.visibilityOf(appPage.flowsTab), 600000, 'dashboard page is not displayed');
202+
browser.wait(EC.elementToBeClickable(loginPage.finishedButton), 600000, 'finished button is not displayed');
203203
jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout;
204204
console.log('changed back to original jasmine timeout: ' + jasmine.DEFAULT_TIMEOUT_INTERVAL);
205205
});
206206

207-
it ('should complete the install and go to the dashboard', function() {
208-
console.log('refresh the browser');
209-
browser.refresh();
207+
it ('should complete the install and go to the dashboard', async function() {
208+
browser.driver.sleep(3000);
209+
console.log('clicking Finished button');
210+
await loginPage.clickFinished();
210211
console.log('loading dashboard page');
211212
dashboardPage.isLoaded();
212213
expect(appPage.flowsTab.isDisplayed()).toBe(true);

quick-start/src/main/ui/app/login/login.component.ts

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import * as SemVer from 'semver';
3636
(onInstall)="this.install()"
3737
(onUninstall)="this.unInstall()"
3838
(onInstallNext)="this.installNext()"
39+
(onFinished)="this.finished()"
3940
(onChooseProject)="this.chooseProject()"
4041
(onPostInitNext)="this.postInitNext()"
4142
(onLogin)="this.login()"
@@ -156,20 +157,26 @@ export class LoginComponent implements OnInit {
156157
this.installing = false;
157158
this.installationStatus = null;
158159
emitter.unsubscribe();
159-
160-
let installInfo = this.currentEnvironment.installInfo;
161-
if (installInfo && installInfo.installed) {
162-
// goto login tab
163-
let redirect = this.auth.redirectUrl || '';
164-
this.router.navigate([redirect]);
165-
} else {
166-
// go to install hub tab
167-
this.loginUi.gotoTab('Installer');
168-
}
169160
})
170161
});
171162
}
172163

164+
finished() {
165+
this.projectService.getProjectEnvironment().subscribe((env: any) => {
166+
this.currentEnvironment = env;
167+
168+
let installInfo = this.currentEnvironment.installInfo;
169+
if (installInfo && installInfo.installed) {
170+
// goto login tab
171+
let redirect = this.auth.redirectUrl || '';
172+
this.router.navigate([redirect]);
173+
} else {
174+
// go to install hub tab
175+
this.loginUi.gotoTab('Installer');
176+
}
177+
});
178+
}
179+
173180
unInstall() {
174181
this.uninstalling = true;
175182

quick-start/src/main/ui/app/shared/components/login/login-ui.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ <h3>DHF Project Version Mismatch!</h3>
374374

375375
<div layout="row" layout-align="end center" class="init-buttons">
376376
<button type="button" mdl-button (click)="back()">&lt; Back</button>
377-
<button id="finished-button" type="button" mdl-button mdl-button-type="raised" [disabled]="!currentEnvironment.installInfo.installed" (click)="onInstallNext.emit()">Finished</button>
377+
<button id="finished-button" type="button" mdl-button mdl-button-type="raised" [disabled]="percentComplete!=100" (click)="onFinished.emit()">Finished</button>
378378
</div>
379379
</div>
380380
</div>

quick-start/src/main/ui/app/shared/components/login/login-ui.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ export class LoginUIComponent {
3333
@Output() onInstall: EventEmitter<any> = new EventEmitter<any>();
3434
@Output() onUninstall: EventEmitter<any> = new EventEmitter<any>();
3535
@Output() onInstallNext: EventEmitter<any> = new EventEmitter<any>();
36+
@Output() onFinished: EventEmitter<any> = new EventEmitter<any>();
3637
@Output() onLogin: EventEmitter<any> = new EventEmitter<any>();
3738
@Output() onHubNameChanged: EventEmitter<any> = new EventEmitter<any>();
3839
@Output() onGotEnvironment: EventEmitter<any> = new EventEmitter<any>();

quick-start/src/main/ui/app/shared/stories/components/login/login.component.stories.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ storiesOf('Components|Login', module)
4646
(onInstall)='onInstall'
4747
(onUninstall)='onUninstall'
4848
(onInstallNext)='onInstallNext'
49+
(onFinished)='onFinished'
4950
(onChooseProject)='onChooseProject'
5051
(onPostInitNext)='onPostInitNext'
5152
(onLogin)='onLogin'

0 commit comments

Comments
 (0)