Skip to content

Commit 01d93af

Browse files
committed
DHFPROD-3610: Fixing QS tests
1 parent 21655dc commit 01d93af

File tree

20 files changed

+366
-896
lines changed

20 files changed

+366
-896
lines changed
10.4 MB
Binary file not shown.

web/e2e/page-objects/dashboard/dashboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class DashboardPage extends AppPage {
2626
await browser.wait(EC.elementToBeClickable(dashboardPage.clearButton));
2727
await dashboardPage.clearButton.click();
2828
await browser.wait(EC.textToBePresentInElement(this.jobCount(), '0'));
29-
await browser.sleep(1000);
29+
await browser.sleep(5000);
3030
}
3131

3232
async clearJobDatabase() {

web/e2e/page-objects/flows/editFlow.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ export class EditFlow extends AppPage {
6969
return await element(by.cssContainingText("span.mat-checkbox-label", step)).click();
7070
}
7171

72+
stepDeleteButton() {
73+
return element(by.css);
74+
}
75+
7276
/**
7377
* clickButtonRunCancel
7478
* @param option = [cancel/flow]
@@ -104,7 +108,7 @@ export class EditFlow extends AppPage {
104108
}
105109

106110
get jobStartedTimestamp() {
107-
return element(by.id("job-started-timestamp"));
111+
return element(by.css("#job-started-timestamp span"));
108112
}
109113

110114
get viewJobsButton() {
@@ -228,6 +232,10 @@ export class EditFlow extends AppPage {
228232
}
229233
}
230234

235+
async deleteStep(flow, step) {
236+
237+
}
238+
231239
async verifyFlow() {
232240
await console.log('verify flow on edit flow page');
233241
await browser.sleep(3000);

web/e2e/page-objects/steps/mappingStep.ts

Lines changed: 9 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { AppPage } from "../appPage";
22
import { pages } from '../page';
3-
import { $, by, element } from "protractor";
3+
import {$, browser, by, element} from "protractor";
44

55
export class MappingStep extends AppPage {
66

@@ -78,7 +78,8 @@ export class MappingStep extends AppPage {
7878

7979
async clickSourcePropertyContainer(entityName,entityProperty: string) {
8080
let sourceProperty = this.sourcePropertyContainer(entityName,entityProperty);
81-
return await sourceProperty.click();
81+
await sourceProperty.click();
82+
return await browser.sleep(3000);
8283
}
8384

8485
propertySelectMenu(entityProperty: string) {
@@ -88,65 +89,25 @@ export class MappingStep extends AppPage {
8889
async clickPropertySelectMenu(entityProperty: string) {
8990
return await this.propertySelectMenu(entityProperty).click();
9091
}
91-
verifyExpressionText(entityName,entityProperty: string, expression: string) {
92-
return element(by.cssContainingText(`#entity-table .entity-row-${entityName}-${entityProperty} #edit-expression`, expression));
93-
}
94-
95-
undoPropertyMapping(entityName,entityProperty: string) {
96-
return this.sourcePropertyContainer(entityName,entityProperty).element(by.css('.fa-remove'));
97-
}
98-
99-
sourcePropertyDropDown(entityName,entityProperty: string) {
100-
return this.sourcePropertyContainer(entityName,entityProperty).element(by.css('.fa-caret-down'));
101-
}
102-
103-
sourceTypeAheadInput(entityProperty: string) {
104-
return element(by.css(`#source .source-prop-container .dropdown-filter-${entityProperty} input`));
105-
}
10692

107-
mapSourceProperty(sourceProperty: string, entityProperty: string) {
108-
return this.propertySelectMenu(entityProperty).element(by.css(`.dropdown-item-${sourceProperty}`));
93+
clearExpressionText(entityName, entityProperty: string) {
94+
return element(by.css(`#entity-table .entity-row-${entityName}-${entityProperty} #edit-expression`)).clear();
10995
}
11096

111-
async clickMapSourceProperty(sourceProperty: string, entityProperty: string) {
112-
let mapSourceProperty = this.mapSourceProperty(sourceProperty, entityProperty);
113-
return await mapSourceProperty.click();
97+
verifyExpressionText(entityName,entityProperty: string) {
98+
return element(by.css(`#entity-table .entity-row-${entityName}-${entityProperty} #edit-expression`));
11499
}
115100

116101
entityPropertyContainer(entityName: string, entityProperty: string) {
117102
return element(by.css(`#entity-table .entity-row-${entityName}-${entityProperty}`));
118103
}
119104

120105
entityPropertyName(entityName,entityProperty: string) {
121-
return this.entityPropertyContainer(entityName,entityProperty).element(by.css('.prop-name'));
106+
return element(by.css(`#entity-table .entity-row-${entityName}-${entityProperty} .mat-column-name`)).getText();
122107
}
123108

124109
entityPropertyType(entityName,entityProperty: string) {
125-
return this.entityPropertyContainer(entityName,entityProperty).element(by.css('.prop-type'));
126-
}
127-
128-
entityPropertyIcon(entityName,entityProperty: string, iconClass: string) {
129-
return this.entityPropertyContainer(entityName,entityProperty).element(by.css(`.entity-icon .fa-${iconClass}`));
130-
}
131-
132-
verifySourcePropertyName(propertyName: string) {
133-
return element(by.cssContainingText('.prop-select-content .prop-name', propertyName));
134-
}
135-
136-
verifyDropdownPropertyName(entityProperty: string, propertyName: string) {
137-
return element(by.cssContainingText(`.prop-select-menu-${entityProperty} .prop-name`, propertyName));
138-
}
139-
140-
verifySourcePropertyType(propertyType: string) {
141-
return element(by.cssContainingText('.prop-select-content .prop-type', propertyType));
142-
}
143-
144-
verifySourcePropertyTypeByName(propertyName: string, propertyType: string) {
145-
return element(by.cssContainingText(`.prop-entity-${propertyName} .prop-select-content .prop-type`, propertyType));
146-
}
147-
148-
verifyDropdownPropertyType(entityProperty: string, propertyType: string) {
149-
return element(by.cssContainingText(`.prop-select-menu-${entityProperty} .prop-type`, propertyType));
110+
return element(by.css(`#entity-table .entity-row-${entityName}-${entityProperty} .mat-column-datatype`)).getText();
150111
}
151112

152113
testButton() {
@@ -157,14 +118,6 @@ export class MappingStep extends AppPage {
157118
return await this.testButton().click();
158119
}
159120

160-
verifySourcePropertyValue(propertyValue: string) {
161-
return element(by.cssContainingText('.prop-select-content .prop-val', propertyValue));
162-
}
163-
164-
verifyDropdownPropertyValue(entityProperty: string, propertyValue: string) {
165-
return element(by.cssContainingText(`.prop-select-menu-${entityProperty} .prop-val`, propertyValue));
166-
}
167-
168121
get sourceHelpLink() {
169122
return $("#source .help-icon > a").getAttribute("href");
170123
}

web/e2e/page-objects/steps/masteringStep.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,29 +1174,41 @@ export class MasteringStep extends AppPage {
11741174

11751175
// Merge Collections
11761176

1177-
get mergeCollectionsAddButton() {
1178-
return element(by.css("#merge-collections button.new-collection-button"));
1177+
/**
1178+
* @param event = [onMerge/onNoMatch/onArchive/onNotification]
1179+
*/
1180+
mergeCollectionsAction(event: string) {
1181+
event = event.toLowerCase();
1182+
return element(by.css(`.merge-collections-${event} .merge-collection-menu`));
11791183
}
11801184

1181-
async clickMergeCollectionsAddButton() {
1182-
let button = this.mergeCollectionsAddButton;
1185+
async clickMergeCollectionsAction(event: string) {
1186+
let button = this.mergeCollectionsAction(event);
11831187
await browser.wait(EC.elementToBeClickable(button));
11841188
return await button.click();
11851189
}
11861190

1191+
get editMergeCollection() {
1192+
return element(by.css('.merge-collection-menu-edit-btn'));
1193+
}
1194+
1195+
async clickEditMergeCollection() {
1196+
return await this.editMergeCollection.click();
1197+
}
1198+
11871199
get mergeCollectionsTable() {
11881200
return element(by.id("merge-collections-table"));
11891201
}
11901202

1191-
get mergeCollectionEventField() {
1192-
return element(by.id("merge-collection-event"))
1203+
get editMergeCollectionEventField() {
1204+
return element(by.id("event-name"))
11931205
}
11941206

1195-
get mergeCollectionsToAddButton() {
1207+
get mergeCollectionsAddButton() {
11961208
return element(by.id("merge-collection-add-add-btn"))
11971209
}
11981210

1199-
get mergeCollectionsToAddRemoveButton() {
1211+
get mergeCollectionsRemoveButton() {
12001212
return element(by.css(".add-remove-collection-btn"))
12011213
}
12021214

web/e2e/specs/browse/browse-data.ts

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,54 +61,54 @@ export default function (qaProjectDir) {
6161
await browsePage.closeCollection();
6262

6363
await browsePage.clickFacetName('http://marklogic.com/data-hub/flow');
64-
await expect(await browsePage.resultsUriCount()).toBeGreaterThan(3);
64+
await expect(await browsePage.resultsUriCount()).toBeGreaterThan(7);
6565
await browsePage.closeCollection();
6666

6767
await browsePage.clickFacetName('http://marklogic.com/data-hub/mappings');
68-
await expect(await browsePage.resultsUriCount()).toBeGreaterThan(5);
68+
await expect(await browsePage.resultsUriCount()).toBeGreaterThanOrEqual(1);
6969
await browsePage.closeCollection();
7070

7171
await browsePage.clickFacetName('http://marklogic.com/data-hub/step-definition');
72-
await expect(await browsePage.resultsUriCount()).toBe(3);
72+
await expect(await browsePage.resultsUriCount()).toBe(8);
7373
await browsePage.closeCollection();
7474
});
7575

7676
it('should verify collection documents for final database', async function () {
7777
await browsePage.setDatabase('FINAL');
7878

79-
await browsePage.clickFacetName('SimpleJSON');
80-
//await expect(await browsePage.resultsUriCount()).toBe(8);
79+
await browsePage.clickFacetName('Jobs');
80+
await expect(await browsePage.resultsUriCount()).toBe(8);
8181
await browsePage.closeCollection();
8282

8383
await browsePage.clickFacetName('SimpleJSONMastering');
84-
//await expect(await browsePage.resultsUriCount()).toBe(8);
84+
await expect(await browsePage.resultsUriCount()).toBe(8);
8585
await browsePage.closeCollection();
8686

87-
await browsePage.clickFacetName('mdm-archived');
88-
await expect(await browsePage.resultsUriCount()).toBeGreaterThan(2);
87+
await browsePage.clickFacetName('sm-Jobs-archived');
88+
await expect(await browsePage.resultsUriCount()).toBeGreaterThanOrEqual(2);
8989
await browsePage.closeCollection();
9090

91-
await browsePage.clickFacetName('mdm-auditing');
91+
await browsePage.clickFacetName('sm-Jobs-auditing');
9292
await expect(await browsePage.resultsUriCount()).toBeGreaterThan(0);
9393
await browsePage.closeCollection();
9494

95-
//await browsePage.clickFacetName('mdm-merged');
96-
//await expect(await browsePage.resultsUriCount()).toBeGreaterThan(0);
97-
//await browsePage.closeCollection();
95+
await browsePage.clickFacetName('sm-Jobs-merged');
96+
await expect(await browsePage.resultsUriCount()).toBeGreaterThan(0);
97+
await browsePage.closeCollection();
9898
});
9999

100-
it('should verify collection count', async function () {
100+
it('should verify collection count in facet', async function () {
101101
await browsePage.setDatabase('STAGING');
102102
await expect(browsePage.facetCount('SimpleJSONIngest').getText()).toBe('6');
103103
await browsePage.setDatabase('FINAL');
104-
//await expect(browsePage.facetCount('SimpleJSON').getText()).toBe('8');
105-
//await expect(browsePage.facetCount('SimpleJSONMastering').getText()).toBe('8');
104+
await expect(browsePage.facetCount('Jobs').getText()).toBe('8');
105+
await expect(browsePage.facetCount('SimpleJSONMastering').getText()).toBe('8');
106106

107107
});
108108

109109
it('should verify search for the document', async function () {
110110
await browsePage.setDatabase('STAGING');
111-
await browsePage.searchKeyword('SimpleJSON');
111+
await browsePage.searchKeyword('SimpleJSONIngest');
112112
await expect(await browsePage.resultsUriCount()).toBeGreaterThan(0);
113113

114114
await browsePage.setDatabase('FINAL');
@@ -159,17 +159,19 @@ export default function (qaProjectDir) {
159159

160160
it('should verify entities only checkbox without entities', async function () {
161161
await appPage.dashboardTab.click();
162-
await browser.wait(EC.visibilityOf(dashboardPage.clearJobButton()));
163-
await dashboardPage.clearAllDatabases();
162+
//await browser.wait(EC.visibilityOf(dashboardPage.clearJobButton()));
163+
//await dashboardPage.clearAllDatabases();
164164
await appPage.clickBrowseDataTab();
165165
await browsePage.setDatabase('STAGING');
166166
await expect(browsePage.entitiesOnlyChkBox().isDisplayed()).toBe(true);
167167
await browsePage.selectEntitiesOnlyChkBox();
168+
await browsePage.searchKeyword('INVALID')
168169
await expect(browsePage.noDataText.isDisplayed()).toBe(true);
169170

170171
await browsePage.setDatabase('FINAL');
171172
await expect(browsePage.entitiesOnlyChkBox().isDisplayed()).toBe(true);
172173
await browsePage.selectEntitiesOnlyChkBox();
174+
await browsePage.searchKeyword('INVALID')
173175
await expect(browsePage.noDataText.isDisplayed()).toBe(true);
174176
});
175177
});

web/e2e/specs/dashboard/dashboard.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { browser } from 'protractor';
1+
import {browser, ExpectedConditions as EC} from 'protractor';
22
import appPage from '../../page-objects/appPage';
33
import manageFlowPage from "../../page-objects/flows/manageFlows";
44
import dashboardPage from "../../page-objects/dashboard/dashboard";
@@ -30,6 +30,7 @@ export default function(qaProjectDir) {
3030

3131
it('should check default documents after redeploy', async function () {
3232
await appPage.clickFlowTab();
33+
await browser.wait(EC.visibilityOf(manageFlowPage.flowName("SimpleFlow")));
3334
await manageFlowPage.redeploy();
3435
await appPage.clickDashboardTab();
3536
await expect(dashboardPage.stagingCount().getText()).toBeGreaterThan(0);

0 commit comments

Comments
 (0)