Skip to content

Commit 6d74b70

Browse files
Merge pull request #69 from aquality-automation/develop
0.3.4
2 parents 1ccaaf9 + 7bcb149 commit 6d74b70

Some content is hidden

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

48 files changed

+841
-511
lines changed

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# CHANGELOG
22

3+
## 0.3.4 (2019-12-10)
4+
5+
Features:
6+
- Remove Customers Feature -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/25)
7+
- Add 'Steps' label into Test page -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/31)
8+
- Add ID column to Suites List -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/18)
9+
- Add possibility to sync testsuites according to Not Executed results -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/32)
10+
- Add Executor and Pass Rate column to Test Run List table -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/41)
11+
12+
Bugfixes:
13+
- It should not be possible to delete Customer that assigned to the projects -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/9)
14+
- Link "View on Aquality Tracking" in report email is broken -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/30)
15+
- Link from the audit email notification is invalid -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/13)
16+
- Audits feature is visible when disabled -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/24)
17+
- All available test are shown in tests list after updating Suite for some test -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/27)
18+
- There is no scrolling in dashboard configuration -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/14)
19+
- Empty line on dashboard if suite have no data -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/15)
20+
- Suites Dashboard: Data refresh working wrong with empty cards -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/40)
21+
- Suites Dashboard: Data is not updated for empty cards -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/39)
22+
323
## 0.3.3 (2019-11-16)
424

525
Features:
@@ -34,4 +54,4 @@ Features:
3454

3555
Bugfixes:
3656

37-
- Fix Fail Reason Search
57+
- Fix Fail Reason Search

e2e/elements/menuBar.element/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import { by, element } from 'protractor';
1+
import { by, element, promise } from 'protractor';
22
import { CreateOptions } from './create.options';
33
import { TestsOptions } from './tests.options';
44
import { UserOptions } from './user.options';
55
import { AuditsOptions } from './audits.options';
66

77
export class MenuBar {
8+
private auditsButton = element(by.css('#Audits > a'));
9+
810
clickLogo() {
911
return element(by.css('.navbar-brand')).click();
1012
}
@@ -28,7 +30,7 @@ export class MenuBar {
2830
}
2931

3032
async audits() {
31-
await element(by.css('#Audits > a')).click();
33+
await this.auditsButton.click();
3234
return new AuditsOptions();
3335
}
3436

@@ -54,4 +56,8 @@ export class MenuBar {
5456
await element(by.id('user-mb')).click();
5557
return new UserOptions();
5658
}
59+
60+
isAuditTabExists(): promise.Promise<boolean> {
61+
return this.auditsButton.isPresent();
62+
}
5763
}

e2e/elements/multiselect.element.ts

Lines changed: 26 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, ElementFinder } from 'protractor';
22
import { BaseElement } from './base.element';
33
import { WithSearch } from './interfaces/elementWithSearch';
44

@@ -9,6 +9,9 @@ export class Multiselect extends BaseElement implements WithSearch {
99

1010
private search = this.element.element(by.css('.ms-search'));
1111
private selector = this.element.element(by.css('.ms-main-selector'));
12+
private disabledElement = this.element.element(by.css('.disabled-lookup'));
13+
private msBoxes = this.element.all(by.css('.ms-box > .ms-box-text'));
14+
private removeMsBox = (name: string): ElementFinder => this.element.element(by.css(`.ms-box[title='${name}'] > .remove-ms-box`));
1215

1316
public openSelector() {
1417
return this.selector.click();
@@ -28,7 +31,28 @@ export class Multiselect extends BaseElement implements WithSearch {
2831
return this.selectOption(value);
2932
}
3033

34+
public remove(name: string) {
35+
return this.removeMsBox(name).click();
36+
}
37+
38+
public async isEditable() {
39+
return !(await this.disabledElement.isPresent());
40+
}
41+
42+
public async getValue() {
43+
if (this.isEditable()) {
44+
const values = [];
45+
const msBoxes = await this.msBoxes;
46+
for (let i = 0; i < msBoxes.length; i++) {
47+
values.push(await msBoxes[i].getText());
48+
}
49+
return values;
50+
}
51+
52+
return (await this.disabledElement.getText()).split(', ');
53+
}
54+
3155
private findOption(value: string) {
32-
return this.element.element(by.xpath(`//*[contains(@class, "selector-suggestions")]//li[@title="${value}"]`));
56+
return this.element.element(by.css(`.selector-suggestions li[title="${value}"]`));
3357
}
3458
}

e2e/elements/smartTable.element/index.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { by, Locator, ElementFinder, browser, protractor, ElementArrayFinder, element } from 'protractor';
1+
import { by, Locator, ElementFinder, browser, protractor, ElementArrayFinder, element, promise } from 'protractor';
22
import { BaseElement } from '../base.element';
33
import { logger } from '../../utils/log.util';
44
import { Lookup } from '../lookup.element';
@@ -200,6 +200,12 @@ export class SmartTable extends BaseElement {
200200
return cell.getText();
201201
}
202202

203+
public async getCellValue(column: string, searchValue: string | number, searchColumn: string): Promise<string|string[]> {
204+
const columnIndex = await this.getColumnIndex(column);
205+
const row = await this.getRow(searchValue, searchColumn);
206+
return row.getRowCellValue(columnIndex);
207+
}
208+
203209
public async getCellTextUsingRowIndex(columnWithText: string, rowIndex: number): Promise<string> {
204210
const cell = await this.getCellUsingRowIndex(columnWithText, rowIndex);
205211
return cell.getText();
@@ -311,6 +317,18 @@ export class SmartTable extends BaseElement {
311317
return index >= 0;
312318
}
313319

320+
public async addValueFromMultiselect(value: string, column: string, searchValue: string, searchColumn: string) {
321+
const index = await this.getColumnIndex(column);
322+
const row = await this.getRow(searchValue, searchColumn);
323+
return row.addMultiselectValueByColumnIndex(value, index);
324+
}
325+
326+
public async removeValueFromMultiselect(value: string, column: string, searchValue: string, searchColumn: string) {
327+
const index = await this.getColumnIndex(column);
328+
const row = await this.getRow(searchValue, searchColumn);
329+
return row.removeMultiselectValueByColumnIndex(value, index);
330+
}
331+
314332
private isCreationOpened() {
315333
return this.creationRow.isPresent();
316334
}

e2e/elements/smartTable.element/row.element.ts

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Autocomplete } from '../autocomplete.element';
77
import { InlineEditor } from '../inlineEditor.element';
88
import { logger } from '../../utils/log.util';
99
import { InlineAttach } from '../inlineAttach.element';
10+
import { Multiselect } from '../multiselect.element';
1011

1112
export class Row extends BaseElement {
1213
constructor(locator: ElementFinder | Locator) {
@@ -52,7 +53,8 @@ export class Row extends BaseElement {
5253
new Autocomplete(cell.element(by.xpath(`.//lookup-autocomplete`))),
5354
inlineEditor: () => new InlineEditor(cell.element(by.tagName('inline-editor'))),
5455
lookup: () => new Lookup(cell.element(by.xpath('.//lookup-colored'))),
55-
inlineAttachment: () => new InlineAttach(cell.element(by.xpath('.//attachment-inline')))
56+
inlineAttachment: () => new InlineAttach(cell.element(by.xpath('.//attachment-inline'))),
57+
multiselect: () => new Multiselect(cell.element(by.xpath('.//lookup-autocomplete-multiselect')))
5658
};
5759
}
5860

@@ -82,6 +84,30 @@ export class Row extends BaseElement {
8284
throw new Error(`You are trying to edit not editable ${columnIndex} column!`);
8385
}
8486

87+
public async addMultiselectValueByColumnIndex(value: string, columnIndex: number) {
88+
const rowElements = await this.getRowElements(columnIndex);
89+
if (await this.isCellContainsEditableElement(columnIndex)) {
90+
if (await rowElements.multiselect().element.isPresent()) {
91+
return rowElements.multiselect().select(value);
92+
}
93+
throw new Error(`Column ${columnIndex} does not contain multiselect!`);
94+
}
95+
96+
throw new Error(`You are trying to edit not editable ${columnIndex} column!`);
97+
}
98+
99+
public async removeMultiselectValueByColumnIndex(value: string, columnIndex: number) {
100+
const rowElements = await this.getRowElements(columnIndex);
101+
if (await this.isCellContainsEditableElement(columnIndex)) {
102+
if (await rowElements.multiselect().element.isPresent()) {
103+
return rowElements.multiselect().remove(value);
104+
}
105+
throw new Error(`Column ${columnIndex} does not contain multiselect!`);
106+
}
107+
108+
throw new Error(`You are trying to edit not editable ${columnIndex} column!`);
109+
}
110+
85111
public async isCellContainsEditableElement(columnIndex: number) {
86112
const rowElements = await this.getRowElements(columnIndex);
87113
if (await rowElements.inlineEditor().element.isPresent()) {
@@ -105,19 +131,24 @@ export class Row extends BaseElement {
105131
if (await rowElements.inlineAttachment().element.isPresent()) {
106132
return rowElements.inlineAttachment().isEditable();
107133
}
134+
if (await rowElements.multiselect().element.isPresent()) {
135+
return rowElements.multiselect().isEditable();
136+
}
108137
return false;
109138
}
110139

111140
public async getRowCellValue(columnIndex: number) {
112141
const rowElements = await this.getRowElements(columnIndex);
113142
if (await rowElements.input().element.isPresent()) {
114143
return rowElements.input().getValue();
115-
} if (await rowElements.coloredLookup().element.isPresent()) {
144+
} else if (await rowElements.coloredLookup().element.isPresent()) {
116145
return rowElements.coloredLookup().getSelectedValue();
117-
} if (await rowElements.lookup().element.isPresent()) {
146+
} else if (await rowElements.lookup().element.isPresent()) {
118147
return rowElements.lookup().getSelectedValue();
119-
} if (await rowElements.checkbox().element.isPresent()) {
148+
} else if (await rowElements.checkbox().element.isPresent()) {
120149
return rowElements.checkbox().isSelected();
150+
} else if (await rowElements.multiselect().element.isPresent()) {
151+
return rowElements.multiselect().getValue();
121152
} else {
122153
return (await this.getCellFromRow(columnIndex)).getText();
123154
}
@@ -156,4 +187,5 @@ export class CellElements {
156187
inlineEditor: () => InlineEditor;
157188
lookup: () => Lookup;
158189
inlineAttachment: () => InlineAttach;
190+
multiselect: () => Multiselect;
159191
}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
import { by, element } from 'protractor';
22
import { Input } from '../../../elements/input.element';
33
import { LargeTextContainer } from '../../../elements/largeTextContainer';
4+
import { UiSwitch } from '../../../elements/ui-switch';
45

56
export const baseUrl = '#/administration/global/appSettings';
67

78
export const elements = {
89
uniqueElement: element(by.css('#app-settings-administration.active')),
910
defaultEmailPattern: new Input(by.id('defaultEmailPattern')),
1011
defaultEmailPatternhint: new LargeTextContainer(by.id('defaultEmailPatternHint')),
11-
saveEmailSettings: element(by.id('saveEmailSettings'))
12+
saveEmailSettings: element(by.id('saveEmailSettings')),
13+
saveGeneralSettings: element(by.id('save-general')),
14+
auditsModuleSwitch: new UiSwitch(by.id('audits-module'))
1215
};
1316

1417
export const names = {

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,16 @@ export class AppSettings extends AdministrationBase {
3030
toggleHint() {
3131
return elements.defaultEmailPatternhint.toggle();
3232
}
33+
34+
saveGeneralSettings() {
35+
return elements.saveGeneralSettings.click();
36+
}
37+
38+
disableAuditModule() {
39+
return elements.auditsModuleSwitch.switchOff();
40+
}
41+
42+
enableAuditModule() {
43+
return elements.auditsModuleSwitch.switchOn();
44+
}
3345
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ export class UserAdministration extends AdministrationBase {
111111
await this.fillPassword(user.password);
112112
await this.fillConfirmPassword(user.password);
113113
await this.setUnitCoordinator(user.unit_coordinator);
114-
await this.setAccountManager(user.account_manager);
115114
await this.setAdmin(user.admin);
116115
await this.setCoordinator(user.manager);
117116
await this.setAuditor(user.auditor);

e2e/pages/suite/view.po/index.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,30 @@ export class SuiteView extends BasePage {
3535
}
3636

3737
async clickMoveTest() {
38-
return elements.moveTestBtn.click();
38+
return elements.moveTestBtn.click();
3939
}
4040

4141
openTest(testName: string) {
42-
return elements.testsTable.clickRow(testName, columns.name);
42+
return elements.testsTable.clickRow(testName, columns.name);
43+
}
44+
45+
removeSuite(suiteName: string, testName: string) {
46+
return elements.testsTable.removeValueFromMultiselect(suiteName, columns.suites, testName, columns.name);
47+
}
48+
49+
addSuite(suiteName: string, testName: string) {
50+
return elements.testsTable.addValueFromMultiselect(suiteName, columns.suites, testName, columns.name);
51+
}
52+
53+
getTestSuites(testName: string): Promise<string[]|string> {
54+
return elements.testsTable.getCellValue(columns.suites, testName, columns.name);
55+
}
56+
57+
isTableEditable(): Promise<boolean> {
58+
return elements.testsTable.isRowEditableByIndex(0);
59+
}
60+
61+
isTestPresent(name: string): Promise<boolean> {
62+
return elements.testsTable.isRowExists(name, columns.name);
4363
}
4464
}

e2e/specs/administration/appSettings.spec.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,29 @@ describe('Full Admin Administartion User Flow', () => {
2626
}
2727
});
2828

29+
30+
describe('Audit Module', () => {
31+
it('I can disable Audit Module', async () => {
32+
await userAdministration.sidebar.appSettings();
33+
await appSettings.disableAuditModule();
34+
await appSettings.saveGeneralSettings();
35+
await appSettings.menuBar.clickLogo();
36+
return expect(projectList.menuBar.isAuditTabExists()).toBe(false, 'Audit Module is not disabled!');
37+
});
38+
39+
it('I can enable Audit Module', async () => {
40+
await (await projectList.menuBar.user()).administration();
41+
await userAdministration.sidebar.appSettings();
42+
await appSettings.enableAuditModule();
43+
await appSettings.saveGeneralSettings();
44+
await appSettings.menuBar.clickLogo();
45+
return expect(projectList.menuBar.isAuditTabExists()).toBe(true, 'Audit Module is not enabled!');
46+
});
47+
});
48+
2949
describe('Default Email Pattern', () => {
3050
it('I can see closed Email Pattern Hint', async () => {
51+
await (await projectList.menuBar.user()).administration();
3152
await userAdministration.sidebar.appSettings();
3253
return expect(appSettings.getHintText()).toEqual(Constants.emailHelpTextHint);
3354
});

0 commit comments

Comments
 (0)