1 import { tick } from '@angular/core/testing';
3 * ========================LICENSE_START=================================
6 * Copyright (C) 2019 AT&T Intellectual Property
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ========================LICENSE_END===================================
21 import { browser, by, element, logging } from "protractor";
23 describe("Home page", () => {
26 browser.get("http://localhost:4200/");
29 it("should display title", () => {
30 expect(browser.getTitle()).toEqual("Non-RT RIC Control Panel");
33 it("should reach policy types page when clicking on the policy types card", async () => {
34 await element(by.id('policyControlCard')).click();
35 expect(browser.getCurrentUrl()).toEqual("http://localhost:4200/policy");
38 it("should reach enrichment information coordinator page when clicking on the enrichment information coordinator card", async () => {
39 await element(by.id('eicCard')).click();
40 expect(browser.getCurrentUrl()).toEqual("http://localhost:4200/ei-coordinator");
43 afterEach(async () => {
44 // Assert that there are no errors emitted from the browser
45 const logs = await browser.manage().logs().get(logging.Type.BROWSER);
46 expect(logs).not.toContain(
47 jasmine.objectContaining({
48 level: logging.Level.SEVERE,
54 describe("Sidebar navigation", () => {
57 browser.get("http://localhost:4200/");
58 element(by.id('Menu_Burger_Icon')).click();
61 it("should reach policy types page when clicking in the side bar", async () => {
62 await element(by.id('policyToggle')).click();
63 await element(by.id('policyLink')).click();
64 expect(browser.getCurrentUrl()).toEqual("http://localhost:4200/policy");
67 it("should reach ric configuration page when clicking in the side bar", async () => {
68 await element(by.id('policyToggle')).click();
69 await element(by.id('ricConfigLink')).click();
70 expect(browser.getCurrentUrl()).toEqual("http://localhost:4200/ric-config");
73 it("should reach enrichment information coordinator page when clicking in the side bar", async () => {
74 await element(by.id('eicLink')).click();
75 expect(browser.getCurrentUrl()).toEqual("http://localhost:4200/ei-coordinator");
78 afterEach(async () => {
79 // Assert that there are no errors emitted from the browser
80 const logs = await browser.manage().logs().get(logging.Type.BROWSER);
81 expect(logs).not.toContain(
82 jasmine.objectContaining({
83 level: logging.Level.SEVERE,
89 describe("Policy types page", () => {
92 browser.get("http://localhost:4200/policy");
95 it("should reach back to home from policy types page when clicking in the side bar", async () => {
96 await element(by.id('Menu_Burger_Icon')).click();
97 await element(by.id('homeLink')).click();
98 expect(browser.getCurrentUrl()).toEqual("http://localhost:4200/");
101 it("should show types when clicking on expand button in policy types page", async () => {
102 await element(by.id('visible')).click();
103 expect(element(by.id('createButton'))).toBeTruthy();
106 it("should display a pop-up window when clicking on the create button for a policy instance", async () => {
107 await element(by.id('visible')).click();
108 await element(by.id('createButton')).click();
109 expect(element(by.id('closeButton'))).toBeTruthy();
112 it("should open a pop-up window when clicking on the data of a policy instance", async () => {
113 await element(by.id('visible')).click();
114 let instanceTable = element(by.id('policiesTable'));
115 await element(by.css('mat-cell')).click();
116 expect(element(by.id('closeButton'))).toBeTruthy();
119 afterEach(async () => {
120 // Assert that there are no errors emitted from the browser
121 const logs = await browser.manage().logs().get(logging.Type.BROWSER);
122 expect(logs).not.toContain(
123 jasmine.objectContaining({
124 level: logging.Level.SEVERE,
130 describe("Enrichment information coordinator page", () => {
133 browser.get("http://localhost:4200/ei-coordinator");
136 it("should reach back to home from enrichment information coordinator page when clicking in the side bar", async () => {
137 await element(by.id('Menu_Burger_Icon')).click();
138 await element(by.id('homeLink')).click();
139 expect(browser.getCurrentUrl()).toEqual("http://localhost:4200/");
142 afterEach(async () => {
143 // Assert that there are no errors emitted from the browser
144 const logs = await browser.manage().logs().get(logging.Type.BROWSER);
145 expect(logs).not.toContain(
146 jasmine.objectContaining({
147 level: logging.Level.SEVERE,