Skip to content

Commit f59a712

Browse files
Fix tests
1 parent 3e4b46c commit f59a712

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

e2e/pages/base.po.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ export class BasePage {
4444
return browser.navigate().back();
4545
}
4646

47+
async getConsoleLogs() {
48+
const browserLog = await browser.manage().logs().get('browser');
49+
return require('util').inspect(browserLog);
50+
}
51+
4752
async getCurrentProjectId(): Promise<number> {
4853
const url = `${await browser.getCurrentUrl()}/`;
4954
const regexp = /.*\/project\/(\d+)\/.*/;

e2e/pages/login.po/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ class LogIn extends BasePage {
2929
logger.info('Going to log out, before logging in with another user account.');
3030
await this.menuBar.clickLogOut();
3131
}
32-
await expect(await this.isOpened()).toBe(true, 'Was not logged out!');
32+
if (!(await this.isOpened())) {
33+
const logs = await this.getConsoleLogs();
34+
expect(true).toBe(false, `Was not logged out!\nLogs:\n${logs}`);
35+
}
3336
await this.setUserName(userName);
3437
await this.setPassword(password);
3538
await this.clickLogIn();

e2e/specs/milestone/milestoneView.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ describe('Milestone:', () => {
174174

175175
using(editorExamples, (user, description) => {
176176
describe(`Milestone View: ${description} role:`, () => {
177-
let testrun;
177+
let testrun: TestRun;
178178
beforeAll(async () => {
179179
await logIn.logInAs(user.user_name, user.password);
180180
await projectHelper.openProject();

src/app/elements/charts/resultResolutions/resultResolutions.charts.component.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export class ResultResolutionsChartsComponent implements OnChanges, OnInit, OnDe
4949
constructor(
5050
private resultResolutionService: ResultResolutionService,
5151
private globalDataService: GlobalDataService
52-
) {}
52+
) { }
5353

5454
ngOnInit(): void {
5555
this.projectSubscription = this.globalDataService.currentProject$.subscribe(project => {
@@ -58,7 +58,9 @@ export class ResultResolutionsChartsComponent implements OnChanges, OnInit, OnDe
5858
}
5959

6060
ngOnDestroy(): void {
61-
this.projectSubscription.unsubscribe();
61+
if (this.projectSubscription) {
62+
this.projectSubscription.unsubscribe();
63+
}
6264
}
6365

6466
public ngOnChanges() {
@@ -100,7 +102,7 @@ export class ResultResolutionsChartsComponent implements OnChanges, OnInit, OnDe
100102
for (const resultResolution of this.listOfResultResolutions) {
101103
this.doughnutChartLabels.push(
102104
resultResolution.name +
103-
this.calculatePrecentageAndCount(resultResolution.name)
105+
this.calculatePrecentageAndCount(resultResolution.name)
104106
);
105107
}
106108
}

0 commit comments

Comments
 (0)