82 lines
3.2 KiB
TypeScript
82 lines
3.2 KiB
TypeScript
import { test, expect } from '@playwright/test'
|
||
import { LeftMenuAdminPage } from '../src/page-objects/AD_LeftMenuAdminPage'
|
||
import { ViewUsersPage } from '../src/page-objects/AD_ViewUsersPage';
|
||
import { BasicUserInfoSectionPage } from '../src/page-objects/AD_BasicUserInfoSectionInPage';
|
||
import { ViewRolesPage } from '../src/page-objects/AD_ViewRolesPage';
|
||
import { ViewServicesPage } from '../src/page-objects/AD_ViewServicesPage';
|
||
import { clickAddUserOnLeftMenu, clickDashboardOnLeftMenu, clickManageRolesOnLeftMenu, clickManageServicesOnLeftMenu, clickViewUsersOnLeftMenu, loginAsAdmin } from '../src/steps';
|
||
import { URL_IDHUB } from '../src/constants/env_constants';
|
||
|
||
/**
|
||
* Check the navigation options on the Left Menu
|
||
*/
|
||
test.describe('Leftside Menu navigation test', () => {
|
||
test.beforeEach(async ({ page }) => {
|
||
await loginAsAdmin(page, URL_IDHUB);
|
||
})
|
||
test.afterEach(async ({ page }) => { //este se ejecutará despues de cada test
|
||
await page.click('.logout');
|
||
await page.close();
|
||
})
|
||
|
||
test('LEFTMENU -> Dashboard', async ({ page }) => {
|
||
await clickDashboardOnLeftMenu(page)
|
||
await expect(page).toHaveTitle('Dashboard – IdHub');
|
||
})
|
||
|
||
test('LEFTMENU -> Users', async ({ page }) => {
|
||
|
||
await clickViewUsersOnLeftMenu(page);
|
||
await expect(page).toHaveTitle('User management – IdHub');
|
||
//Check titles
|
||
const viewUsersPage = new ViewUsersPage(page);
|
||
expect(await viewUsersPage.getPrimaryTitle()).toEqual("User management");
|
||
expect(await viewUsersPage.getSecondaryTitle()).toEqual(" View users");
|
||
|
||
//Navigate to "Add user"
|
||
const basicInfoPage = new BasicUserInfoSectionPage(page);
|
||
await clickAddUserOnLeftMenu(page);
|
||
|
||
//Check titles
|
||
expect(await basicInfoPage.getPrimaryTitleText()).toEqual("User management");
|
||
expect(await basicInfoPage.getSecondaryTitleText()).toEqual(" Add user");
|
||
})
|
||
|
||
test('LEFTMENU -> Roles and Services', async ({ page }) => {
|
||
|
||
//Navigate to "Roles"
|
||
const leftMenu = new LeftMenuAdminPage(page);
|
||
(await leftMenu.getRolesLink()).click();
|
||
|
||
//Navigate to "Manage roles"
|
||
await clickManageRolesOnLeftMenu(page);
|
||
await expect(page).toHaveTitle('Access control management – IdHub');
|
||
|
||
//Check titles
|
||
const viewRolesPage = new ViewRolesPage(page);
|
||
expect(await viewRolesPage.getPrimaryTitle()).toEqual("Access control management");
|
||
expect(await viewRolesPage.getSecondaryTitle()).toEqual("Manage roles");
|
||
|
||
//Navigate to "Manage services"
|
||
await clickManageServicesOnLeftMenu(page);
|
||
await expect(page).toHaveTitle('Access control management – IdHub');
|
||
|
||
//Check titles
|
||
const viewServicesPage = new ViewServicesPage(page);
|
||
expect(await viewServicesPage.getPrimaryTitle()).toEqual("Access control management");
|
||
expect(await viewServicesPage.getSecondaryTitle()).toEqual("Manage services");
|
||
|
||
})
|
||
|
||
//TODO: credentials, templates....
|
||
|
||
test.skip('LEFTMENU -> Credentials', async ({ page }) => {
|
||
})
|
||
|
||
test.skip('LEFTMENU -> Templates', async ({ page }) => {
|
||
})
|
||
|
||
test.skip('LEFTMENU -> Data', async ({ page }) => {
|
||
})
|
||
|
||
}) |