-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TSK-1047: Fix showing requests after moving staff to another departme…
…nt (#3029) Signed-off-by: Vyacheslav Tumanov <me@slavatumanov.me>
- Loading branch information
Showing
2 changed files
with
82 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
import { expect, Page, test } from '@playwright/test' | ||
import { PlatformSetting, PlatformURI } from './utils' | ||
|
||
test.use({ | ||
storageState: PlatformSetting | ||
}) | ||
|
||
export async function createDepartment (page: Page, departmentName: string): Promise<void> { | ||
await page.click('text=Structure Department Organization no employees >> button >> nth=1') | ||
const departmentNameField = page.locator('[placeholder="Department"]') | ||
await departmentNameField.click() | ||
await departmentNameField.fill(departmentName) | ||
await page.locator('.antiCard button:has-text("Create")').click() | ||
await page.waitForSelector('form.antiCard', { state: 'detached' }) | ||
} | ||
|
||
test.describe('hr tests', () => { | ||
test.beforeEach(async ({ page }) => { | ||
// Create user and workspace | ||
await (await page.goto(`${PlatformURI}/workbench/sanity-ws`))?.finished() | ||
}) | ||
|
||
test('test-pto-after-department-change', async ({ page, context }) => { | ||
await page.locator('[id="app-hr\\:string\\:HRApplication"]').click() | ||
await page.click('text="Structure"') | ||
const department1 = 'dep1' | ||
const department2 = 'dep2' | ||
await createDepartment(page, department1) | ||
await createDepartment(page, department2) | ||
|
||
// Click .ml-8 > div > div > .flex-between >> nth=0 | ||
await page.locator('.ml-8 > div > div > .flex-between').first().click() | ||
|
||
// Click [id="hr\:string\:AddEmployee"] | ||
await page.locator('[id="hr\\:string\\:AddEmployee"]').click() | ||
|
||
// Click button:has-text("Appleseed John") | ||
await page.locator('button:has-text("Appleseed John")').click() | ||
|
||
// Click text=Schedule | ||
await page.locator('text=Schedule').click() | ||
|
||
// Click td:nth-child(15) > .h-full | ||
await page.locator('td:nth-child(15) > .h-full').click() | ||
|
||
// Click button:has-text("Vacation") | ||
await page.locator('button:has-text("Vacation")').click() | ||
|
||
// Click button:has-text("PTO") >> nth=0 | ||
await page.locator('button:has-text("Remote")').first().click() | ||
|
||
// Click button:has-text("Create") | ||
await page.locator('button:has-text("Create")').click() | ||
await page.waitForSelector('form.antiCard', { state: 'detached' }) | ||
|
||
// Click text=Structure | ||
await page.locator('text=Structure').click() | ||
|
||
// Click div:nth-child(3) > div > .flex-between | ||
await page.locator('div:nth-child(3) > div > .flex-between').click() | ||
|
||
// Click [id="hr\:string\:AddEmployee"] | ||
await page.locator('[id="hr\\:string\\:AddEmployee"]').click() | ||
|
||
// Click button:has-text("Appleseed John") | ||
await page.locator('button:has-text("Appleseed John")').click() | ||
|
||
// Click button:has-text("Ok") | ||
await page.locator('button:has-text("Ok")').click() | ||
await page.waitForSelector('form.antiCard', { state: 'detached' }) | ||
|
||
// Click text=Schedule | ||
await page.locator('text=Schedule').click() | ||
await expect(await page.locator('td:nth-child(15) > .h-full .request')).toHaveCSS('opacity', '0.5') | ||
}) | ||
}) |