Skip to content

Commit 348aa52

Browse files
committed
verify data on final db that has pii property
1 parent 115b6cd commit 348aa52

File tree

1 file changed

+97
-0
lines changed
  • quick-start/e2e/specs/run

1 file changed

+97
-0
lines changed

quick-start/e2e/specs/run/run.ts

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ export default function(tmpDir) {
8686
fs.copy(customTriplesFilePath, tmpDir + '/plugins/entities/Product/harmonize/Harmonize\ Products/triples.sjs');
8787
});
8888

89+
it ('should setup customized writer on Harmonize Products flow', function() {
90+
//copy customized writer.sjs
91+
console.log('copy customized writer.sjs');
92+
let customWriterFilePath = 'e2e/qa-data/plugins/writerPiiPermissions.sjs';
93+
fs.copy(customWriterFilePath, tmpDir + '/plugins/entities/Product/harmonize/Harmonize\ Products/writer.sjs');
94+
});
95+
8996
it ('should redeploy modules', function() {
9097
flowPage.redeployButton.click();
9198
browser.sleep(5000);
@@ -325,5 +332,95 @@ export default function(tmpDir) {
325332
appPage.flowsTab.click();
326333
flowPage.isLoaded();
327334
});
335+
336+
it ('should logout and login as no-pii-user to verify pii', function() {
337+
appPage.logout();
338+
loginPage.isLoaded();
339+
loginPage.clickNext('ProjectDirTab');
340+
browser.wait(EC.elementToBeClickable(loginPage.environmentTab));
341+
loginPage.clickNext('EnvironmentTab');
342+
browser.wait(EC.elementToBeClickable(loginPage.loginTab));
343+
loginPage.loginAs('no-pii-user', 'x');
344+
browser.wait(EC.elementToBeClickable(appPage.odhLogo));
345+
});
346+
347+
it('should verify that no-pii-user cannot see titlePii and attachment title on harmonized data', function() {
348+
appPage.browseDataTab.click();
349+
browsePage.isLoaded();
350+
browser.wait(EC.visibilityOf(browsePage.resultsPagination()));
351+
browsePage.databaseDropDown().click();
352+
browsePage.selectDatabase('FINAL').click();
353+
browser.wait(EC.elementToBeClickable(browsePage.resultsUri()));
354+
browsePage.facetName('Product').click();
355+
browser.wait(EC.elementToBeClickable(browsePage.resultsUri()));
356+
browsePage.searchBox().clear();
357+
browsePage.searchBox().sendKeys('442403950907');
358+
browsePage.searchButton().click();
359+
browser.wait(EC.elementToBeClickable(browsePage.resultsUri()));
360+
expect(browsePage.resultsPagination().getText()).toContain('Showing Results 1 to 1 of 1');
361+
expect(browsePage.resultsUri().getText()).toContain('/board_games_accessories.csv-0-1');
362+
browsePage.resultsUri().click();
363+
viewerPage.isLoaded();
364+
expect(viewerPage.searchResultUri().getText()).toContain('/board_games_accessories.csv-0-1');
365+
expect(viewerPage.verifyVariableName('titlePii').isPresent()).toBeFalsy();
366+
expect(viewerPage.verifyHarmonizedProperty('title', 'Cards').isPresent()).toBeFalsy();
367+
expect(viewerPage.verifyHarmonizedProperty('sku', '442403950907').isPresent()).toBeTruthy();
368+
appPage.flowsTab.click();
369+
flowPage.isLoaded();
370+
});
371+
372+
it ('should logout and login as pii-user to verify pii', function() {
373+
appPage.logout();
374+
loginPage.isLoaded();
375+
loginPage.clickNext('ProjectDirTab');
376+
browser.wait(EC.elementToBeClickable(loginPage.environmentTab));
377+
loginPage.clickNext('EnvironmentTab');
378+
browser.wait(EC.elementToBeClickable(loginPage.loginTab));
379+
loginPage.loginAs('pii-user', 'x');
380+
browser.wait(EC.elementToBeClickable(appPage.odhLogo));
381+
});
382+
383+
it('should verify that pii-user can see titlePii and attachment title on harmonized data', function() {
384+
appPage.browseDataTab.click();
385+
browsePage.isLoaded();
386+
browser.wait(EC.visibilityOf(browsePage.resultsPagination()));
387+
browsePage.databaseDropDown().click();
388+
browsePage.selectDatabase('FINAL').click();
389+
browser.wait(EC.elementToBeClickable(browsePage.resultsUri()));
390+
browsePage.facetName('Product').click();
391+
browser.wait(EC.elementToBeClickable(browsePage.resultsUri()));
392+
browsePage.searchBox().clear();
393+
browsePage.searchBox().sendKeys('442403950907');
394+
browsePage.searchButton().click();
395+
browser.wait(EC.elementToBeClickable(browsePage.resultsUri()));
396+
expect(browsePage.resultsPagination().getText()).toContain('Showing Results 1 to 1 of 1');
397+
expect(browsePage.resultsUri().getText()).toContain('/board_games_accessories.csv-0-1');
398+
browsePage.resultsUri().click();
399+
viewerPage.isLoaded();
400+
expect(viewerPage.searchResultUri().getText()).toContain('/board_games_accessories.csv-0-1');
401+
expect(viewerPage.verifyVariableName('titlePii').isPresent()).toBeTruthy();
402+
expect(viewerPage.verifyVariableName('title').isPresent()).toBeTruthy();
403+
expect(viewerPage.verifyHarmonizedProperty('titlePii', 'Cards').isPresent()).toBeTruthy();
404+
expect(viewerPage.verifyHarmonizedProperty('title', 'Cards').isPresent()).toBeTruthy();
405+
expect(viewerPage.verifyHarmonizedProperty('sku', '442403950907').isPresent()).toBeTruthy();
406+
expect(viewerPage.verifyHarmonizedProperty('opt1', 'world').isPresent()).toBeTruthy();
407+
expect(viewerPage.verifyHarmonizedProperty('user', 'admin').isPresent()).toBeTruthy();
408+
expect(viewerPage.verifyHarmonizedProperty('object', 'http://www.marklogic.com/foo/456').isPresent()).toBeTruthy();
409+
appPage.flowsTab.click();
410+
flowPage.isLoaded();
411+
});
412+
413+
it ('should logout and login as admin', function() {
414+
appPage.logout();
415+
loginPage.isLoaded();
416+
loginPage.clickNext('ProjectDirTab');
417+
browser.wait(EC.elementToBeClickable(loginPage.environmentTab));
418+
loginPage.clickNext('EnvironmentTab');
419+
browser.wait(EC.elementToBeClickable(loginPage.loginTab));
420+
loginPage.login();
421+
browser.wait(EC.elementToBeClickable(appPage.odhLogo));
422+
appPage.flowsTab.click();
423+
flowPage.isLoaded();
424+
});
328425
});
329426
}

0 commit comments

Comments
 (0)