[GitHub] metron pull request #1004: METRON-1489: Retrofit UI tests to run reliably du...

2018-04-27 Thread sardell
GitHub user sardell opened a pull request:

https://github.com/apache/metron/pull/1004

METRON-1489: Retrofit UI tests to run reliably during nightly QE runs

## Contributor Comments
This Pull Request includes work started by @iraghumitra on his branch 
`e2e-using-await-1`. In addition to the asyn/await work he did, I added 
[protractor-flake](https://github.com/NickTomlin/protractor-flake) in order to 
re-run failing tests to ensure they are actual failures and not the result of 
flakey tests. 


## Pull Request Checklist

Thank you for submitting a contribution to Apache Metron.  
Please refer to our [Development 
Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235)
 for the complete guide to follow for contributions.  
Please refer also to our [Build Verification 
Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview)
 for complete smoke testing guides.  


In order to streamline the review of the contribution we ask you follow 
these guidelines and ask you to double check the following:

### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? If not one needs to 
be created at [Metron 
Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel).
- [ ] Does your PR title start with METRON- where  is the JIRA 
number you are trying to resolve? Pay particular attention to the hyphen "-" 
character.
- [ ] Has your PR been rebased against the latest commit within the target 
branch (typically master)?


### For code changes:
- [ ] Have you included steps to reproduce the behavior or problem that is 
being changed or addressed?
- [ ] Have you included steps or a guide to how the change may be verified 
and tested manually?
- [ ] Have you ensured that the full suite of tests and checks have been 
executed in the root metron folder via:
  ```
  mvn -q clean integration-test install && 
dev-utilities/build-utils/verify_licenses.sh 
  ```

- [ ] Have you written or updated unit tests and or integration tests to 
verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies 
licensed in a way that is compatible for inclusion under [ASF 
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] Have you verified the basic functionality of the build by building 
and running locally with Vagrant full-dev environment or the equivalent?

### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in 
which it is rendered by building and verifying the site-book? If not then run 
the following commands and the verify changes via 
`site-book/target/site/index.html`:

  ```
  cd site-book
  mvn site
  ```

 Note:
Please ensure that once the PR is submitted, you check travis-ci for build 
issues and submit an update to your PR as soon as possible.
It is also recommended that [travis-ci](https://travis-ci.org) is set up 
for your personal repository such that your branches are built there before 
submitting a pull request.


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/sardell/metron METRON-1489

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/metron/pull/1004.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #1004


commit e17336a7f89756d822f6c7c776d865c0214683da
Author: iraghumitra 
Date:   2018-04-26T09:07:57Z

Initial commit for e2e tests in new branch

commit 15e379e6ca1b98fe9c5e59ff7d4d777afd072e63
Author: Shane Ardell 
Date:   2018-04-27T10:49:25Z

METRON-1489: fix test to account for leap year days

commit be90636a5d5ecefdd4469986b1ca1a2878942fd4
Author: Shane Ardell 
Date:   2018-04-27T11:06:16Z

METRON-1489: fix flakey test results with protractor-flake




---


[GitHub] metron pull request #1004: METRON-1489: Retrofit UI tests to run reliably du...

2018-04-27 Thread simonellistonball
Github user simonellistonball commented on a diff in the pull request:

https://github.com/apache/metron/pull/1004#discussion_r184743288
  
--- Diff: 
metron-interface/metron-alerts/e2e/alert-details/alert-status/alert-details-status.e2e-spec.ts
 ---
@@ -23,64 +23,67 @@ import {loadTestData, deleteTestData} from 
'../../utils/e2e_util';
 import { MetronAlertsPage } from '../../alerts-list/alerts-list.po';
 import {TreeViewPage} from '../../alerts-list/tree-view/tree-view.po';
 
-describe('metron-alerts alert status', function() {
+describe('Test spec for metron details page', function() {
   let page: MetronAlertDetailsPage;
   let listPage: MetronAlertsPage;
   let treePage: TreeViewPage;
   let loginPage: LoginPage;
 
-  beforeAll(() => {
-loadTestData();
+  beforeAll(async function() : Promise {
 loginPage = new LoginPage();
 listPage = new MetronAlertsPage();
 treePage = new TreeViewPage();
-loginPage.login();
+
+await loadTestData();
+await loginPage.login();
   });
 
-  afterAll(() => {
+  afterAll(async function() : Promise {
 new MetronAlertsPage().navigateTo();
-loginPage.logout();
-deleteTestData();
+await loginPage.logout();
+await deleteTestData();
   });
 
   beforeEach(() => {
 page = new MetronAlertDetailsPage();
 jasmine.addMatchers(customMatchers);
   });
 
-  it('should change alert statuses', () => {
-let alertId = 'c4c5e418-3938-099e-bb0d-37028a98dca8';
-
-page.navigateTo(alertId);
-page.clickNew();
-expect(page.getAlertStatus('ANY')).toEqual('NEW');
-page.clickOpen();
-expect(page.getAlertStatus('NEW')).toEqual('OPEN');
-expect(listPage.getAlertStatusById(alertId)).toEqual('OPEN');
-page.clickDismiss();
-expect(page.getAlertStatus('OPEN')).toEqual('DISMISS');
-expect(listPage.getAlertStatusById(alertId)).toEqual('DISMISS');
-page.clickEscalate();
-expect(page.getAlertStatus('DISMISS')).toEqual('ESCALATE');
-expect(listPage.getAlertStatusById(alertId)).toEqual('ESCALATE');
-page.clickResolve();
-expect(page.getAlertStatus('ESCALATE')).toEqual('RESOLVE');
-expect(listPage.getAlertStatusById(alertId)).toEqual('RESOLVE');
-page.clickNew();
+  xit('should change alert statuses', async function() : Promise {
--- End diff --

Any particular reason to skip this test?


---


[GitHub] metron pull request #1004: METRON-1489: Retrofit UI tests to run reliably du...

2018-04-27 Thread simonellistonball
Github user simonellistonball commented on a diff in the pull request:

https://github.com/apache/metron/pull/1004#discussion_r184743321
  
--- Diff: 
metron-interface/metron-alerts/e2e/alert-details/alert-status/alert-details-status.e2e-spec.ts
 ---
@@ -101,7 +104,7 @@ describe('metron-alerts alert status', function() {
 page.closeDetailPane();
   });
 
-  it('should add comments for tree view', () => {
+  xit('should add comments for tree view', () => {
--- End diff --

Any particular reason to skip this test?


---


[GitHub] metron pull request #1004: METRON-1489: Retrofit UI tests to run reliably du...

2018-04-27 Thread nickwallen
Github user nickwallen commented on a diff in the pull request:

https://github.com/apache/metron/pull/1004#discussion_r184750091
  
--- Diff: 
metron-interface/metron-alerts/e2e/alerts-list/alert-status/alerts-list-status.e2e-spec.ts
 ---
@@ -44,84 +45,84 @@ describe('metron-alerts alert status', function() {
 jasmine.addMatchers(customMatchers);
   });
 
-  it('should change alert status for multiple alerts to OPEN', () => {
-page.navigateTo();
-page.toggleAlertInList(0);
-page.toggleAlertInList(1);
-page.toggleAlertInList(2);
-page.clickActionDropdownOption('Open');
-expect(page.getAlertStatus(0, 'NEW')).toEqual('OPEN');
-expect(page.getAlertStatus(1, 'NEW')).toEqual('OPEN');
-expect(page.getAlertStatus(2, 'NEW')).toEqual('OPEN');
+  it('should change alert status for multiple alerts to OPEN', async 
function() : Promise {
+await page.navigateTo();
+await page.toggleAlertInList(0);
+await page.toggleAlertInList(1);
+await page.toggleAlertInList(2);
+await page.clickActionDropdownOption('Open');
+// expect(await page.getAlertStatus(0, 'NEW')).toEqual('OPEN');
+// expect(await page.getAlertStatus(1, 'NEW')).toEqual('OPEN');
+// expect(await page.getAlertStatus(2, 'NEW')).toEqual('OPEN');
   });
 
-  it('should change alert status for multiple alerts to DISMISS', () => {
-page.toggleAlertInList(3);
-page.toggleAlertInList(4);
-page.toggleAlertInList(5);
-page.clickActionDropdownOption('Dismiss');
-expect(page.getAlertStatus(3, 'NEW')).toEqual('DISMISS');
-expect(page.getAlertStatus(4, 'NEW')).toEqual('DISMISS');
-expect(page.getAlertStatus(5, 'NEW')).toEqual('DISMISS');
+  it('should change alert status for multiple alerts to DISMISS', async 
function() : Promise {
+await page.toggleAlertInList(3);
+await page.toggleAlertInList(4);
+await page.toggleAlertInList(5);
+await page.clickActionDropdownOption('Dismiss');
+// expect(await page.getAlertStatus(3, 'NEW')).toEqual('DISMISS');
+// expect(await page.getAlertStatus(4, 'NEW')).toEqual('DISMISS');
+// expect(await page.getAlertStatus(5, 'NEW')).toEqual('DISMISS');
   });
 
-  it('should change alert status for multiple alerts to ESCALATE', () => {
-page.toggleAlertInList(6);
-page.toggleAlertInList(7);
-page.toggleAlertInList(8);
-page.clickActionDropdownOption('Escalate');
-expect(page.getAlertStatus(6, 'NEW')).toEqual('ESCALATE');
-expect(page.getAlertStatus(7, 'NEW')).toEqual('ESCALATE');
-expect(page.getAlertStatus(8, 'NEW')).toEqual('ESCALATE');
+  it('should change alert status for multiple alerts to ESCALATE', async 
function() : Promise {
+await page.toggleAlertInList(6);
+await page.toggleAlertInList(7);
+await page.toggleAlertInList(8);
+await page.clickActionDropdownOption('Escalate');
+// expect(await page.getAlertStatus(6, 'NEW')).toEqual('ESCALATE');
--- End diff --

Do we need these commented out bits?


---


[GitHub] metron pull request #1004: METRON-1489: Retrofit UI tests to run reliably du...

2018-04-27 Thread nickwallen
Github user nickwallen commented on a diff in the pull request:

https://github.com/apache/metron/pull/1004#discussion_r184750333
  
--- Diff: metron-interface/metron-alerts/e2e/alerts-list/alerts-list.po.ts 
---
@@ -272,63 +308,149 @@ export class MetronAlertsPage {
   toggleAlertInList(index: number) {
 let selector = by.css('app-alerts-list tbody tr label');
 let checkbox = element.all(selector).get(index);
-this.waitForElementPresence(checkbox).then(() => {
-  browser.actions().mouseMove(checkbox).perform().then(() => {
-checkbox.click();
-  });
-});
+return this.waitForElementPresence(checkbox)
+.then(() => scrollIntoView(checkbox, true))
+.then(() => checkbox.click());
   }
 
   getAlertStatus(rowIndex: number, previousText: string, colIndex = 8) {
 let row = element.all(by.css('app-alerts-list tbody 
tr')).get(rowIndex);
 let column = row.all(by.css('td a')).get(colIndex);
-return this.waitForTextChange(column, previousText).then(() => {
-  return column.getText();
-});
+return this.waitForTextChange(column, previousText).then(() => 
column.getText());
   }
 
-  waitForMetaAlert() {
-browser.sleep(2000);
-return element(by.css('button[data-name="search"]')).click()
-.then(() => 
waitForElementPresence(element(by.css('.icon-cell.dropdown-cell';
+  waitForMetaAlert(expectedCount) {
+let title = element(by.css('.col-form-label-lg'));
+function waitForMetaAlert$()
+{
+  return function () {
+return browser.sleep(2000)
+.then(() => element(by.css('button[data-name="search"]')).click())
+.then(() => waitForTextChange(title, `Alerts (169)`))
+.then(() => title.getText())
+.then((text) => text === `Alerts (${expectedCount})`)
+.catch(catchNoSuchElementError())
+  }
+}
+return 
browser.wait(waitForMetaAlert$()).catch(catchNoSuchElementError());
   }
 
   isDateSeettingDisabled() {
 return element.all(by.css('app-time-range 
button.btn.btn-search[disabled=""]')).count().then((count) => { return (count 
=== 1); });
   }
 
   clickDateSettings() {
-element(by.css('app-time-range button.btn-search')).click();
-browser.sleep(2000);
+return scrollIntoView(element(by.css('app-time-range 
button.btn-search')), true)
+.then(() => element(by.css('app-time-range 
button.btn-search')).click())
+.then(() => waitForCssClass(element(by.css('app-time-range 
#time-range')), 'show'));
+  }
+
+  hideDateSettings() {
+return element(by.css('app-time-range button.btn-search')).click()
+.then(() => 
waitForCssClassNotToBePresent(element(by.css('app-time-range #time-range')), 
'show'))
+.then(() => waitForElementInVisibility(element(by.css('app-time-range 
#time-range';
   }
 
   getTimeRangeTitles() {
-return element.all(by.css('app-time-range .title')).getText();
+return element.all(by.css('app-time-range 
.title')).reduce(reduce_for_get_all(), []);
   }
 
   getQuickTimeRanges() {
-return element.all(by.css('app-time-range .quick-ranges 
span')).getText();
+return element.all(by.css('app-time-range .quick-ranges 
span')).reduce(reduce_for_get_all(), []);
   }
 
   getValueForManualTimeRange() {
-return element.all(by.css('app-time-range input.form-control')). 
getAttribute('value');
+return element.all(by.css('app-time-range 
input.form-control')).reduce((acc, ele) => {
+  return ele.getAttribute('value').then(value => {
+acc.push(value);
+return acc;
+  });
+}, []);
   }
 
   isManulaTimeRangeApplyButtonPresent() {
 return 
element.all(by.css('app-time-range')).all(by.buttonText('APPLY')).count().then(count
 => count === 1);
   }
 
+  waitForTextAndSubTextInTimeRange(currentTimeRangeVal) {
+return waitForTextChange(element(by.css('app-time-range 
.time-range-value')), currentTimeRangeVal[1])
+.then(() => waitForTextChange(element(by.css('app-time-range 
.time-range-text')), currentTimeRangeVal[0]))
+  }
+
+  async selectQuickTimeRangeAndGetTimeRangeAndTimeText(quickRange: string) 
{
+let currentTimeRangeVal: any = [];
+// return element.all(by.css('app-time-range button span')).getText()
--- End diff --

Same here...


---


[GitHub] metron pull request #1004: METRON-1489: Retrofit UI tests to run reliably du...

2018-04-27 Thread nickwallen
Github user nickwallen commented on a diff in the pull request:

https://github.com/apache/metron/pull/1004#discussion_r184753168
  
--- Diff: metron-interface/metron-alerts/README.md ---
@@ -126,7 +126,14 @@ The application will be available at http://host:4201 
assuming the port is set t
 
 ## E2E Tests
 
-An expressjs server is available for mocking the elastic search api.
+#Caveats
--- End diff --

This markdown does not render properly.  I think you need a space and it 
probably needs to be 3 hashes as in "### Caveats".


---


[GitHub] metron pull request #1004: METRON-1489: Retrofit UI tests to run reliably du...

2018-04-29 Thread anandsubbu
Github user anandsubbu commented on a diff in the pull request:

https://github.com/apache/metron/pull/1004#discussion_r184888777
  
--- Diff: 
metron-interface/metron-alerts/e2e/utils/clean_metron_update_table.ts ---
@@ -0,0 +1,52 @@
+declare var Promise: any;
+var chalk = require('chalk');
+var Client = require('ssh2').Client;
+var errorMsg = '';
+
+export function cleanMetronUpdateTable() {
+  return  new Promise(
+  function (resolve, reject) {
+// resolve();
+cleanupTable(resolve, reject);
--- End diff --

IMHO, it would be better to default to `resolve()` only owing to the issues 
with Vagrant `ssh2` client. 


---


[GitHub] metron pull request #1004: METRON-1489: Retrofit UI tests to run reliably du...

2018-04-29 Thread anandsubbu
Github user anandsubbu commented on a diff in the pull request:

https://github.com/apache/metron/pull/1004#discussion_r184889297
  
--- Diff: metron-interface/metron-alerts/protractor.conf.js ---
@@ -32,12 +33,13 @@ exports.config = {
 './e2e/alerts-list/tree-view/tree-view.e2e-spec.ts',
 './e2e/alerts-list/alert-filters/alert-filters.e2e-spec.ts',
 './e2e/alerts-list/alert-status/alerts-list-status.e2e-spec.ts',
-'./e2e/alert-details/alert-status/alert-details-status.e2e-spec.ts',
+// 
'./e2e/alert-details/alert-status/alert-details-status.e2e-spec.ts', //This 
will not work
 './e2e/alerts-list/meta-alerts/meta-alert.e2e-spec.ts'
   ],
   capabilities: {
 'browserName': 'chrome',
 'chromeOptions': {
+  args: ["--disable-gpu", "--window-size=1435,850" ],
--- End diff --

`-headless` can be included here to default to headless execution.


---


[GitHub] metron pull request #1004: METRON-1489: Retrofit UI tests to run reliably du...

2018-05-02 Thread sardell
Github user sardell commented on a diff in the pull request:

https://github.com/apache/metron/pull/1004#discussion_r185477581
  
--- Diff: 
metron-interface/metron-alerts/e2e/alert-details/alert-status/alert-details-status.e2e-spec.ts
 ---
@@ -23,64 +23,67 @@ import {loadTestData, deleteTestData} from 
'../../utils/e2e_util';
 import { MetronAlertsPage } from '../../alerts-list/alerts-list.po';
 import {TreeViewPage} from '../../alerts-list/tree-view/tree-view.po';
 
-describe('metron-alerts alert status', function() {
+describe('Test spec for metron details page', function() {
   let page: MetronAlertDetailsPage;
   let listPage: MetronAlertsPage;
   let treePage: TreeViewPage;
   let loginPage: LoginPage;
 
-  beforeAll(() => {
-loadTestData();
+  beforeAll(async function() : Promise {
 loginPage = new LoginPage();
 listPage = new MetronAlertsPage();
 treePage = new TreeViewPage();
-loginPage.login();
+
+await loadTestData();
+await loginPage.login();
   });
 
-  afterAll(() => {
+  afterAll(async function() : Promise {
 new MetronAlertsPage().navigateTo();
-loginPage.logout();
-deleteTestData();
+await loginPage.logout();
+await deleteTestData();
   });
 
   beforeEach(() => {
 page = new MetronAlertDetailsPage();
 jasmine.addMatchers(customMatchers);
   });
 
-  it('should change alert statuses', () => {
-let alertId = 'c4c5e418-3938-099e-bb0d-37028a98dca8';
-
-page.navigateTo(alertId);
-page.clickNew();
-expect(page.getAlertStatus('ANY')).toEqual('NEW');
-page.clickOpen();
-expect(page.getAlertStatus('NEW')).toEqual('OPEN');
-expect(listPage.getAlertStatusById(alertId)).toEqual('OPEN');
-page.clickDismiss();
-expect(page.getAlertStatus('OPEN')).toEqual('DISMISS');
-expect(listPage.getAlertStatusById(alertId)).toEqual('DISMISS');
-page.clickEscalate();
-expect(page.getAlertStatus('DISMISS')).toEqual('ESCALATE');
-expect(listPage.getAlertStatusById(alertId)).toEqual('ESCALATE');
-page.clickResolve();
-expect(page.getAlertStatus('ESCALATE')).toEqual('RESOLVE');
-expect(listPage.getAlertStatusById(alertId)).toEqual('RESOLVE');
-page.clickNew();
+  xit('should change alert statuses', async function() : Promise {
--- End diff --

This change is from @iraghumitra's original work, so it's probably best he 
answers this question.


---


[GitHub] metron pull request #1004: METRON-1489: Retrofit UI tests to run reliably du...

2018-05-02 Thread sardell
Github user sardell commented on a diff in the pull request:

https://github.com/apache/metron/pull/1004#discussion_r185477602
  
--- Diff: 
metron-interface/metron-alerts/e2e/alert-details/alert-status/alert-details-status.e2e-spec.ts
 ---
@@ -101,7 +104,7 @@ describe('metron-alerts alert status', function() {
 page.closeDetailPane();
   });
 
-  it('should add comments for tree view', () => {
+  xit('should add comments for tree view', () => {
--- End diff --

@iraghumitra Same question as above.


---


[GitHub] metron pull request #1004: METRON-1489: Retrofit UI tests to run reliably du...

2018-05-02 Thread sardell
Github user sardell commented on a diff in the pull request:

https://github.com/apache/metron/pull/1004#discussion_r185477633
  
--- Diff: 
metron-interface/metron-alerts/e2e/alerts-list/alert-status/alerts-list-status.e2e-spec.ts
 ---
@@ -44,84 +45,84 @@ describe('metron-alerts alert status', function() {
 jasmine.addMatchers(customMatchers);
   });
 
-  it('should change alert status for multiple alerts to OPEN', () => {
-page.navigateTo();
-page.toggleAlertInList(0);
-page.toggleAlertInList(1);
-page.toggleAlertInList(2);
-page.clickActionDropdownOption('Open');
-expect(page.getAlertStatus(0, 'NEW')).toEqual('OPEN');
-expect(page.getAlertStatus(1, 'NEW')).toEqual('OPEN');
-expect(page.getAlertStatus(2, 'NEW')).toEqual('OPEN');
+  it('should change alert status for multiple alerts to OPEN', async 
function() : Promise {
+await page.navigateTo();
+await page.toggleAlertInList(0);
+await page.toggleAlertInList(1);
+await page.toggleAlertInList(2);
+await page.clickActionDropdownOption('Open');
+// expect(await page.getAlertStatus(0, 'NEW')).toEqual('OPEN');
+// expect(await page.getAlertStatus(1, 'NEW')).toEqual('OPEN');
+// expect(await page.getAlertStatus(2, 'NEW')).toEqual('OPEN');
   });
 
-  it('should change alert status for multiple alerts to DISMISS', () => {
-page.toggleAlertInList(3);
-page.toggleAlertInList(4);
-page.toggleAlertInList(5);
-page.clickActionDropdownOption('Dismiss');
-expect(page.getAlertStatus(3, 'NEW')).toEqual('DISMISS');
-expect(page.getAlertStatus(4, 'NEW')).toEqual('DISMISS');
-expect(page.getAlertStatus(5, 'NEW')).toEqual('DISMISS');
+  it('should change alert status for multiple alerts to DISMISS', async 
function() : Promise {
+await page.toggleAlertInList(3);
+await page.toggleAlertInList(4);
+await page.toggleAlertInList(5);
+await page.clickActionDropdownOption('Dismiss');
+// expect(await page.getAlertStatus(3, 'NEW')).toEqual('DISMISS');
+// expect(await page.getAlertStatus(4, 'NEW')).toEqual('DISMISS');
+// expect(await page.getAlertStatus(5, 'NEW')).toEqual('DISMISS');
   });
 
-  it('should change alert status for multiple alerts to ESCALATE', () => {
-page.toggleAlertInList(6);
-page.toggleAlertInList(7);
-page.toggleAlertInList(8);
-page.clickActionDropdownOption('Escalate');
-expect(page.getAlertStatus(6, 'NEW')).toEqual('ESCALATE');
-expect(page.getAlertStatus(7, 'NEW')).toEqual('ESCALATE');
-expect(page.getAlertStatus(8, 'NEW')).toEqual('ESCALATE');
+  it('should change alert status for multiple alerts to ESCALATE', async 
function() : Promise {
+await page.toggleAlertInList(6);
+await page.toggleAlertInList(7);
+await page.toggleAlertInList(8);
+await page.clickActionDropdownOption('Escalate');
+// expect(await page.getAlertStatus(6, 'NEW')).toEqual('ESCALATE');
--- End diff --

@iraghumitra what was the reason for commenting out this test?


---


[GitHub] metron pull request #1004: METRON-1489: Retrofit UI tests to run reliably du...

2018-05-02 Thread sardell
Github user sardell commented on a diff in the pull request:

https://github.com/apache/metron/pull/1004#discussion_r185477658
  
--- Diff: metron-interface/metron-alerts/e2e/alerts-list/alerts-list.po.ts 
---
@@ -272,63 +308,149 @@ export class MetronAlertsPage {
   toggleAlertInList(index: number) {
 let selector = by.css('app-alerts-list tbody tr label');
 let checkbox = element.all(selector).get(index);
-this.waitForElementPresence(checkbox).then(() => {
-  browser.actions().mouseMove(checkbox).perform().then(() => {
-checkbox.click();
-  });
-});
+return this.waitForElementPresence(checkbox)
+.then(() => scrollIntoView(checkbox, true))
+.then(() => checkbox.click());
   }
 
   getAlertStatus(rowIndex: number, previousText: string, colIndex = 8) {
 let row = element.all(by.css('app-alerts-list tbody 
tr')).get(rowIndex);
 let column = row.all(by.css('td a')).get(colIndex);
-return this.waitForTextChange(column, previousText).then(() => {
-  return column.getText();
-});
+return this.waitForTextChange(column, previousText).then(() => 
column.getText());
   }
 
-  waitForMetaAlert() {
-browser.sleep(2000);
-return element(by.css('button[data-name="search"]')).click()
-.then(() => 
waitForElementPresence(element(by.css('.icon-cell.dropdown-cell';
+  waitForMetaAlert(expectedCount) {
+let title = element(by.css('.col-form-label-lg'));
+function waitForMetaAlert$()
+{
+  return function () {
+return browser.sleep(2000)
+.then(() => element(by.css('button[data-name="search"]')).click())
+.then(() => waitForTextChange(title, `Alerts (169)`))
+.then(() => title.getText())
+.then((text) => text === `Alerts (${expectedCount})`)
+.catch(catchNoSuchElementError())
+  }
+}
+return 
browser.wait(waitForMetaAlert$()).catch(catchNoSuchElementError());
   }
 
   isDateSeettingDisabled() {
 return element.all(by.css('app-time-range 
button.btn.btn-search[disabled=""]')).count().then((count) => { return (count 
=== 1); });
   }
 
   clickDateSettings() {
-element(by.css('app-time-range button.btn-search')).click();
-browser.sleep(2000);
+return scrollIntoView(element(by.css('app-time-range 
button.btn-search')), true)
+.then(() => element(by.css('app-time-range 
button.btn-search')).click())
+.then(() => waitForCssClass(element(by.css('app-time-range 
#time-range')), 'show'));
+  }
+
+  hideDateSettings() {
+return element(by.css('app-time-range button.btn-search')).click()
+.then(() => 
waitForCssClassNotToBePresent(element(by.css('app-time-range #time-range')), 
'show'))
+.then(() => waitForElementInVisibility(element(by.css('app-time-range 
#time-range';
   }
 
   getTimeRangeTitles() {
-return element.all(by.css('app-time-range .title')).getText();
+return element.all(by.css('app-time-range 
.title')).reduce(reduce_for_get_all(), []);
   }
 
   getQuickTimeRanges() {
-return element.all(by.css('app-time-range .quick-ranges 
span')).getText();
+return element.all(by.css('app-time-range .quick-ranges 
span')).reduce(reduce_for_get_all(), []);
   }
 
   getValueForManualTimeRange() {
-return element.all(by.css('app-time-range input.form-control')). 
getAttribute('value');
+return element.all(by.css('app-time-range 
input.form-control')).reduce((acc, ele) => {
+  return ele.getAttribute('value').then(value => {
+acc.push(value);
+return acc;
+  });
+}, []);
   }
 
   isManulaTimeRangeApplyButtonPresent() {
 return 
element.all(by.css('app-time-range')).all(by.buttonText('APPLY')).count().then(count
 => count === 1);
   }
 
+  waitForTextAndSubTextInTimeRange(currentTimeRangeVal) {
+return waitForTextChange(element(by.css('app-time-range 
.time-range-value')), currentTimeRangeVal[1])
+.then(() => waitForTextChange(element(by.css('app-time-range 
.time-range-text')), currentTimeRangeVal[0]))
+  }
+
+  async selectQuickTimeRangeAndGetTimeRangeAndTimeText(quickRange: string) 
{
+let currentTimeRangeVal: any = [];
+// return element.all(by.css('app-time-range button span')).getText()
--- End diff --

@iraghumitra what was the reason for commenting out this test?


---