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/02/25 18:21:51 UTC

[GitHub] [trafficcontrol] shamrickus commented on a change in pull request #5579: Add TP login test and fix login function

shamrickus commented on a change in pull request #5579:
URL: https://github.com/apache/trafficcontrol/pull/5579#discussion_r583062351



##########
File path: traffic_portal/test/integration/PageObjects/LoginPage.po.ts
##########
@@ -29,24 +29,38 @@ export class LoginPage extends BasePage{
     private config = require('../config');
     private randomize = this.config.randomize;
 
-    async Login(userName: string, password: string ){
-        if(userName == 'admin'){
-            await this.txtUserName.sendKeys(userName)
-            await this.txtPassword.sendKeys(password)
+    async Login(login){
+        let result = false;
+        let basePage = new BasePage();
+        if(login.username == 'admin'){
+            await this.txtUserName.sendKeys(login.username)
+            await this.txtPassword.sendKeys(login.password)
             await browser.actions().mouseMove(this.btnLogin).perform();
             await browser.actions().click(this.btnLogin).perform();    
         }else{
-            await this.txtUserName.sendKeys(userName+this.randomize)
-            await this.txtPassword.sendKeys(password)
+            await this.txtUserName.sendKeys(login.username+this.randomize)
+            await this.txtPassword.sendKeys(login.password)
             await browser.actions().mouseMove(this.btnLogin).perform();
             await browser.actions().click(this.btnLogin).perform();    
         }
+        if(await browser.getCurrentUrl() == 'https://localhost/#!/login'){

Review comment:
       Shouldn't this be `browser.params.baseUrl + "#!/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