- cy.get('@vmRow')
- .find('div[role=button]')
- .contains('admin')
- .parents('[role=button]')
- .find('svg')
- .as('removeButton');
- cy.get('@removeButton').click();
- cy.get('[data-cy=confirmation-dialog-ok-btn]').click();
+ // Verify new login permissions
+ // Check activeUser's vm page for login
+ cy.loginAs(activeUser);
+ cy.get('header button[title="Account Management"]').click();
+ cy.get("#account-menu").contains("Virtual Machines").click();
+
+ cy.get("[data-cy=vm-user-table]")
+ .contains(vmHost)
+ .parents("tr")
+ .within(() => {
+ cy.get("td").contains("user");
+ cy.get("td").contains("docker");
+ cy.get("td").should("not.contain", "sudo");
+ cy.get("td").contains("ssh user@" + vmHost);
+ });
+
+ // Remove login permissions
+ cy.loginAs(adminUser);
+ cy.get('header button[title="Admin Panel"]').click();
+ cy.get("#admin-menu").contains("Virtual Machines").click();
+
+ cy.get("[data-cy=vm-admin-table]").contains("user"); // Wait for page to finish
+
+ cy.get("[data-cy=vm-admin-table]")
+ .contains(vmHost)
+ .parents("tr")
+ .as("vmRow")
+ .contains("user")
+ .parents("[role=button]")
+ .find("svg")
+ .as("removeButton");
+ cy.get("@removeButton").click();
+ cy.get("[data-cy=confirmation-dialog-ok-btn]").click();
+
+ cy.get("@vmRow").within(() => {
+ cy.get("div[role=button]").should("not.contain", "user");
+ cy.get("div[role=button]").should("have.length", 1);
+ });
+
+ cy.get("@vmRow").find("div[role=button]").contains("admin").parents("[role=button]").find("svg").as("removeButton");
+ cy.get("@removeButton").click();
+ cy.get("[data-cy=confirmation-dialog-ok-btn]").click();