diff --git a/dev/prod/public/branding.json b/dev/prod/public/branding.json index 0315bc13fd3..a3c99b1eeef 100644 --- a/dev/prod/public/branding.json +++ b/dev/prod/public/branding.json @@ -64,6 +64,7 @@ "defaultApplication": "documents", "defaultSpace": "documents:space:QualityDocuments", "defaultSpecial": "", + "lastNameFirst": "true", "links": [ { "rel": "shortcut icon", diff --git a/qms-tests/sanity/tests/auth/auth.setup.ts b/qms-tests/sanity/tests/auth/auth.setup.ts index 6ff226efcf6..942c841a6d8 100644 --- a/qms-tests/sanity/tests/auth/auth.setup.ts +++ b/qms-tests/sanity/tests/auth/auth.setup.ts @@ -1,7 +1,15 @@ import { test as setup, Page } from '@playwright/test' import path from 'path' -import { PlatformUser, PlatformUserSecond, PlatformUserThird, PlatformUserQara, PlatformWs, PlatformURI, setTestOptions } from '../utils' +import { + PlatformUser, + PlatformUserSecond, + PlatformUserThird, + PlatformUserQara, + PlatformWs, + PlatformURI, + setTestOptions +} from '../utils' import { LoginPage } from '../model/login-page' import { SelectWorkspacePage } from '../model/select-workspace-page' diff --git a/qms-tests/sanity/tests/documents/ES-40.2.spec.ts b/qms-tests/sanity/tests/documents/ES-40.2.spec.ts index 7fe90a8dc3b..7963a300e8c 100644 --- a/qms-tests/sanity/tests/documents/ES-40.2.spec.ts +++ b/qms-tests/sanity/tests/documents/ES-40.2.spec.ts @@ -11,24 +11,20 @@ test.describe('login test', () => { }) test('check login', async () => { - await loginPage.clickOnLoginWithPassword() await loginPage.login(PlatformUser, '1234') }) test('TESTS-392 - As a non workspace user account I cannot log into TraceX', async () => { - await loginPage.clickOnLoginWithPassword() await loginPage.login('Wrong User', 'Wrong password') await loginPage.checkIfErrorMessageIsShown('Account not found or the provided credentials are incorrect') }) test('TESTS-396 - Correct email and wrong password: I cannot log in', async () => { - await loginPage.clickOnLoginWithPassword() await loginPage.login(PlatformUser, 'Wrong password') await loginPage.checkIfErrorMessageIsShown('Account not found or the provided credentials are incorrect') }) test('TESTS-397 - Wrong email and correct password: I cannot log in', async () => { - await loginPage.clickOnLoginWithPassword() await loginPage.login('Wrong User', '1234') await loginPage.checkIfErrorMessageIsShown('Account not found or the provided credentials are incorrect') }) diff --git a/qms-tests/sanity/tests/documents/ES-40.spec.ts b/qms-tests/sanity/tests/documents/ES-40.spec.ts index 3a64287fd15..bd7a0ceaf49 100644 --- a/qms-tests/sanity/tests/documents/ES-40.spec.ts +++ b/qms-tests/sanity/tests/documents/ES-40.spec.ts @@ -1,8 +1,18 @@ import { test } from '@playwright/test' -import { attachScreenshot, HomepageURI, PlatformSettingSecond, PlatformURI, waitForNetworIdle } from '../utils' +import { + attachScreenshot, + getNewPage, + HomepageURI, + PlatformSettingSecond, + PlatformURI, + PlatformWs, + waitForNetworIdle +} from '../utils' import { allure } from 'allure-playwright' import { DocumentContentPage } from '../model/documents/document-content-page' import { faker } from '@faker-js/faker' +import { LoginPage } from '../model/login-page' +import { SelectWorkspacePage } from '../model/select-workspace-page' test.use({ storageState: PlatformSettingSecond @@ -35,11 +45,24 @@ test.describe('ISO 13485, 4.2.4 Control of documents ensure that documents of ex }) }) - test('TESTS-388. As a workspace owner, I can remove a user from workspace', async ({ page }) => { + test('TESTS-388. As a workspace owner, I can remove a user from workspace', async ({ page, browser }) => { await allure.description( 'Requirement\nUser is not a part of space members and cannot see or edit any document from that space' ) await allure.tms('TESTS-388', 'https://tracex.hc.engineering/workbench/platform/tracker/TESTS-388') + + await test.step('1. login with new user so employee is created', async () => { + const anotherPage = await getNewPage(browser) + const loginPage = new LoginPage(anotherPage) + await loginPage.goto() + await loginPage.login('user4', '1234') + const swp = new SelectWorkspacePage(anotherPage) + await swp.selectWorkspace(PlatformWs) + await page.waitForURL((url) => { + return url.pathname.startsWith(`/workbench/${PlatformWs}/`) + }) + }) + await test.step('2. check if owner can kick user from workspace', async () => { const documentContentPage = new DocumentContentPage(page) await documentContentPage.clickContacts() diff --git a/qms-tests/sanity/tests/login/registration.spec.ts b/qms-tests/sanity/tests/login/registration.spec.ts index 61ce18ecf89..7091c1dc331 100644 --- a/qms-tests/sanity/tests/login/registration.spec.ts +++ b/qms-tests/sanity/tests/login/registration.spec.ts @@ -82,7 +82,6 @@ test.describe('Registration tests', () => { await allure.tms('TESTS-396', 'https://front.hc.engineering/workbench/platform/tracker/TESTS-396') await test.step('1. Try to login with wrong password', async () => { const loginPage = new LoginPage(page) - await loginPage.loginWithPassword.click() await loginPage.login('user1', 'wrongPassword') await loginPage.checkIfUserIsLoggedIn('wrong-password') }) @@ -94,7 +93,6 @@ test.describe('Registration tests', () => { await allure.tms('TESTS-397', 'https://front.hc.engineering/workbench/platform/tracker/TESTS-397') await test.step('1. Try to login with wrong email', async () => { const loginPage = new LoginPage(page) - await loginPage.loginWithPassword.click() await loginPage.login('wrongEmail', '1234') await loginPage.checkIfUserIsLoggedIn('wrong-email') }) @@ -106,7 +104,6 @@ test.describe('Registration tests', () => { await allure.tms('TESTS-398', 'https://front.hc.engineering/workbench/platform/tracker/TESTS-397') await test.step('1. Try to login with working credentials', async () => { const loginPage = new LoginPage(page) - await loginPage.loginWithPassword.click() await loginPage.login('user1', '1234') await loginPage.checkIfUserIsLoggedIn('correct-credentials') }) diff --git a/qms-tests/sanity/tests/model/login-page.ts b/qms-tests/sanity/tests/model/login-page.ts index 78992a6c80a..03c4d4b2272 100644 --- a/qms-tests/sanity/tests/model/login-page.ts +++ b/qms-tests/sanity/tests/model/login-page.ts @@ -37,10 +37,6 @@ export class LoginPage { } } - async clickOnLoginWithPassword (): Promise { - await this.loginWithPassword.click() - } - async checkIfUserIsLoggedIn (credentials: string): Promise { if (credentials === 'wrong-email' || credentials === 'wrong-password') { await expect(this.buttonLogin).toBeVisible() diff --git a/qms-tests/sanity/tests/utils.ts b/qms-tests/sanity/tests/utils.ts index 41d3fbc0ada..89a55f6d5df 100644 --- a/qms-tests/sanity/tests/utils.ts +++ b/qms-tests/sanity/tests/utils.ts @@ -57,6 +57,11 @@ export async function getSecondPage (browser: Browser): Promise { return await userSecondContext.newPage() } +export async function getNewPage (browser: Browser): Promise { + const context = await browser.newContext({ storageState: undefined }) + return await context.newPage() +} + export function randomString (): string { return (Math.random() * 1000000).toString(36).replace('.', '') }