github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/Decentralized-Energy-Composer-master/angular-app/e2e/app.e2e-spec.ts (about)

     1  import { AngularTestPage } from './app.po';
     2  import { browser, element, by } from 'protractor';
     3  
     4  describe('Starting tests for angular-app', function() {
     5    let page: AngularTestPage;
     6  
     7    beforeEach(() => {
     8      page = new AngularTestPage();
     9    });
    10  
    11    it('website title should be angular-app', () => {
    12      page.navigateTo('/');
    13      return browser.getTitle().then((result)=>{
    14        expect(result).toBe('angular-app');
    15      })
    16    });
    17  
    18    it('navbar-brand should be decentralized-energy-network@0.1.1',() => {
    19      var navbarBrand = element(by.css('.navbar-brand')).getWebElement();
    20      expect(navbarBrand.getText()).toBe('decentralized-energy-network@0.1.1');
    21    });
    22  
    23    
    24      it('Coins component should be loadable',() => {
    25        page.navigateTo('/Coins');
    26        var assetName = browser.findElement(by.id('assetName'));
    27        expect(assetName.getText()).toBe('Coins');
    28      });
    29  
    30      it('Coins table should have 5 columns',() => {
    31        page.navigateTo('/Coins');
    32        element.all(by.css('.thead-cols th')).then(function(arr) {
    33          expect(arr.length).toEqual(5); // Addition of 1 for 'Action' column
    34        });
    35      });
    36  
    37    
    38      it('Energy component should be loadable',() => {
    39        page.navigateTo('/Energy');
    40        var assetName = browser.findElement(by.id('assetName'));
    41        expect(assetName.getText()).toBe('Energy');
    42      });
    43  
    44      it('Energy table should have 6 columns',() => {
    45        page.navigateTo('/Energy');
    46        element.all(by.css('.thead-cols th')).then(function(arr) {
    47          expect(arr.length).toEqual(6); // Addition of 1 for 'Action' column
    48        });
    49      });
    50  
    51    
    52      it('Cash component should be loadable',() => {
    53        page.navigateTo('/Cash');
    54        var assetName = browser.findElement(by.id('assetName'));
    55        expect(assetName.getText()).toBe('Cash');
    56      });
    57  
    58      it('Cash table should have 6 columns',() => {
    59        page.navigateTo('/Cash');
    60        element.all(by.css('.thead-cols th')).then(function(arr) {
    61          expect(arr.length).toEqual(6); // Addition of 1 for 'Action' column
    62        });
    63      });
    64  
    65    
    66  
    67  });