Skip to content

Commit 1a7677d

Browse files
oodamienjvalkeal
authored andcommitted
Update linter configuration
Fix linter issue Disable eslint indent Resolves #1780 #1777
1 parent 5caf4a7 commit 1a7677d

12 files changed

+62
-94
lines changed

ui/.eslintrc.json

+3-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
],
1515
"parserOptions": {
1616
"project": [
17-
"tsconfig.json"
17+
"src/tsconfig.app.json",
18+
"src/tsconfig.spec.json"
1819
],
1920
"createDefaultProgram": true
2021
},
@@ -57,10 +58,7 @@
5758
"accessibility": "explicit"
5859
}
5960
],
60-
"@typescript-eslint/indent": [
61-
"error",
62-
2
63-
],
61+
"@typescript-eslint/indent": "off",
6462
"@typescript-eslint/member-delimiter-style": [
6563
"error",
6664
{

ui/angular.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@
167167
"lint": {
168168
"builder": "@angular-eslint/builder:lint",
169169
"options": {
170-
"tsConfig": "e2e/tsconfig.e2e.json",
171-
"exclude": [
172-
"**/node_modules/**"
170+
"lintFilePatterns": [
171+
"e2e/src/**/*.ts",
172+
"e2e/src/**/*.html"
173173
]
174174
}
175175
}

ui/e2e/src/app.e2e-spec.ts

+17-28
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
import { browser, element } from 'protractor';
2-
import { AppsPage } from './page/apps/apps.po';
3-
import { ManageRecordsPage } from './page/manage/records.po';
4-
import { ManageImportExportPage } from './page/manage/import-export.po';
5-
import { StreamsListPage } from './page/streams/list.po';
6-
import { StreamsRuntimePage } from './page/streams/runtime.po';
7-
import { TasksJobsTasksPage } from './page/tasks-jobs/tasks.po';
8-
import { TasksJobsExecutionsPage } from './page/tasks-jobs/executions.po';
9-
import { TasksJobsJobExecutionsPage } from './page/tasks-jobs/job-executions.po';
1+
import {browser, element} from 'protractor';
2+
import {AppsPage} from './page/apps/apps.po';
3+
import {ManageRecordsPage} from './page/manage/records.po';
4+
import {ManageImportExportPage} from './page/manage/import-export.po';
5+
import {StreamsListPage} from './page/streams/list.po';
6+
import {StreamsRuntimePage} from './page/streams/runtime.po';
7+
import {TasksJobsTasksPage} from './page/tasks-jobs/tasks.po';
8+
import {TasksJobsExecutionsPage} from './page/tasks-jobs/executions.po';
9+
import {TasksJobsJobExecutionsPage} from './page/tasks-jobs/job-executions.po';
1010

1111
describe('should display the pages', () => {
12-
1312
let appsPage: AppsPage;
1413
let manageRecordsPage: ManageRecordsPage;
1514
let manageImportExportPage: ManageImportExportPage;
@@ -34,76 +33,66 @@ describe('should display the pages', () => {
3433
});
3534

3635
describe('Apps', () => {
37-
38-
it('should display the apps page', async (done) => {
36+
it('should display the apps page', async done => {
3937
await appsPage.navigateTo();
4038
const title = await appsPage.getTitle();
4139
expect(element(title).getText()).toEqual('Applications');
4240
done();
4341
});
44-
4542
});
4643

4744
describe('Manage section', () => {
48-
49-
50-
it('should display the record page', async (done) => {
45+
it('should display the record page', async done => {
5146
await manageRecordsPage.navigateTo();
5247
const title = await manageRecordsPage.getTitle();
5348
expect(element(title).getText()).toEqual('Audit Records');
5449
done();
5550
});
5651

57-
it('should display the Import / Export page', async (done) => {
52+
it('should display the Import / Export page', async done => {
5853
await manageImportExportPage.navigateTo();
5954
const title = await manageImportExportPage.getTitle();
6055
expect(element(title).getText()).toEqual('Import / Export');
6156
done();
6257
});
63-
6458
});
6559

6660
describe('Streams section', () => {
67-
68-
it('should display the stream page', async (done) => {
61+
it('should display the stream page', async done => {
6962
await streamsListPage.navigateTo();
7063
const title = await streamsListPage.getTitle();
7164
expect(element(title).getText()).toEqual('Streams');
7265
done();
7366
});
7467

75-
it('should display the runtime page', async (done) => {
68+
it('should display the runtime page', async done => {
7669
await streamsRuntimePage.navigateTo();
7770
const title = await streamsRuntimePage.getTitle();
7871
expect(element(title).getText()).toEqual('Runtime');
7972
done();
8073
});
81-
8274
});
8375

8476
describe('Tasks section', () => {
85-
86-
it('should display the task page', async (done) => {
77+
it('should display the task page', async done => {
8778
await tasksJobsTasksPage.navigateTo();
8879
const title = await tasksJobsTasksPage.getTitle();
8980
expect(element(title).getText()).toEqual('Tasks');
9081
done();
9182
});
9283

93-
it('should display the task executions page', async (done) => {
84+
it('should display the task executions page', async done => {
9485
await tasksJobsExecutionsPage.navigateTo();
9586
const title = await tasksJobsExecutionsPage.getTitle();
9687
expect(element(title).getText()).toEqual('Task Executions');
9788
done();
9889
});
9990

100-
it('should display the job executions page', async (done) => {
91+
it('should display the job executions page', async done => {
10192
await tasksJobsJobExecutionsPage.navigateTo();
10293
const title = await tasksJobsJobExecutionsPage.getTitle();
10394
expect(element(title).getText()).toEqual('Job Executions');
10495
done();
10596
});
106-
10797
});
108-
10998
});

ui/e2e/src/page/apps/apps.po.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import { browser, by } from 'protractor';
2-
import { ElementHelper } from '../../utils/element.helper';
1+
import {browser, by} from 'protractor';
2+
import {ElementHelper} from '../../utils/element.helper';
33

44
export class AppsPage {
5-
65
navigateTo() {
76
return browser.get(`#/apps`);
87
}
98

109
getTitle() {
1110
return ElementHelper.getElement(by.css('.content-area h1'));
1211
}
13-
1412
}
+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import { browser, by } from 'protractor';
2-
import { ElementHelper } from '../../utils/element.helper';
1+
import {browser, by} from 'protractor';
2+
import {ElementHelper} from '../../utils/element.helper';
33

44
export class ManageImportExportPage {
5-
65
navigateTo() {
76
return browser.get(`#/manage/import-export`);
87
}
98

109
getTitle() {
1110
return ElementHelper.getElement(by.css('.content-area h1'));
1211
}
13-
1412
}

ui/e2e/src/page/manage/records.po.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import { browser, by } from 'protractor';
2-
import { ElementHelper } from '../../utils/element.helper';
1+
import {browser, by} from 'protractor';
2+
import {ElementHelper} from '../../utils/element.helper';
33

44
export class ManageRecordsPage {
5-
65
navigateTo() {
76
return browser.get(`#/manage/records`);
87
}
98

109
getTitle() {
1110
return ElementHelper.getElement(by.css('.content-area h1'));
1211
}
13-
1412
}

ui/e2e/src/page/streams/list.po.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import { browser, by } from 'protractor';
2-
import { ElementHelper } from '../../utils/element.helper';
1+
import {browser, by} from 'protractor';
2+
import {ElementHelper} from '../../utils/element.helper';
33

44
export class StreamsListPage {
5-
65
navigateTo() {
76
return browser.get(`#/streams/list`);
87
}
98

109
getTitle() {
1110
return ElementHelper.getElement(by.css('.content-area h1'));
1211
}
13-
1412
}

ui/e2e/src/page/streams/runtime.po.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import { browser, by } from 'protractor';
2-
import { ElementHelper } from '../../utils/element.helper';
1+
import {browser, by} from 'protractor';
2+
import {ElementHelper} from '../../utils/element.helper';
33

44
export class StreamsRuntimePage {
5-
65
navigateTo() {
76
return browser.get(`#/streams/runtime`);
87
}
98

109
getTitle() {
1110
return ElementHelper.getElement(by.css('.content-area h1'));
1211
}
13-
1412
}
+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import { browser, by } from 'protractor';
2-
import { ElementHelper } from '../../utils/element.helper';
1+
import {browser, by} from 'protractor';
2+
import {ElementHelper} from '../../utils/element.helper';
33

44
export class TasksJobsExecutionsPage {
5-
65
navigateTo() {
76
return browser.get(`#/tasks-jobs/task-executions`);
87
}
98

109
getTitle() {
1110
return ElementHelper.getElement(by.css('.content-area h1'));
1211
}
13-
1412
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import { browser, by } from 'protractor';
2-
import { ElementHelper } from '../../utils/element.helper';
1+
import {browser, by} from 'protractor';
2+
import {ElementHelper} from '../../utils/element.helper';
33

44
export class TasksJobsJobExecutionsPage {
5-
65
navigateTo() {
76
return browser.get(`#/tasks-jobs/job-executions`);
87
}
98

109
getTitle() {
1110
return ElementHelper.getElement(by.css('.content-area h1'));
1211
}
13-
1412
}
+2-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
import { browser, by } from 'protractor';
2-
import { ElementHelper } from '../../utils/element.helper';
1+
import {browser, by} from 'protractor';
2+
import {ElementHelper} from '../../utils/element.helper';
33

44
export class TasksJobsTasksPage {
5-
65
navigateTo() {
76
return browser.get(`#/tasks-jobs/tasks`);
87
}
98

109
getTitle() {
1110
return ElementHelper.getElement(by.css('.content-area h1'));
1211
}
13-
1412
}

ui/e2e/src/utils/element.helper.ts

+23-26
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,41 @@
1-
import { browser, element, ElementFinder, ProtractorBy, ElementArrayFinder } from 'protractor';
2-
import { protractor } from 'protractor/built/ptor';
3-
import { By } from 'selenium-webdriver';
1+
import {browser, element, ElementFinder, ProtractorBy, ElementArrayFinder} from 'protractor';
2+
import {protractor} from 'protractor/built/ptor';
3+
import {By} from 'selenium-webdriver';
44

55
const EC = protractor.ExpectedConditions;
66

77
const defaultTimeout = 30000;
88

99
export class ElementHelper {
10-
1110
public static async u(e: By): Promise<number> {
1211
return element.all(await ElementHelper.getElement(e)).count();
1312
}
1413

1514
public static async getElement(byValue: By): Promise<By> {
1615
const conditionA = EC.visibilityOf(element(byValue));
17-
return browser.wait(
18-
EC.and(conditionA), defaultTimeout)
19-
.then(() => byValue, () => {
16+
return browser.wait(EC.and(conditionA), defaultTimeout).then(
17+
() => byValue,
18+
() => {
2019
fail(`No visible emelement for '${byValue}'.`);
2120
return byValue;
22-
});
21+
}
22+
);
2323
}
2424

2525
public static getClickableElementOrWait(by: By) {
2626
const conditionA = EC.visibilityOf(element(by));
27-
return browser.wait(
28-
EC.and(conditionA), defaultTimeout, 'getClickableElementOrWait failed.')
27+
return browser
28+
.wait(EC.and(conditionA), defaultTimeout, 'getClickableElementOrWait failed.')
2929
.then(() => element(by));
3030
}
3131

3232
public static async waitForSpinners() {
3333
const conditionB = EC.invisibilityOf(element(By.css('.app-blocker')));
3434
const conditionC = EC.invisibilityOf(element(By.css('modal-body')));
35-
await browser.wait(() => {
36-
return EC.and(conditionB, conditionC);
37-
}, defaultTimeout, 'waitForSpinners failed.');
35+
await browser.wait(() => EC.and(conditionB, conditionC), defaultTimeout, 'waitForSpinners failed.');
3836
}
3937

40-
4138
public static async clickElement(by: By, clickFirst: boolean, parent: ElementFinder): Promise<boolean> {
42-
4339
console.log('Clicking ' + by);
4440

4541
let returnValue = false;
@@ -67,7 +63,7 @@ export class ElementHelper {
6763

6864
if (clickFirst) {
6965
const t = parent.all(by);
70-
if (await t.count() > 0) {
66+
if ((await t.count()) > 0) {
7167
clickableElement = t.first();
7268
} else {
7369
returnValue = false;
@@ -78,15 +74,17 @@ export class ElementHelper {
7874

7975
console.log(`Attempt ${attempt} for clickableElement:` + clickableElement);
8076

81-
await clickableElement.click().then(() => {
82-
console.log(`Successfully Clicked: ${by} (Attempt: ${attempt})`);
83-
clearTimeout(timeout);
84-
returnValue = true;
85-
}, () => {
86-
console.log(`Failed click: ${by} (Attempt: ${attempt})`);
87-
returnValue = false;
88-
});
89-
77+
await clickableElement.click().then(
78+
() => {
79+
console.log(`Successfully Clicked: ${by} (Attempt: ${attempt})`);
80+
clearTimeout(timeout);
81+
returnValue = true;
82+
},
83+
() => {
84+
console.log(`Failed click: ${by} (Attempt: ${attempt})`);
85+
returnValue = false;
86+
}
87+
);
9088
}
9189
});
9290

@@ -99,5 +97,4 @@ export class ElementHelper {
9997
await browser.wait(EC.elementToBeClickable(clickableElement), 15000);
10098
await clickableElement.click();
10199
}
102-
103100
}

0 commit comments

Comments
 (0)