2021-03-03 19:12:16 +00:00
|
|
|
import SidebarPage from "../support/pages/admin_console/SidebarPage";
|
|
|
|
import LoginPage from "../support/pages/LoginPage";
|
2021-03-04 14:26:21 +00:00
|
|
|
import CreateUserPage from "../support/pages/admin_console/manage/users/CreateUserPage";
|
|
|
|
import Masthead from "../support/pages/admin_console/Masthead";
|
|
|
|
import ListingPage from "../support/pages/admin_console/ListingPage";
|
2021-03-03 19:12:16 +00:00
|
|
|
|
|
|
|
describe("Users test", () => {
|
|
|
|
const loginPage = new LoginPage();
|
|
|
|
const sidebarPage = new SidebarPage();
|
2021-03-04 14:26:21 +00:00
|
|
|
const createUserPage = new CreateUserPage();
|
|
|
|
const masthead = new Masthead();
|
|
|
|
const listingPage = new ListingPage();
|
|
|
|
|
|
|
|
let itemId = "user_crud";
|
2021-03-03 19:12:16 +00:00
|
|
|
|
|
|
|
describe("User creation", () => {
|
|
|
|
beforeEach(function () {
|
|
|
|
cy.visit("");
|
|
|
|
loginPage.logIn();
|
|
|
|
sidebarPage.goToUsers();
|
|
|
|
});
|
|
|
|
|
|
|
|
it("Go to create User page", () => {
|
2021-03-04 18:49:05 +00:00
|
|
|
cy.wait(100);
|
|
|
|
|
2021-03-04 14:26:21 +00:00
|
|
|
createUserPage.goToCreateUser();
|
2021-03-03 19:12:16 +00:00
|
|
|
cy.url().should("include", "users/add-user");
|
2021-03-04 14:26:21 +00:00
|
|
|
|
|
|
|
// Verify Cancel button works
|
|
|
|
createUserPage.cancel();
|
2021-03-03 19:12:16 +00:00
|
|
|
cy.url().should("not.include", "/add-user");
|
|
|
|
});
|
2021-03-04 14:26:21 +00:00
|
|
|
|
|
|
|
it("Create user test", function () {
|
|
|
|
itemId += "_" + (Math.random() + 1).toString(36).substring(7);
|
2021-03-04 18:49:05 +00:00
|
|
|
|
2021-03-04 14:26:21 +00:00
|
|
|
// Create
|
2021-03-04 18:49:05 +00:00
|
|
|
cy.wait(100);
|
|
|
|
|
2021-03-04 14:26:21 +00:00
|
|
|
createUserPage.goToCreateUser();
|
2021-03-04 18:49:05 +00:00
|
|
|
|
2021-03-04 14:26:21 +00:00
|
|
|
createUserPage.fillRealmRoleData(itemId).save();
|
|
|
|
|
|
|
|
masthead.checkNotificationMessage("The user has been created");
|
|
|
|
|
|
|
|
sidebarPage.goToUsers();
|
|
|
|
listingPage.searchItem(itemId).itemExist(itemId);
|
|
|
|
});
|
2021-03-03 19:12:16 +00:00
|
|
|
});
|
|
|
|
});
|