dandypham commented on a change in pull request #3748: Add initial origins and 
users TP tests
URL: https://github.com/apache/trafficcontrol/pull/3748#discussion_r318752468
 
 

 ##########
 File path: traffic_portal/test/end_to_end/roles/roles-spec.js
 ##########
 @@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+
+var pd = require('./pageData.js');
+var cfunc = require('../common/commonFunctions.js');
+
+describe('Traffic Portal Roles Test Suite', function() {
+    const pageData = new pd();
+    const commonFunctions = new cfunc();
+    const myNewRole = {
+        name: "role-" + 
commonFunctions.shuffle('abcdefghijklmnopqrstuvwxyz0123456789'),
+        privLevel: 30,
+        description: "This is my new role"
+    };
+    const tableRepeater = "r in ::roles";
+
+    it('should create a new role', async () => {
+        console.log('Creating new role');
+        await browser.setLocation('roles');
+        await pageData.createRoleButton.click();
+        await pageData.name.sendKeys(myNewRole.name);
+        await pageData.privLevel.sendKeys(myNewRole.privLevel);
+        await pageData.description.click().sendKeys(myNewRole.description);
+        await pageData.createButton.click();
+        expect(pageData.successMsg.isPresent()).toBe(true, 'Success alert 
message should exist');
+        expect(pageData.roleCreatedText.isPresent()).toBe(true, 'Actual 
message does not match expected message');
+        
expect(browser.getCurrentUrl().then(commonFunctions.urlPath)).toEqual(commonFunctions.urlPath(browser.baseUrl)
 + "#!/roles");
 
 Review comment:
   ```suggestion
           
expect(browser.getCurrentUrl().then(commonFunctions.urlPath)).toEqual(commonFunctions.urlPath(browser.baseUrl)
 + "#!/roles/new");
   ```
   Go to new page

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to