You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/06/10 15:26:36 UTC

[GitHub] [trafficcontrol] dpham692 opened a new pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

dpham692 opened a new pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929


   <!--
   ************ STOP!! ************
   If this Pull Request is intended to fix a security vulnerability, DO NOT submit it! Instead, contact
   the Apache Software Foundation Security Team at security@trafficcontrol.apache.org and follow the
   guidelines at https://www.apache.org/security/ regarding vulnerability disclosure.
   -->
   ## What does this PR (Pull Request) do?
   <!-- Explain the changes you made here. If this fixes an Issue, identify it by
   replacing the text in the checkbox item with the Issue number e.g.
   
   - [x] This PR fixes #9001 OR is not related to any Issue
   
   ^ This will automatically close Issue number 9001 when the Pull Request is
   merged (The '#' is important).
   
   Be sure you check the box properly, see the "The following criteria are ALL
   met by this PR" section for details.
   -->
   
   - [x] This PR  is not related to any Issue <!-- You can check for an issue here: https://github.com/apache/trafficcontrol/issues -->
   
   
   ## Which Traffic Control components are affected by this PR?
   <!-- Please delete all components from this list that are NOT affected by this
   Pull Request. Also, feel free to add the name of a tool or script that is
   affected but not on the list.
   
   Additionally, if this Pull Request does NOT affect documentation, please
   explain why documentation is not required. -->
   
   - CDN in a Box
   - Traffic Portal
   - CI tests
   
   ## What is the best way to verify this PR?
   <!-- Please include here ALL the steps necessary to test your Pull Request. If
   it includes tests (and most should), outline here the steps needed to run the
   tests. If not, lay out the manual testing procedure and please explain why
   tests are unnecessary for this Pull Request. -->
   Make sure all tests are migrate in integration/Data/deliveryservices.ts directory.
   https://github.com/apache/trafficcontrol/blob/master/traffic_portal/test/e2e_deprecated/deliveryServices/delivery-services-spec.js
   Go to traffic_portal/test/integration and run 
   `npm test -- --params.baseUrl https://localhost --capabilities.shardTestFiles true` and make sure test all pass.
   Make sure CI tests pass also.
   ## If this is a bug fix, what versions of Traffic Control are affected?
   <!-- If this PR fixes a bug, please list here all of the affected versions - to
   the best of your knowledge. It's also pretty helpful to include a commit hash
   of where 'master' is at the time this PR is opened (if it affects master),
   because what 'master' means will change over time. For example, if this PR
   fixes a bug that's present in master (at commit hash '1df853c8'), in v4.0.0,
   and in the current 4.0.1 Release candidate (e.g. RC1), then this list would
   look like:
   
   - master (1df853c8)
   - 4.0.0
   - 4.0.1 (RC1)
   
   If you don't know what other versions might have this bug, AND don't know how
   to find the commit hash of 'master', then feel free to leave this section
   blank (or, preferably, delete it entirely).
    -->
   
   
   ## The following criteria are ALL met by this PR
   <!-- Check the boxes to signify that the associated statement is true. To
   "check a box", replace the space inside of the square brackets with an 'x'.
   e.g.
   
   - [ x] <- Wrong
   - [x ] <- Wrong
   - [] <- Wrong
   - [*] <- Wrong
   - [x] <- Correct!
   
   -->
   
   - [x] This PR includes tests OR I have explained why tests are unnecessary
   - [ ] This PR includes documentation OR I have explained why documentation is unnecessary
   - [ ] This PR includes an update to CHANGELOG.md OR such an update is not necessary
   - [ ] This PR includes any and all required license headers
   - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://www.apache.org/security/) for details)
   
   
   ## Additional Information
   <!-- If you would like to include any additional information on the PR for
   potential reviewers please put it here.
   
   Some examples of this would be:
   
   - Before and after screenshots/gifs of the Traffic Portal if it is affected
   - Links to other dependent Pull Requests
   - References to relevant context (e.g. new/updates to dependent libraries,
   mailing list records, blueprints)
   
   Feel free to leave this section blank (or, preferably, delete it entirely).
   -->
   
   <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
   
       http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rimashah25 commented on a change in pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
rimashah25 commented on a change in pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#discussion_r655550129



##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();

Review comment:
       snp is never reassigned. It should be a constant. Same for L76




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] dpham692 commented on pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
dpham692 commented on pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#issuecomment-863612677


   Look like the test collapse with Users test for some reason.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rimashah25 commented on a change in pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
rimashah25 commented on a change in pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#discussion_r655537673



##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {

Review comment:
       Should we make this and the below function (L79) as public/private?

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;
+    await this.txtSearch.clear();
+    await this.txtSearch.sendKeys(name);
+    const result = await element(by.cssContainingText("span", name)).isPresent();
+    await element(by.cssContainingText("span", name)).click();
+    return !result;
+  }
+  public async UpdateDeliveryService(deliveryservice: UpdateDeliveryService): Promise<boolean | undefined> {
+    let result: boolean | undefined = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("updated")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    switch (deliveryservice.description) {
+      case "update delivery service display name":
+        await this.txtDisplayName.clear();
+        await this.txtDisplayName.sendKeys(deliveryservice.NewName + this.randomize);
+        await basePage.ClickUpdate();
+        break;
+      default:
+        result = undefined;
+    }
+    if (result = !undefined) {
+      result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    }
+    return result;
+  }
+  public async DeleteDeliveryService(deliveryservice: DeleteDeliveryService): Promise<boolean> {
+    let result = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("deleted")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize);
+    }
+    await this.btnDelete.click();
+    await this.txtConfirmName.sendKeys(deliveryservice.Name + this.randomize);
+    await basePage.ClickDeletePermanently();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async AssignServerToDeliveryService(deliveryservice: AssignServer): Promise<boolean>{

Review comment:
       nit: Can we have a new line between functions? Easier to see where they end and new one starts

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));

Review comment:
       Should we use by.name for createDS instead of xpath, much easier to read.

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));

Review comment:
       Should we use by.name for createDS instead of xpath, much easier to read?

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();

Review comment:
       snp is never reassigned. It should be a constant. Same for L76

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();

Review comment:
       basePage should be a constant since it is never re-assigned.

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;
+    await this.txtSearch.clear();
+    await this.txtSearch.sendKeys(name);
+    const result = await element(by.cssContainingText("span", name)).isPresent();
+    await element(by.cssContainingText("span", name)).click();
+    return !result;
+  }
+  public async UpdateDeliveryService(deliveryservice: UpdateDeliveryService): Promise<boolean | undefined> {
+    let result: boolean | undefined = false;
+    let basePage = new BasePage();

Review comment:
       basePage should be a constant since it is never re-assigned.

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;

Review comment:
       name should be a constant since it is never re-assigned.

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;

Review comment:
       `name` should be a constant since it is never re-assigned.

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;
+    await this.txtSearch.clear();
+    await this.txtSearch.sendKeys(name);
+    const result = await element(by.cssContainingText("span", name)).isPresent();
+    await element(by.cssContainingText("span", name)).click();
+    return !result;
+  }
+  public async UpdateDeliveryService(deliveryservice: UpdateDeliveryService): Promise<boolean | undefined> {
+    let result: boolean | undefined = false;
+    let basePage = new BasePage();

Review comment:
       `basePage` should be a constant since it is never re-assigned.

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();

Review comment:
       `basePage` should be a constant since it is never re-assigned.

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();

Review comment:
       `snp` is never reassigned. It should be a constant. Same for L76

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));

Review comment:
       Should we use `by.name` for createDS instead of xpath, much easier to read?

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;
+    await this.txtSearch.clear();
+    await this.txtSearch.sendKeys(name);
+    const result = await element(by.cssContainingText("span", name)).isPresent();
+    await element(by.cssContainingText("span", name)).click();
+    return !result;
+  }
+  public async UpdateDeliveryService(deliveryservice: UpdateDeliveryService): Promise<boolean | undefined> {
+    let result: boolean | undefined = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("updated")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    switch (deliveryservice.description) {
+      case "update delivery service display name":
+        await this.txtDisplayName.clear();
+        await this.txtDisplayName.sendKeys(deliveryservice.NewName + this.randomize);
+        await basePage.ClickUpdate();
+        break;
+      default:
+        result = undefined;
+    }
+    if (result = !undefined) {
+      result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    }
+    return result;
+  }
+  public async DeleteDeliveryService(deliveryservice: DeleteDeliveryService): Promise<boolean> {
+    let result = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("deleted")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize);
+    }
+    await this.btnDelete.click();
+    await this.txtConfirmName.sendKeys(deliveryservice.Name + this.randomize);
+    await basePage.ClickDeletePermanently();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async AssignServerToDeliveryService(deliveryservice: AssignServer): Promise<boolean>{

Review comment:
       nit: Can we have a new line between functions? Easier to see where they end and new one starts.

##########
File path: traffic_portal/test/integration/specs/DeliveryServices.spec.ts
##########
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { browser } from 'protractor';
+import { LoginPage } from '../PageObjects/LoginPage.po'
+import { DeliveryServicePage } from '../PageObjects/DeliveryServicePage.po';
+import { TopNavigationPage } from '../PageObjects/TopNavigationPage.po';
+import { API } from '../CommonUtils/API';
+import { deliveryservices } from "../Data/deliveryservices";
+
+const api = new API();
+const topNavigation = new TopNavigationPage();
+const loginPage = new LoginPage();
+const deliveryservicesPage = new DeliveryServicePage();
+
+describe('Setup API for delivery service test', function () {
+    it('Setup', async () => {
+        await api.UseAPI(deliveryservices.setup);
+    });
+});
+deliveryservices.tests.forEach(async deliveryservicesData => {
+    deliveryservicesData.logins.forEach(login =>{
+        describe(`Traffic Portal - Delivery Service - ${login.description}`, () =>{
+            it('can login', async () => {
+                browser.get(browser.params.baseUrl);
+                await loginPage.Login(login);
+                expect(await loginPage.CheckUserName(login)).toBe(true);
+            });
+            it('can open delivery service page', async () => {
+                await deliveryservicesPage.OpenServicesMenu();
+                await deliveryservicesPage.OpenDeliveryServicePage();
+            });
+            deliveryservicesData.add.forEach(add => {
+                it(add.description, async function () {
+                    expect(await deliveryservicesPage.CreateDeliveryService(add)).toBe(true);
+                    await deliveryservicesPage.OpenDeliveryServicePage();
+                });
+            });
+            deliveryservicesData.update.forEach(update => {
+                it(update.description, async function () {
+                    await deliveryservicesPage.SearchDeliveryService(update.Name);
+                    expect(await deliveryservicesPage.UpdateDeliveryService(update)).toBe(true);
+                    await deliveryservicesPage.OpenDeliveryServicePage();
+                });
+            })
+            deliveryservicesData.assignserver.forEach(assignserver => {
+                it(assignserver.description, async function(){
+                    await deliveryservicesPage.SearchDeliveryService(assignserver.DSName);
+                    expect(await deliveryservicesPage.AssignServerToDeliveryService(assignserver)).toBe(true);
+                    await deliveryservicesPage.OpenDeliveryServicePage();
+                }
+                
+                )
+            })
+            deliveryservicesData.assignrequiredcapabilities.forEach(assignrc => {
+                it(assignrc.description, async function(){
+                    await deliveryservicesPage.SearchDeliveryService(assignrc.DSName);
+                    expect(await deliveryservicesPage.AssignRequiredCapabilitiesToDS(assignrc)).toBe(true);
+                    await deliveryservicesPage.OpenDeliveryServicePage();
+                })
+            })
+            deliveryservicesData.remove.forEach(remove => {
+                it(remove.description, async () => {
+                    await deliveryservicesPage.SearchDeliveryService(remove.Name);
+                    expect(await deliveryservicesPage.DeleteDeliveryService(remove)).toBeTruthy();
+                    await deliveryservicesPage.OpenDeliveryServicePage();
+                });
+            });
+            it('can close service menu tab', async () => {
+                await deliveryservicesPage.OpenServicesMenu();
+            });
+            it('can logout', async () => {
+                expect(await topNavigation.Logout()).toBeTruthy();

Review comment:
       Can we use `toBe(true)` instead of `toBeTruthy`? just like in login().

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;
+    await this.txtSearch.clear();
+    await this.txtSearch.sendKeys(name);
+    const result = await element(by.cssContainingText("span", name)).isPresent();
+    await element(by.cssContainingText("span", name)).click();
+    return !result;
+  }
+  public async UpdateDeliveryService(deliveryservice: UpdateDeliveryService): Promise<boolean | undefined> {
+    let result: boolean | undefined = false;
+    let basePage = new BasePage();

Review comment:
       nit: `basePage` should be a constant since it is never re-assigned.

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;
+    await this.txtSearch.clear();
+    await this.txtSearch.sendKeys(name);
+    const result = await element(by.cssContainingText("span", name)).isPresent();
+    await element(by.cssContainingText("span", name)).click();
+    return !result;
+  }
+  public async UpdateDeliveryService(deliveryservice: UpdateDeliveryService): Promise<boolean | undefined> {
+    let result: boolean | undefined = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("updated")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    switch (deliveryservice.description) {
+      case "update delivery service display name":
+        await this.txtDisplayName.clear();
+        await this.txtDisplayName.sendKeys(deliveryservice.NewName + this.randomize);
+        await basePage.ClickUpdate();
+        break;
+      default:
+        result = undefined;
+    }
+    if (result = !undefined) {
+      result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    }
+    return result;
+  }
+  public async DeleteDeliveryService(deliveryservice: DeleteDeliveryService): Promise<boolean> {
+    let result = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("deleted")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize);
+    }
+    await this.btnDelete.click();
+    await this.txtConfirmName.sendKeys(deliveryservice.Name + this.randomize);
+    await basePage.ClickDeletePermanently();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async AssignServerToDeliveryService(deliveryservice: AssignServer): Promise<boolean>{
+    let result = false;
+    let basePage = new BasePage();

Review comment:
       nit: `basePage` should be a constant since it is never re-assigned.

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;
+    await this.txtSearch.clear();
+    await this.txtSearch.sendKeys(name);
+    const result = await element(by.cssContainingText("span", name)).isPresent();
+    await element(by.cssContainingText("span", name)).click();
+    return !result;
+  }
+  public async UpdateDeliveryService(deliveryservice: UpdateDeliveryService): Promise<boolean | undefined> {
+    let result: boolean | undefined = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("updated")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    switch (deliveryservice.description) {
+      case "update delivery service display name":
+        await this.txtDisplayName.clear();
+        await this.txtDisplayName.sendKeys(deliveryservice.NewName + this.randomize);
+        await basePage.ClickUpdate();
+        break;
+      default:
+        result = undefined;
+    }
+    if (result = !undefined) {
+      result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    }
+    return result;
+  }
+  public async DeleteDeliveryService(deliveryservice: DeleteDeliveryService): Promise<boolean> {
+    let result = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("deleted")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize);
+    }
+    await this.btnDelete.click();
+    await this.txtConfirmName.sendKeys(deliveryservice.Name + this.randomize);
+    await basePage.ClickDeletePermanently();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async AssignServerToDeliveryService(deliveryservice: AssignServer): Promise<boolean>{
+    let result = false;
+    let basePage = new BasePage();
+    await this.btnMore.click();
+    await this.mnuManageServers.click();
+    await this.btnMore.click();
+    await this.btnAssignServer.click();
+    await element(by.cssContainingText("td", deliveryservice.ServerName)).click();
+    await this.ClickSubmit();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async AssignRequiredCapabilitiesToDS(deliveryservice: AssignRC): Promise<boolean>{
+    let result = false;
+    let basePage = new BasePage();

Review comment:
       nit: `basePage` should be a constant since it is never re-assigned.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rimashah25 commented on a change in pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
rimashah25 commented on a change in pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#discussion_r655557702



##########
File path: traffic_portal/test/integration/specs/DeliveryServices.spec.ts
##########
@@ -0,0 +1,99 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { browser } from 'protractor';
+import { LoginPage } from '../PageObjects/LoginPage.po'
+import { DeliveryServicePage } from '../PageObjects/DeliveryServicePage.po';
+import { TopNavigationPage } from '../PageObjects/TopNavigationPage.po';
+import { API } from '../CommonUtils/API';
+import { deliveryservices } from "../Data/deliveryservices";
+
+const api = new API();
+const topNavigation = new TopNavigationPage();
+const loginPage = new LoginPage();
+const deliveryservicesPage = new DeliveryServicePage();
+
+describe('Setup API for delivery service test', function () {
+    it('Setup', async () => {
+        await api.UseAPI(deliveryservices.setup);
+    });
+});
+deliveryservices.tests.forEach(async deliveryservicesData => {
+    deliveryservicesData.logins.forEach(login =>{
+        describe(`Traffic Portal - Delivery Service - ${login.description}`, () =>{
+            it('can login', async () => {
+                browser.get(browser.params.baseUrl);
+                await loginPage.Login(login);
+                expect(await loginPage.CheckUserName(login)).toBe(true);
+            });
+            it('can open delivery service page', async () => {
+                await deliveryservicesPage.OpenServicesMenu();
+                await deliveryservicesPage.OpenDeliveryServicePage();
+            });
+            deliveryservicesData.add.forEach(add => {
+                it(add.description, async function () {
+                    expect(await deliveryservicesPage.CreateDeliveryService(add)).toBe(true);
+                    await deliveryservicesPage.OpenDeliveryServicePage();
+                });
+            });
+            deliveryservicesData.update.forEach(update => {
+                it(update.description, async function () {
+                    await deliveryservicesPage.SearchDeliveryService(update.Name);
+                    expect(await deliveryservicesPage.UpdateDeliveryService(update)).toBe(true);
+                    await deliveryservicesPage.OpenDeliveryServicePage();
+                });
+            })
+            deliveryservicesData.assignserver.forEach(assignserver => {
+                it(assignserver.description, async function(){
+                    await deliveryservicesPage.SearchDeliveryService(assignserver.DSName);
+                    expect(await deliveryservicesPage.AssignServerToDeliveryService(assignserver)).toBe(true);
+                    await deliveryservicesPage.OpenDeliveryServicePage();
+                }
+                
+                )
+            })
+            deliveryservicesData.assignrequiredcapabilities.forEach(assignrc => {
+                it(assignrc.description, async function(){
+                    await deliveryservicesPage.SearchDeliveryService(assignrc.DSName);
+                    expect(await deliveryservicesPage.AssignRequiredCapabilitiesToDS(assignrc)).toBe(true);
+                    await deliveryservicesPage.OpenDeliveryServicePage();
+                })
+            })
+            deliveryservicesData.remove.forEach(remove => {
+                it(remove.description, async () => {
+                    await deliveryservicesPage.SearchDeliveryService(remove.Name);
+                    expect(await deliveryservicesPage.DeleteDeliveryService(remove)).toBeTruthy();
+                    await deliveryservicesPage.OpenDeliveryServicePage();
+                });
+            });
+            it('can close service menu tab', async () => {
+                await deliveryservicesPage.OpenServicesMenu();
+            });
+            it('can logout', async () => {
+                expect(await topNavigation.Logout()).toBeTruthy();

Review comment:
       Can we use `toBe(true)` instead of `toBeTruthy`? just like in login().




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rimashah25 commented on a change in pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
rimashah25 commented on a change in pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#discussion_r655551322



##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();

Review comment:
       basePage should be a constant since it is never re-assigned.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rimashah25 commented on a change in pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
rimashah25 commented on a change in pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#discussion_r655546397



##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;
+    await this.txtSearch.clear();
+    await this.txtSearch.sendKeys(name);
+    const result = await element(by.cssContainingText("span", name)).isPresent();
+    await element(by.cssContainingText("span", name)).click();
+    return !result;
+  }
+  public async UpdateDeliveryService(deliveryservice: UpdateDeliveryService): Promise<boolean | undefined> {
+    let result: boolean | undefined = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("updated")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    switch (deliveryservice.description) {
+      case "update delivery service display name":
+        await this.txtDisplayName.clear();
+        await this.txtDisplayName.sendKeys(deliveryservice.NewName + this.randomize);
+        await basePage.ClickUpdate();
+        break;
+      default:
+        result = undefined;
+    }
+    if (result = !undefined) {
+      result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    }
+    return result;
+  }
+  public async DeleteDeliveryService(deliveryservice: DeleteDeliveryService): Promise<boolean> {
+    let result = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("deleted")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize);
+    }
+    await this.btnDelete.click();
+    await this.txtConfirmName.sendKeys(deliveryservice.Name + this.randomize);
+    await basePage.ClickDeletePermanently();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async AssignServerToDeliveryService(deliveryservice: AssignServer): Promise<boolean>{

Review comment:
       nit: Can we have a new line between functions? Easier to see where they end and new one starts




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
ocket8888 commented on a change in pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#discussion_r653978329



##########
File path: traffic_portal/test/integration/Data/deliveryservices.ts
##########
@@ -0,0 +1,496 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+export const deliveryservices = {
+    cleanup: [
+		{
+			action: "DeleteServers",
+			route: "/servers",
+			method: "delete",
+			data: [
+				{
+					route: "/servers/",
+					getRequest: [
+						{
+							route: "/servers",
+							queryKey: "hostName",
+							queryValue: "DSTest",
+							replace: "route"
+						}
+					]
+				}
+			]
+		},
+		{
+			action: "DeletePhysLocations",
+			route: "/phys_locations",
+			method: "delete",
+			data: [
+				{
+					route: "/phys_locations/",
+					getRequest: [
+						{
+							route: "/phys_locations",
+							queryKey: "name",
+							queryValue: "DSTest",
+							replace: "route"
+						}
+					]
+				}
+			]
+		},
+		{
+			action: "DeleteRegions",
+			route: "/regions",
+			method: "delete",
+			data: [
+				{
+					route: "/regions?name=DSTest"
+				}
+			]
+		},
+		{
+			action: "DeleteDivisions",
+			route: "/divisions",
+			method: "delete",
+			data: [
+				{
+					route: "/divisions/",
+					getRequest: [
+						{
+							route: "/divisions",
+							queryKey: "name",
+							queryValue: "DSTest",
+							replace: "route"
+						}
+					]
+				}
+			]
+		},
+        {
+			action: "DeleteServerCapabilities",
+			route: "/server_capabilities",
+			method: "delete",
+			data: [
+				{
+					route: "/server_capabilities?name=DSTestCap"
+				}
+			]
+		},
+        {
+			action: "DeleteDeliveryServices",
+			route: "/deliveryservices",
+			method: "delete",
+			data: [
+				{
+					route: "/deliveryservices/",
+					getRequest: [
+						{
+							route: "/deliveryservices",
+							queryKey: "xmlId",
+							queryValue: "dstestro1",
+							replace: "route"
+						}
+					]
+				}
+			]
+		}
+	],
+    setup: [
+        {
+			action: "CreateDeliveryServices",
+			route: "/deliveryservices",
+			method: "post",
+			data: [
+				{
+					active: true,
+					cdnId: 0,
+					displayName: "DSTestReadOnly",
+					dscp: 0,
+					geoLimit: 0,
+					geoProvider: 0,
+					initialDispersion: 1,
+					ipv6RoutingEnabled: true,
+					logsEnabled: false,
+					missLat: 41.881944,
+					missLong: -87.627778,
+					multiSiteOrigin: false,
+					orgServerFqdn: "http://origin.infra.ciab.test",
+					protocol: 0,
+					qstringIgnore: 0,
+					rangeRequestHandling: 0,
+					regionalGeoBlocking: false,
+					tenantId: 0,
+					typeId: 1,
+					xmlId: "dstestro1",
+					getRequest: [
+						{
+							route: "/tenants",
+							queryKey: "name",
+							queryValue: "tenantSame",
+							replace: "tenantId"
+						},
+						{
+							route: "/cdns",
+							queryKey: "name",
+							queryValue: "dummycdn",
+							replace: "cdnId"
+						}
+					]
+				}
+            ]
+        },
+        {
+			action: "CreateServerCapabilities",
+			route: "/server_capabilities",
+			method: "post",
+			data: [
+				{
+					name: "DSTestCap"
+				}
+			]
+		},
+        {
+			action: "CreateDivisions",
+			route: "/divisions",
+			method: "post",
+			data: [
+				{
+					name: "DSTest"
+				}
+			]
+		},
+		{
+			action: "CreateRegions",
+			route: "/regions",
+			method: "post",
+			data: [
+				{
+					name: "DSTest",
+					division: "4",
+					divisionName: "DSTest",
+					getRequest: [
+						{
+							route: "/divisions",
+							queryKey: "name",
+							queryValue: "DSTest",
+							replace: "division"
+						}
+					]
+				}
+			]
+		},
+		{
+			action: "CreatePhysLocation",
+			route: "/phys_locations",
+			method: "post",
+			data: [
+				{
+					address: "Buckingham Palace",
+					city: "London",
+					comments: "Buckingham Palace",
+					email: "steve.kingstone@royal.gsx.gov.uk",
+					name: "DSTest",
+					phone: "0-843-816-6276",
+					poc: "Her Majesty The Queen Elizabeth Alexandra Mary Windsor II",
+					regionId: 3,
+					shortName: "tpphys2",
+					state: "NA",
+					zip: "99999",
+					getRequest: [
+						{
+							route: "/regions",
+							queryKey: "name",
+							queryValue: "DSTest",
+							replace: "regionId"
+						}
+					]
+				}
+			]
+		},
+        {
+			action: "CreateServers",
+			route: "/servers",
+			method: "post",
+			data: [
+				{
+					cachegroupId: 0,
+					cdnId: 0,
+					domainName: "test.net",
+					hostName: "DSTest",
+					httpsPort: 443,
+					iloIpAddress: "",
+					iloIpGateway: "",
+					iloIpNetmask: "",
+					iloPassword: "",
+					iloUsername: "",
+					interfaces: [
+						{
+							ipAddresses: [
+								{
+									address: "::1",
+									gateway: "::2",
+									serviceAddress: true
+								}
+							],
+							maxBandwidth: null,
+							monitor: true,
+							mtu: 1500,
+							name: "eth0"
+						}
+					],
+					interfaceMtu: 1500,
+					interfaceName: "eth0",
+					ip6Address: "::1",
+					ip6Gateway: "::2",
+					ipAddress: "0.0.0.1",
+					ipGateway: "0.0.0.2",
+					ipNetmask: "255.255.255.0",
+					mgmtIpAddress: "",
+					mgmtIpGateway: "",
+					mgmtIpNetmask: "",
+					offlineReason: "",
+					physLocationId: 0,
+					profileId: 0,
+					routerHostName: "",
+					routerPortName: "",
+					statusId: 3,
+					tcpPort: 80,
+					typeId: 11,
+					updPending: false,
+					getRequest: [
+						{
+							route: "/phys_locations",
+							queryKey: "name",
+							queryValue: "DSTest",
+							replace: "physLocationId"
+						},
+						{
+							route: "/cdns",
+							queryKey: "name",
+							queryValue: "dummycdn",
+							replace: "cdnId"
+						},
+						{
+							route: "/cachegroups",
+							queryKey: "name",
+							queryValue: "testCG",
+							replace: "cachegroupId"
+						},
+						{
+							route: "/profiles",
+							queryKey: "name",
+							queryValue: "testProfile",
+							replace: "profileId"
+						}
+					]
+				}
+            ]
+        }
+    ],
+    tests: [
+        {
+            logins: [
+                {
+					description: "Admin Role",
+					username: "TPAdmin",
+					password: "pa$$word"
+				}
+            ],
+            add: [
+                {
+                    description: "create ANY_MAP delivery service",
+                    Name: "tpdservice1",
+                    Type: "ANY_MAP",
+                    validationMessage: "Delivery Service [ tpdservice1 ] created"
+                },
+                {
+                    description: "create DNS delivery service",
+                    Name: "tpdservice2",
+                    Type: "DNS",
+                    validationMessage: "Delivery Service [ tpdservice2 ] created"
+                },
+                {
+                    description: "create STEERING delivery service",
+                    Name: "tpdservice3",
+                    Type: "STEERING",
+                    validationMessage: "Delivery Service [ tpdservice3 ] created"
+                }
+            ],
+            update: [
+                {
+                    description: "update delivery service display name",
+                    Name: "tpdservice1",
+                    NewName: "TPServiceNew1",
+                    validationMessage: "Delivery Service [ tpdservice1 ] updated"
+                }
+            ],
+            assignserver: [
+                {
+                    description: "assign server to delivery service",
+                    ServerName: "DSTest",
+                    DSName: "TPServiceNew1",
+                    validationMessage: "server assignments complete"
+                }
+            ],
+            assignrequiredcapabilities: [
+                {
+                    description: "assign required capabilities to delivery service",
+                    RCName: "DSTestCap",
+                    DSName: "tpdservice2",
+                    validationMessage: "deliveryservice.RequiredCapability was created."
+                }
+            ],
+            remove: [
+                {
+                    description: "delete a delivery service",
+                    Name: "tpdservice1",
+                    validationMessage: "Delivery service [ tpdservice1 ] deleted"
+                },
+                {
+                    description: "delete a delivery service",
+                    Name: "tpdservice2",
+                    validationMessage: "Delivery service [ tpdservice2 ] deleted"
+                },
+                {
+                    description: "delete a delivery service",
+                    Name: "tpdservice3",
+                    validationMessage: "Delivery service [ tpdservice3 ] deleted"
+                }
+            ]
+        },
+        {
+            logins: [
+                {
+					description: "Read Only Role",
+					username: "TPReadOnly",
+					password: "pa$$word"
+				}
+            ],
+            add: [
+                {
+                    description: "create ANY_MAP delivery service",
+                    Name: "tpdservice1",
+                    Type: "ANY_MAP",
+                    validationMessage: "Forbidden."
+                }
+            ],
+            update: [
+                {
+                    description: "update delivery service display name",
+                    Name: "dstestro1",
+                    NewName: "TPServiceNew1",
+                    validationMessage: "Forbidden."
+                }
+            ],
+            assignserver: [
+                {
+                    description: "assign server to delivery service",
+                    ServerName: "DSTest",
+                    DSName: "dstestro1",
+                    validationMessage: "Forbidden."
+                }
+            ],
+            assignrequiredcapabilities: [
+                {
+                    description: "assign required capabilities to delivery service",
+                    RCName: "DSTestCap",
+                    DSName: "dstestro1",
+                    validationMessage: "Forbidden."
+                }
+            ],
+            remove: [
+                {
+                    description: "delete a delivery service",
+                    Name: "dstestro1",
+                    validationMessage: "Forbidden."
+                }
+            ]
+        },
+		{
+            logins: [
+				{
+					description: "Operator Role",
+					username: "TPOperator",
+					password: "pa$$word"
+				}
+            ],
+            add: [
+                {
+                    description: "create ANY_MAP delivery service",
+                    Name: "tpdservice1",
+                    Type: "ANY_MAP",
+                    validationMessage: "Delivery Service [ tpdservice1 ] created"
+                },
+                {
+                    description: "create DNS delivery service",
+                    Name: "tpdservice2",
+                    Type: "DNS",
+                    validationMessage: "Delivery Service [ tpdservice2 ] created"
+                },
+                {
+                    description: "create STEERING delivery service",
+                    Name: "tpdservice3",
+                    Type: "STEERING",
+                    validationMessage: "Delivery Service [ tpdservice3 ] created"
+                }
+            ],
+            update: [
+                {
+                    description: "update delivery service display name",
+                    Name: "tpdservice1",
+                    NewName: "TPServiceNew1",
+                    validationMessage: "Delivery Service [ tpdservice1 ] updated"
+                }
+            ],
+            assignserver: [
+                {
+                    description: "assign server to delivery service",
+                    ServerName: "DSTest",
+                    DSName: "TPServiceNew1",
+                    validationMessage: "server assignments complete"
+                }
+            ],
+            assignrequiredcapabilities: [
+                {
+                    description: "assign required capabilities to delivery service",
+                    RCName: "DSTestCap",
+                    DSName: "tpdservice2",
+                    validationMessage: "deliveryservice.RequiredCapability was created."
+                }
+            ],
+            remove: [
+                {
+                    description: "delete a delivery service",
+                    Name: "tpdservice1",
+                    validationMessage: "Delivery service [ tpdservice1 ] deleted"
+                },
+                {
+                    description: "delete a delivery service",
+                    Name: "tpdservice2",
+                    validationMessage: "Delivery service [ tpdservice2 ] deleted"
+                },
+                {
+                    description: "delete a delivery service",
+                    Name: "tpdservice3",
+                    validationMessage: "Delivery service [ tpdservice3 ] deleted"
+                }
+            ]
+        }
+    ]
+}

Review comment:
       missing newline at EOF




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] ocket8888 merged pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
ocket8888 merged pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rimashah25 commented on a change in pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
rimashah25 commented on a change in pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#discussion_r655550129



##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();

Review comment:
       `snp` is never reassigned. It should be a constant. Same for L76




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rimashah25 commented on a change in pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
rimashah25 commented on a change in pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#discussion_r655558484



##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;
+    await this.txtSearch.clear();
+    await this.txtSearch.sendKeys(name);
+    const result = await element(by.cssContainingText("span", name)).isPresent();
+    await element(by.cssContainingText("span", name)).click();
+    return !result;
+  }
+  public async UpdateDeliveryService(deliveryservice: UpdateDeliveryService): Promise<boolean | undefined> {
+    let result: boolean | undefined = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("updated")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    switch (deliveryservice.description) {
+      case "update delivery service display name":
+        await this.txtDisplayName.clear();
+        await this.txtDisplayName.sendKeys(deliveryservice.NewName + this.randomize);
+        await basePage.ClickUpdate();
+        break;
+      default:
+        result = undefined;
+    }
+    if (result = !undefined) {
+      result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    }
+    return result;
+  }
+  public async DeleteDeliveryService(deliveryservice: DeleteDeliveryService): Promise<boolean> {
+    let result = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("deleted")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize);
+    }
+    await this.btnDelete.click();
+    await this.txtConfirmName.sendKeys(deliveryservice.Name + this.randomize);
+    await basePage.ClickDeletePermanently();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async AssignServerToDeliveryService(deliveryservice: AssignServer): Promise<boolean>{
+    let result = false;
+    let basePage = new BasePage();
+    await this.btnMore.click();
+    await this.mnuManageServers.click();
+    await this.btnMore.click();
+    await this.btnAssignServer.click();
+    await element(by.cssContainingText("td", deliveryservice.ServerName)).click();
+    await this.ClickSubmit();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async AssignRequiredCapabilitiesToDS(deliveryservice: AssignRC): Promise<boolean>{
+    let result = false;
+    let basePage = new BasePage();

Review comment:
       nit: `basePage` should be a constant since it is never re-assigned.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rimashah25 commented on a change in pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
rimashah25 commented on a change in pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#discussion_r655548726



##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));

Review comment:
       Should we use `by.name` for createDS instead of xpath, much easier to read?

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;
+    await this.txtSearch.clear();
+    await this.txtSearch.sendKeys(name);
+    const result = await element(by.cssContainingText("span", name)).isPresent();
+    await element(by.cssContainingText("span", name)).click();
+    return !result;
+  }
+  public async UpdateDeliveryService(deliveryservice: UpdateDeliveryService): Promise<boolean | undefined> {
+    let result: boolean | undefined = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("updated")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    switch (deliveryservice.description) {
+      case "update delivery service display name":
+        await this.txtDisplayName.clear();
+        await this.txtDisplayName.sendKeys(deliveryservice.NewName + this.randomize);
+        await basePage.ClickUpdate();
+        break;
+      default:
+        result = undefined;
+    }
+    if (result = !undefined) {
+      result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    }
+    return result;
+  }
+  public async DeleteDeliveryService(deliveryservice: DeleteDeliveryService): Promise<boolean> {
+    let result = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("deleted")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize);
+    }
+    await this.btnDelete.click();
+    await this.txtConfirmName.sendKeys(deliveryservice.Name + this.randomize);
+    await basePage.ClickDeletePermanently();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async AssignServerToDeliveryService(deliveryservice: AssignServer): Promise<boolean>{

Review comment:
       nit: Can we have a new line between functions? Easier to see where they end and new one starts.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rimashah25 commented on a change in pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
rimashah25 commented on a change in pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#discussion_r655553251



##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;
+    await this.txtSearch.clear();
+    await this.txtSearch.sendKeys(name);
+    const result = await element(by.cssContainingText("span", name)).isPresent();
+    await element(by.cssContainingText("span", name)).click();
+    return !result;
+  }
+  public async UpdateDeliveryService(deliveryservice: UpdateDeliveryService): Promise<boolean | undefined> {
+    let result: boolean | undefined = false;
+    let basePage = new BasePage();

Review comment:
       nit: `basePage` should be a constant since it is never re-assigned.

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;
+    await this.txtSearch.clear();
+    await this.txtSearch.sendKeys(name);
+    const result = await element(by.cssContainingText("span", name)).isPresent();
+    await element(by.cssContainingText("span", name)).click();
+    return !result;
+  }
+  public async UpdateDeliveryService(deliveryservice: UpdateDeliveryService): Promise<boolean | undefined> {
+    let result: boolean | undefined = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("updated")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    switch (deliveryservice.description) {
+      case "update delivery service display name":
+        await this.txtDisplayName.clear();
+        await this.txtDisplayName.sendKeys(deliveryservice.NewName + this.randomize);
+        await basePage.ClickUpdate();
+        break;
+      default:
+        result = undefined;
+    }
+    if (result = !undefined) {
+      result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    }
+    return result;
+  }
+  public async DeleteDeliveryService(deliveryservice: DeleteDeliveryService): Promise<boolean> {
+    let result = false;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("deleted")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize);
+    }
+    await this.btnDelete.click();
+    await this.txtConfirmName.sendKeys(deliveryservice.Name + this.randomize);
+    await basePage.ClickDeletePermanently();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async AssignServerToDeliveryService(deliveryservice: AssignServer): Promise<boolean>{
+    let result = false;
+    let basePage = new BasePage();

Review comment:
       nit: `basePage` should be a constant since it is never re-assigned.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rimashah25 commented on a change in pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
rimashah25 commented on a change in pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#discussion_r655553382



##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;

Review comment:
       `name` should be a constant since it is never re-assigned.

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;
+    await this.txtSearch.clear();
+    await this.txtSearch.sendKeys(name);
+    const result = await element(by.cssContainingText("span", name)).isPresent();
+    await element(by.cssContainingText("span", name)).click();
+    return !result;
+  }
+  public async UpdateDeliveryService(deliveryservice: UpdateDeliveryService): Promise<boolean | undefined> {
+    let result: boolean | undefined = false;
+    let basePage = new BasePage();

Review comment:
       `basePage` should be a constant since it is never re-assigned.

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();

Review comment:
       `basePage` should be a constant since it is never re-assigned.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rimashah25 commented on a change in pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
rimashah25 commented on a change in pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#discussion_r655548726



##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));

Review comment:
       Should we use by.name for createDS instead of xpath, much easier to read.

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));

Review comment:
       Should we use by.name for createDS instead of xpath, much easier to read?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rimashah25 commented on pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
rimashah25 commented on pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#issuecomment-866308926


   LGTM. Tests work.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rimashah25 commented on a change in pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
rimashah25 commented on a change in pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#discussion_r655553251



##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;
+    await this.txtSearch.clear();
+    await this.txtSearch.sendKeys(name);
+    const result = await element(by.cssContainingText("span", name)).isPresent();
+    await element(by.cssContainingText("span", name)).click();
+    return !result;
+  }
+  public async UpdateDeliveryService(deliveryservice: UpdateDeliveryService): Promise<boolean | undefined> {
+    let result: boolean | undefined = false;
+    let basePage = new BasePage();

Review comment:
       basePage should be a constant since it is never re-assigned.

##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {
+    let snp = new SideNavigationPage();
+    await snp.NavigateToDeliveryServicesPage();
+  }
+  async OpenServicesMenu() {
+    let snp = new SideNavigationPage();
+    await snp.ClickServicesMenu();
+  }
+  public async CreateDeliveryService(deliveryservice: DeliveryServices): Promise<boolean> {
+    let result = false;
+    let type: string = deliveryservice.Type;
+    let basePage = new BasePage();
+    if (deliveryservice.validationMessage.includes("created")) {
+      deliveryservice.validationMessage = deliveryservice.validationMessage.replace(deliveryservice.Name, deliveryservice.Name + this.randomize)
+    }
+    await this.btnMore.click();
+    await this.btnCreateNewDeliveryServices.click();
+    await this.mnuFormDropDown.sendKeys(type);
+    await this.btnSubmitFormDropDown.click();
+    switch (type) {
+      case "ANY_MAP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('ANY_MAP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtRemapText.sendKeys('test')
+        break;
+      }
+      case "DNS": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('DNS')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "HTTP": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('HTTP')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtOrgServerURL.sendKeys('http://origin.infra.ciab.test');
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      case "STEERING": {
+        await this.txtXmlId.sendKeys(deliveryservice.Name + this.randomize);
+        await this.txtDisplayName.sendKeys(deliveryservice.Name + this.randomize);
+        await this.selectActive.sendKeys('Active')
+        await this.selectType.sendKeys('STEERING')
+        await this.selectTenant.sendKeys('- root')
+        await this.selectCDN.sendKeys('dummycdn')
+        await this.txtProtocol.sendKeys('HTTP')
+        break;
+      }
+      default:
+        {
+          console.log('Wrong Type name');
+          break;
+        }
+    }
+    await this.btnCreateDeliveryServices.click();
+    result = await basePage.GetOutputMessage().then(value => value === deliveryservice.validationMessage);
+    return result;
+  }
+  public async SearchDeliveryService(nameDS: string): Promise<boolean> {
+    let name = nameDS + this.randomize;

Review comment:
       name should be a constant since it is never re-assigned.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [trafficcontrol] rimashah25 commented on a change in pull request #5929: Migrate Delivery Service test from e2e to integration suite TP

Posted by GitBox <gi...@apache.org>.
rimashah25 commented on a change in pull request #5929:
URL: https://github.com/apache/trafficcontrol/pull/5929#discussion_r655537673



##########
File path: traffic_portal/test/integration/PageObjects/DeliveryServicePage.po.ts
##########
@@ -0,0 +1,212 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { BasePage } from './BasePage.po';
+import { randomize } from "../config";
+import { SideNavigationPage } from './SideNavigationPage.po';
+import { by, element } from 'protractor';
+
+interface DeliveryServices {
+  Type: string;
+  Name: string;
+  validationMessage: string;
+}
+interface UpdateDeliveryService {
+  description: string;
+  Name: string;
+  NewName: string;
+  validationMessage: string;
+}
+interface DeleteDeliveryService {
+  Name: string;
+  validationMessage: string;
+}
+interface AssignServer {
+  DSName: string;
+  ServerName: string;
+  validationMessage: string;
+}
+interface AssignRC {
+  RCName: string;
+  DSName: string;
+  validationMessage: string;
+}
+export class DeliveryServicePage extends BasePage {
+  private btnCreateNewDeliveryServices = element(by.linkText("Create Delivery Service"));
+  private mnuFormDropDown = element(by.name('selectFormDropdown'));
+  private btnSubmitFormDropDown = element(by.buttonText('Submit'));
+  private txtSearch = element(by.id("quickSearch"))
+  private txtConfirmName = element(by.name('confirmWithNameInput'));
+  private btnDelete = element(by.buttonText('Delete'));
+  private btnMore = element(by.name('moreBtn'));
+  private mnuManageRequiredServerCapabilities = element(by.linkText('Manage Required Server Capabilities'));
+  private btnAddRequiredServerCapabilities = element(by.name('addCapabilityBtn'));
+  private txtInputRC = element(by.name("selectFormDropdown")); 
+  private mnuManageServers = element(by.buttonText('Manage Servers'));
+  private btnAssignServer = element(by.name("selectServersMenuItem"));
+  private txtXmlId = element(by.name('xmlId'));
+  private txtDisplayName = element(by.name('displayName'));
+  private selectActive = element(by.name('active'));
+  private selectType = element(by.id('type'));
+  private selectTenant = element(by.name('tenantId'));
+  private selectCDN = element(by.name('cdn'));
+  private txtOrgServerURL = element(by.name('orgServerFqdn'));
+  private txtProtocol = element(by.name('protocol'));
+  private txtRemapText = element(by.name('remapText'));
+  private btnCreateDeliveryServices = element(by.xpath("//div[@class='pull-right']//button[text()='Create']"));
+  private randomize = randomize;
+
+  async OpenDeliveryServicePage() {

Review comment:
       Should we make this and the below function (L79) as public/private?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org