Skip to content

Commit d9566ce

Browse files
Fix some tests
1 parent cc41fef commit d9566ce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+357
-669
lines changed

debug.log

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[0327/100856.544:ERROR:process_reader_win.cc(123)] NtOpenThread: {Access Denied} A process has requested access to an object, but has not been granted those access rights. (0xc0000022)
2+
[0327/100856.545:ERROR:exception_snapshot_win.cc(98)] thread ID 15224 not found in process
3+
[0327/100856.559:ERROR:process_reader_win.cc(123)] NtOpenThread: {Access Denied} A process has requested access to an object, but has not been granted those access rights. (0xc0000022)
4+
[0327/100856.560:ERROR:exception_snapshot_win.cc(98)] thread ID 10828 not found in process

e2e/api/editor.api.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Milestone } from '../../src/app/shared/models/milestone';
66
import { sendPost, sendGet, sendDelete } from '../utils/aqualityTrackingAPI.util';
77
import { TestResult } from '../../src/app/shared/models/test-result';
88
import { BaseAPI } from './base.api';
9+
import { Issue } from '../../src/app/shared/models/issue';
910

1011
enum Endpoints {
1112
suite = '/suite',
@@ -15,7 +16,8 @@ enum Endpoints {
1516
milestone = '/milestone',
1617
testresult = '/testresult',
1718
testSteps = '/test/steps',
18-
testToSuite = '/testToSuite'
19+
testToSuite = '/testToSuite',
20+
issue = '/issues'
1921
}
2022

2123
export class EditorAPI extends BaseAPI {
@@ -85,6 +87,12 @@ export class EditorAPI extends BaseAPI {
8587
return sendDelete(Endpoints.testrun, { id: testRunId, project_id: this.project.id }, null, this.token, this.project.id);
8688
}
8789

90+
public async createIssue(issue: Issue): Promise<Issue> {
91+
issue.project_id = this.project.id;
92+
issue.creator_id = 1;
93+
return sendPost(Endpoints.issue, undefined, issue, this.token, this.project.id);
94+
}
95+
8896
public async addSuiteToMilestone(milestoneName: string, suiteName: string) {
8997
const milestone: Milestone = (await this.getMilestones({ name: milestoneName }))[0];
9098
const suite: TestSuite = (await this.getSuites({ name: suiteName }))[0];

e2e/data/resolutions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,27 @@
55
},
66
"global": {
77
"notAssigned": {
8+
"id": 1,
89
"name": "Not Assigned",
910
"color": "Primary"
1011
},
1112
"appIssue": {
13+
"id": 2,
1214
"name": "Application Issue",
1315
"color": "Danger"
1416
},
1517
"environmentIssue": {
18+
"id": 3,
1619
"name": "Environment Issue",
1720
"color": "Warning"
1821
},
1922
"testIssue": {
23+
"id": 4,
2024
"name": "Test Issue",
2125
"color": "Warning"
2226
},
2327
"testDesignIssue": {
28+
"id": 5,
2429
"name": "Test Design Issue",
2530
"color": "Warning"
2631
}

e2e/elements/autocomplete.element.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { by, Locator } from 'protractor';
1+
import { by, Locator, browser } from 'protractor';
22
import { BaseElement } from './base.element';
33
import { Input } from './input.element';
44
import { WithSearch } from './interfaces/elementWithSearch';
@@ -16,7 +16,9 @@ export class Autocomplete extends BaseElement implements WithSearch {
1616
}
1717

1818
public selectOption(value: string) {
19-
return this.findOption(value).click();
19+
const option = this.findOption(value);
20+
browser.executeScript('arguments[0].scrollIntoView();', option.getWebElement());
21+
return option.click();
2022
}
2123

2224
public async select(value: string) {

e2e/elements/lookup.element.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { by, Locator } from 'protractor';
22
import { BaseElement } from './base.element';
3+
import { logger } from '../utils/log.util';
34

45
export class Lookup extends BaseElement {
56
constructor(locator: Locator) {
@@ -8,8 +9,13 @@ export class Lookup extends BaseElement {
89

910
private selector = this.element.element(by.css('.selector-main-button'));
1011

11-
public getSelectedValue() {
12-
return this.selector.getText();
12+
public async getSelectedValue() {
13+
if (await this.selector.isPresent()) {
14+
return this.selector.getText();
15+
}
16+
17+
logger.warn(`Colored Lookup '${this.element.locator()}' is hidden!`);
18+
return '';
1319
}
1420

1521
public openSelector() {

e2e/elements/menuBar.element/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ export class MenuBar {
5151
return element(by.id('Test Runs')).click();
5252
}
5353

54+
issues() {
55+
return element(by.id('Issues')).click();
56+
}
57+
5458
project(projectName: string) {
5559
return element(by.id(projectName)).click();
5660
}

e2e/elements/smartTable.element/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ export class SmartTable extends BaseElement {
7272
return new Row(rows[0]);
7373
}
7474

75-
public async getElementsForCell(columnName: string, searchValue: string | number, searchName: string): Promise<CellElements> {
75+
public async getElementsForCell(columnName: string, searchValue: string | number, searchColumn: string): Promise<CellElements> {
7676
const columnIndex = await this.getColumnIndex(columnName);
77-
return (await this.getRow(searchValue, searchName)).getRowElements(columnIndex);
77+
return (await this.getRow(searchValue, searchColumn)).getRowElements(columnIndex);
7878
}
7979

8080
public async getRowByIndex(index: number): Promise<Row> {

e2e/helpers/project.helper.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { User } from '../../src/app/shared/models/user';
1010
import { logger } from '../utils/log.util';
1111
import { Importer } from '../api/importer.api';
1212
import { EditorAPI } from '../api/editor.api';
13-
import projects from '../data/projects.json';
1413
import usersTestData from '../data/users.json';
1514
import { PublicAPI } from '../api/public.api';
1615

@@ -26,15 +25,20 @@ export enum PermissionType {
2625
}
2726

2827
export class ProjectHelper {
29-
public project: Project = projects.customerOnly;
28+
public project: Project;
3029
public importer: Importer;
3130
public editorAPI: EditorAPI;
3231
public publicAPI: PublicAPI;
3332
private admin = usersTestData.admin;
3433

35-
constructor(name?: string) {
36-
this.project.name = name
37-
? name
34+
constructor(projectName?: string) {
35+
this.project = {
36+
customer: {
37+
name: '-'
38+
}
39+
};
40+
this.project.name = projectName !== undefined
41+
? `${projectName} ${new Date().getTime().toString()}`
3842
: new Date().getTime().toString();
3943
}
4044

e2e/pages/administration/base.po/constants.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export const elements = {
88
bodyPattern: element(by.css('#body-pattern-administration')),
99
apiToken: element(by.css('#api-token-administration')),
1010
settings: element(by.css('#projectSettings-administration')),
11-
predefinedResolutions: element(by.css('#predefined-resolution')),
1211
};
1312

1413

e2e/pages/administration/base.po/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export class AdministrationBase extends BasePage {
1515
resolutions: () => elements.resolutions.click(),
1616
users: () => elements.users.click(),
1717
projectSettings: () => elements.settings.click(),
18-
predefinedResolutions: () => elements.predefinedResolutions.click(),
1918
isPermissionsExist: (): promise.Promise<boolean> => elements.permissions.isPresent(),
2019
isProjectSettingsExist: (): promise.Promise<boolean> => elements.settings.isPresent(),
2120
isApiTokenExist: (): promise.Promise<boolean> => elements.apiToken.isPresent()

0 commit comments

Comments
 (0)