'use strict';

describe('Dash App', function () {

  beforeEach(function () {
    browser.get('index.html');
  });

  it('should automatically redirect to / when location hash is empty', function() {
    expect(browser.getLocationAbsUrl()).toMatch('/');
  });

  describe('search box', function () {
    var boxGroupBottom, keywordBox, backdrop;

    beforeEach(function () {
      boxGroupBottom = $('.box-group-bottom > .box-group');
      keywordBox = element(by.model('keyword'));
      backdrop = $('#dsBackdrop');
      expect(boxGroupBottom.isDisplayed()).toBeFalsy();
      expect(backdrop.isPresent()).toBeFalsy();
    });

    describe('should open the box group of search option box and search result box with backdrop', function () {
      it('when the keyword box is focused', function () {
        keywordBox.click();
      });

      it('when the gear icon is clicked', function () {
        $('.box-group-top button').click();
      });

      afterEach(function () {
        expect(boxGroupBottom.isDisplayed()).toBeTruthy();
        expect(backdrop.isPresent()).toBeTruthy();
      });
    });

    it('should hide backdrop and the box group when backdrop is clicked', function () {
      keywordBox.click();
      backdrop.click();
      expect(backdrop.isPresent()).toBeFalsy();
      expect(boxGroupBottom.isDisplayed()).toBeFalsy();
    });
  });
});

@@ -50,60 +50,344 @@
 %0A%0A  
-beforeEach(function () %7B%0A    browser.get('index.html
+var keywordBox, gearIcon,%0A      boxGroupBottom,%0A      backdrop;%0A%0A  beforeEach(function () %7B%0A    browser.get('index.html');%0A  %7D);%0A%0A  beforeEach(function () %7B%0A    keywordBox = element(by.model('keyword'));%0A    gearIcon = $('.box-group-top button');%0A%0A    boxGroupBottom = $('.box-group-bottom %3E .box-group');%0A%0A    backdrop = $('#dsBackdrop
 ');%0A
@@ -556,20 +556,19 @@
 ('search
- box
+ing
 ', funct
@@ -584,223 +584,32 @@
     
-var boxGroupBottom, keywordBox, backdrop;%0A%0A    beforeEach(function () %7B%0A      boxGroupBottom = $('.box-group-bottom %3E .box-group');%0A      keywordBox = element(by.model('keyword'));%0A      backdrop = $('#dsBackdrop');
+beforeEach(function () %7B
 %0A   
@@ -996,34 +996,16 @@
     
-$('.box-group-top button')
+gearIcon
 .cli

Refactor E2E test specs for main screen [ci skip]