You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by oc...@apache.org on 2021/05/21 19:03:23 UTC

[trafficcontrol] branch master updated: Fix log out function and remove check from log in (#5868)

This is an automated email from the ASF dual-hosted git repository.

ocket8888 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git


The following commit(s) were added to refs/heads/master by this push:
     new 1a3dbc1  Fix log out function and remove check from log in (#5868)
1a3dbc1 is described below

commit 1a3dbc1ea2f087c0565c52045655dcbe1042a7e3
Author: dpham <ph...@yahoo.com>
AuthorDate: Fri May 21 13:03:07 2021 -0600

    Fix log out function and remove check from log in (#5868)
    
    Co-authored-by: Pham, Dandy (Contractor) <Da...@comcast.com>
---
 traffic_portal/test/integration/PageObjects/LoginPage.po.ts         | 3 +--
 traffic_portal/test/integration/PageObjects/TopNavigationPage.po.ts | 5 ++---
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/traffic_portal/test/integration/PageObjects/LoginPage.po.ts b/traffic_portal/test/integration/PageObjects/LoginPage.po.ts
index ac27c96..84af4b2 100644
--- a/traffic_portal/test/integration/PageObjects/LoginPage.po.ts
+++ b/traffic_portal/test/integration/PageObjects/LoginPage.po.ts
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-import { browser, by, element, until} from 'protractor';
+import { browser, by, element} from 'protractor';
 
 import { randomize } from "../config";
 import { BasePage } from './BasePage.po'
@@ -52,7 +52,6 @@ export class LoginPage extends BasePage{
     async Login(login: LoginData){
         let result = false;
         const basePage = new BasePage();
-        await browser.wait(until.urlIs(browser.params.baseUrl + "/#!/login?redirect=%252F"), 10000)
         if(login.username === 'admin'){
             await this.txtUserName.sendKeys(login.username)
             await this.txtPassword.sendKeys(login.password)
diff --git a/traffic_portal/test/integration/PageObjects/TopNavigationPage.po.ts b/traffic_portal/test/integration/PageObjects/TopNavigationPage.po.ts
index 37dc1b1..4bdedf4 100644
--- a/traffic_portal/test/integration/PageObjects/TopNavigationPage.po.ts
+++ b/traffic_portal/test/integration/PageObjects/TopNavigationPage.po.ts
@@ -18,7 +18,7 @@
  */
 import { existsSync, readdirSync, unlink } from "fs";
 
-import { browser, by, element, ExpectedConditions } from 'protractor';
+import { browser, by, element, until } from 'protractor';
 import { BasePage } from './BasePage.po';
 
 export class TopNavigationPage extends BasePage{
@@ -32,7 +32,6 @@ export class TopNavigationPage extends BasePage{
     private lnkUser = element(by.id('headerUsername'));
     private mnuManageUserProfile = element(by.linkText('Manage User Profile'));
     private btnLogout = element(by.xpath("//a[@uib-popover='Logout']"));
-    private txtUserName = element(by.id("loginUsername"))
     async PerformSnapshot(cdnname:string,message:string){
         let result = false;
         let basePage = new BasePage();
@@ -110,7 +109,7 @@ export class TopNavigationPage extends BasePage{
     async Logout(){
         let result = false;
         await this.btnLogout.click();
-        if(await browser.wait(ExpectedConditions.visibilityOf(this.txtUserName), 20000) == true){
+        if(await browser.wait(until.urlIs(browser.params.baseUrl + "/#!/login"), 10000) === true){
             result = true;
         }
         return result;