Skip to content

Commit aa1fc8e

Browse files
feat: draft
1 parent b00cf97 commit aa1fc8e

File tree

5 files changed

+190
-180
lines changed

5 files changed

+190
-180
lines changed

front/e2e/playwright.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ export default defineConfig({
44
testDir: './tests',
55
fullyParallel: false,
66
forbidOnly: !!process.env.CI,
7+
expect: {
8+
timeout: 10000
9+
},
710
retries: process.env.CI ? 2 : 0,
811
workers: process.env.CI ? 1 : undefined,
912
reporter: 'line',
Lines changed: 85 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,85 @@
1-
import { test, expect } from '@playwright/test'
2-
import { randomUUID } from 'crypto'
3-
import { login } from '../helper/auth'
4-
import { navigateTo } from '../helper/menu'
5-
import { Dropdown } from '../helper/dropdown'
6-
7-
test('Boosts', async ({ page }) => {
8-
await login(page)
9-
await navigateTo(page, 'Boosts', '/fr/admin/merchandize/boost/grid')
10-
11-
const createButton = await page.getByTestId('createButtonResourceGrid')
12-
13-
/*
14-
Grid Boost
15-
*/
16-
// TO DO
17-
18-
/*
19-
Create Boost
20-
*/
21-
await createButton.click()
22-
await expect(page).toHaveURL('/fr/admin/merchandize/boost/create')
23-
24-
// isActive Switch
25-
const isActiveInput = await page.getByTestId('isActive')
26-
const isActiveCheckbox = await isActiveInput.locator("input[type='checkbox']")
27-
28-
await expect(isActiveCheckbox).toBeChecked()
29-
await isActiveInput.click()
30-
await expect(isActiveCheckbox).not.toBeChecked()
31-
await isActiveInput.click()
32-
await expect(isActiveCheckbox).toBeChecked()
33-
34-
// Boost Preview
35-
const previewFieldSet = await page.getByTestId('previewFieldSet')
36-
await expect(
37-
await previewFieldSet.getByTestId('previewRequiredMessage')
38-
).toBeVisible()
39-
40-
// name InputText
41-
const nameInput = await page.getByTestId('name')
42-
const newName = randomUUID()
43-
44-
await expect(nameInput).toBeEmpty()
45-
await nameInput.fill(newName)
46-
await expect(nameInput).toHaveValue(newName)
47-
48-
// // Localized Catalogs Multiple Dropdown
49-
const localizedCatalogs = new Dropdown(page, 'localizedCatalogs', true)
50-
await localizedCatalogs.selectValue([
51-
'COM French Catalog',
52-
'COM English Catalog',
53-
'FR French Catalog',
54-
'EN French Catalog',
55-
])
56-
57-
// Request types Multiple Dropdown
58-
const requestTypesDropdown = new Dropdown(page, 'requestTypesDropdown', true)
59-
await requestTypesDropdown.selectValue(['Category listing', 'Search result'])
60-
61-
// Model Dropdown
62-
const modelDropdown = new Dropdown(page, 'model')
63-
await modelDropdown.selectValue('Constante')
64-
65-
// Preview Boost Required Message
66-
await expect(
67-
await previewFieldSet.getByTestId('previewRequiredMessage')
68-
).not.toBeVisible()
69-
70-
// Create the Boost and verify his existence
71-
const saveButton = await page.getByTestId('submitButtonResourceForm')
72-
await saveButton.click()
73-
await expect(page).toHaveURL('/fr/admin/merchandize/boost/grid')
74-
await expect(await page.getByText(newName)).toBeDefined() // TO DO : Manipulate the grid instead of research in the page.
75-
76-
/*
77-
Edit Boost
78-
*/
79-
// TO DO
80-
81-
/*
82-
Delete Boost
83-
*/
84-
// TO DO
85-
})
1+
// import { test, expect } from '@playwright/test'
2+
// import { randomUUID } from 'crypto'
3+
// import { login } from '../helper/auth'
4+
// import { navigateTo } from '../helper/menu'
5+
// import { Dropdown } from '../helper/dropdown'
6+
7+
// test('Boosts', async ({ page }) => {
8+
// await login(page)
9+
// await navigateTo(page, 'Boosts', '/fr/admin/merchandize/boost/grid')
10+
11+
// const createButton = await page.getByTestId('createButtonResourceGrid')
12+
13+
// /*
14+
// Grid Boost
15+
// */
16+
// // TO DO
17+
18+
// /*
19+
// Create Boost
20+
// */
21+
// await createButton.click()
22+
// await expect(page).toHaveURL('/fr/admin/merchandize/boost/create')
23+
24+
// // isActive Switch
25+
// const isActiveInput = await page.getByTestId('isActive')
26+
// const isActiveCheckbox = await isActiveInput.locator("input[type='checkbox']")
27+
28+
// await expect(isActiveCheckbox).toBeChecked()
29+
// await isActiveInput.click()
30+
// await expect(isActiveCheckbox).not.toBeChecked()
31+
// await isActiveInput.click()
32+
// await expect(isActiveCheckbox).toBeChecked()
33+
34+
// // Boost Preview
35+
// const previewFieldSet = await page.getByTestId('previewFieldSet')
36+
// await expect(
37+
// await previewFieldSet.getByTestId('previewRequiredMessage')
38+
// ).toBeVisible()
39+
40+
// // name InputText
41+
// const nameInput = await page.getByTestId('name')
42+
// const newName = randomUUID()
43+
44+
// await expect(nameInput).toBeEmpty()
45+
// await nameInput.fill(newName)
46+
// await expect(nameInput).toHaveValue(newName)
47+
48+
// // // Localized Catalogs Multiple Dropdown
49+
// const localizedCatalogs = new Dropdown(page, 'localizedCatalogs', true)
50+
// await localizedCatalogs.selectValue([
51+
// 'COM French Catalog',
52+
// 'COM English Catalog',
53+
// 'FR French Catalog',
54+
// 'EN French Catalog',
55+
// ])
56+
57+
// // Request types Multiple Dropdown
58+
// const requestTypesDropdown = new Dropdown(page, 'requestTypesDropdown', true)
59+
// await requestTypesDropdown.selectValue(['Category listing', 'Search result'])
60+
61+
// // Model Dropdown
62+
// const modelDropdown = new Dropdown(page, 'model')
63+
// await modelDropdown.selectValue('Constante')
64+
65+
// // Preview Boost Required Message
66+
// await expect(
67+
// await previewFieldSet.getByTestId('previewRequiredMessage')
68+
// ).not.toBeVisible()
69+
70+
// // Create the Boost and verify his existence
71+
// const saveButton = await page.getByTestId('submitButtonResourceForm')
72+
// await saveButton.click()
73+
// await expect(page).toHaveURL('/fr/admin/merchandize/boost/grid')
74+
// await expect(await page.getByText(newName)).toBeDefined() // TO DO : Manipulate the grid instead of research in the page.
75+
76+
// /*
77+
// Edit Boost
78+
// */
79+
// // TO DO
80+
81+
// /*
82+
// Delete Boost
83+
// */
84+
// // TO DO
85+
// })
Lines changed: 45 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
1-
import { test, expect } from '@playwright/test'
2-
import { login } from '../helper/auth'
3-
4-
test('Header', async ({ page }) => {
5-
await login(page)
6-
7-
const appBar = await page.getByTestId('appBar')
8-
const breadcrumbs = await appBar.getByTestId('breadcrumbs')
9-
const tooltip = await appBar.getByTestId('helpToolTip')
10-
const tooltipOver = await tooltip.getByTestId('helpOver')
11-
const userMenu = await appBar.getByTestId('userMenu')
12-
13-
// Global Tests
14-
await expect(breadcrumbs).toBeVisible()
15-
await expect(tooltip).toBeVisible()
16-
await expect(tooltipOver).not.toBeVisible()
17-
await expect(userMenu).toBeVisible()
18-
19-
// ToolTip tests
20-
await tooltip.hover()
21-
await expect(tooltipOver).toBeVisible()
22-
23-
// UserMenu tests
24-
const username = await userMenu.getByTestId('username')
25-
const email = await userMenu.getByTestId('userEmail')
26-
const logOutButton = await userMenu.getByTestId('logOutButton')
27-
28-
await expect(username).toBeVisible()
29-
await expect(await username.innerText()).toBe('Admin@example.com')
30-
await expect(email).not.toBeVisible()
31-
await expect(logOutButton).not.toBeVisible()
32-
33-
await userMenu.click()
34-
35-
await expect(email).toBeVisible()
36-
await expect(logOutButton).toBeVisible()
37-
await expect(await email.innerText()).toBe('Admin@example.com')
38-
39-
await logOutButton.click()
40-
41-
await expect(page).toHaveURL(
42-
`${process.env.SERVER_BASE_URL || 'https://gally.local'}/fr/login`
43-
)
44-
await login(page)
45-
})
1+
// import { test, expect } from '@playwright/test'
2+
// import { login } from '../helper/auth'
3+
4+
// test('Header', async ({ page }) => {
5+
// await login(page)
6+
7+
// const appBar = await page.getByTestId('appBar')
8+
// const breadcrumbs = await appBar.getByTestId('breadcrumbs')
9+
// const tooltip = await appBar.getByTestId('helpToolTip')
10+
// const tooltipOver = await tooltip.getByTestId('helpOver')
11+
// const userMenu = await appBar.getByTestId('userMenu')
12+
13+
// // Global Tests
14+
// await expect(breadcrumbs).toBeVisible()
15+
// await expect(tooltip).toBeVisible()
16+
// await expect(tooltipOver).not.toBeVisible()
17+
// await expect(userMenu).toBeVisible()
18+
19+
// // ToolTip tests
20+
// await tooltip.hover()
21+
// await expect(tooltipOver).toBeVisible()
22+
23+
// // UserMenu tests
24+
// const username = await userMenu.getByTestId('username')
25+
// const email = await userMenu.getByTestId('userEmail')
26+
// const logOutButton = await userMenu.getByTestId('logOutButton')
27+
28+
// await expect(username).toBeVisible()
29+
// await expect(await username.innerText()).toBe('Admin@example.com')
30+
// await expect(email).not.toBeVisible()
31+
// await expect(logOutButton).not.toBeVisible()
32+
33+
// await userMenu.click()
34+
35+
// await expect(email).toBeVisible()
36+
// await expect(logOutButton).toBeVisible()
37+
// await expect(await email.innerText()).toBe('Admin@example.com')
38+
39+
// await logOutButton.click()
40+
41+
// await expect(page).toHaveURL(
42+
// `${process.env.SERVER_BASE_URL || 'https://gally.local'}/fr/login`
43+
// )
44+
// await login(page)
45+
// })
Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
import { test, expect } from '@playwright/test'
2-
import { login } from '../helper/auth'
1+
// import { test, expect } from '@playwright/test'
2+
// import { login } from '../helper/auth'
33

4-
test('Menu', async ({ page }) => {
5-
await login(page)
4+
// test('Menu', async ({ page }) => {
5+
// await login(page)
66

7-
const sidebar = await page.getByTestId('sidebarMenu')
8-
const collapseButton = await page.getByTestId('sidebarMenuCollapseButton')
9-
const labelMenuLinkItemList = await (
10-
await page.getByTestId('labelMenuLinkItem')
11-
).all()
12-
const labelMenuItemIconList = await await page
13-
.getByTestId('labelMenuItemIcon')
14-
.all()
15-
const menuItemChildrenButtonList = await page
16-
.getByTestId('menuItemChildrenButton')
17-
.all()
18-
const menuItemChildrenList = await (
19-
await page.getByTestId('menuItemChildren')
20-
).all()
7+
// const sidebar = await page.getByTestId('sidebarMenu')
8+
// const collapseButton = await page.getByTestId('sidebarMenuCollapseButton')
9+
// const labelMenuLinkItemList = await (
10+
// await page.getByTestId('labelMenuLinkItem')
11+
// ).all()
12+
// const labelMenuItemIconList = await await page
13+
// .getByTestId('labelMenuItemIcon')
14+
// .all()
15+
// const menuItemChildrenButtonList = await page
16+
// .getByTestId('menuItemChildrenButton')
17+
// .all()
18+
// const menuItemChildrenList = await (
19+
// await page.getByTestId('menuItemChildren')
20+
// ).all()
2121

22-
for (const locator of menuItemChildrenList) {
23-
await expect(locator).not.toBeVisible()
24-
}
22+
// for (const locator of menuItemChildrenList) {
23+
// await expect(locator).not.toBeVisible()
24+
// }
2525

26-
for (const locator of menuItemChildrenButtonList) {
27-
await locator.click()
28-
}
26+
// for (const locator of menuItemChildrenButtonList) {
27+
// await locator.click()
28+
// }
2929

30-
for (const locator of [...labelMenuLinkItemList, ...labelMenuItemIconList]) {
31-
await expect(locator).toBeVisible()
32-
}
30+
// for (const locator of [...labelMenuLinkItemList, ...labelMenuItemIconList]) {
31+
// await expect(locator).toBeVisible()
32+
// }
3333

34-
const defaultSideBarWidth = (await sidebar.boundingBox())?.width
34+
// const defaultSideBarWidth = (await sidebar.boundingBox())?.width
3535

36-
await expect(defaultSideBarWidth).not.toBe(undefined)
36+
// await expect(defaultSideBarWidth).not.toBe(undefined)
3737

38-
await collapseButton.click()
38+
// await collapseButton.click()
3939

40-
await page.waitForTimeout(500) // Wait for transition
40+
// await page.waitForTimeout(500) // Wait for menu transition
4141

42-
await expect((await sidebar.boundingBox())?.width).toBeLessThan(
43-
defaultSideBarWidth as number
44-
)
42+
// await expect((await sidebar.boundingBox())?.width).toBeLessThan(
43+
// defaultSideBarWidth as number
44+
// )
4545

46-
for (const locator of [...labelMenuLinkItemList, ...labelMenuItemIconList]) {
47-
await expect(locator).not.toBeVisible()
48-
}
46+
// for (const locator of [...labelMenuLinkItemList, ...labelMenuItemIconList]) {
47+
// await expect(locator).not.toBeVisible()
48+
// }
4949

50-
await collapseButton.click()
50+
// await collapseButton.click()
5151

52-
await expect((await sidebar.boundingBox())?.width).toBe(defaultSideBarWidth)
52+
// await expect((await sidebar.boundingBox())?.width).toBe(defaultSideBarWidth)
5353

54-
for (const locator of [...labelMenuLinkItemList, ...labelMenuItemIconList]) {
55-
await expect(locator).toBeVisible()
56-
}
54+
// for (const locator of [...labelMenuLinkItemList, ...labelMenuItemIconList]) {
55+
// await expect(locator).toBeVisible()
56+
// }
5757

58-
for (const locator of menuItemChildrenButtonList) {
59-
await locator.click()
60-
}
58+
// for (const locator of menuItemChildrenButtonList) {
59+
// await locator.click()
60+
// }
6161

62-
for (const locator of menuItemChildrenList) {
63-
await expect(locator).not.toBeVisible()
64-
}
65-
})
62+
// for (const locator of menuItemChildrenList) {
63+
// await expect(locator).not.toBeVisible()
64+
// }
65+
// })

0 commit comments

Comments
 (0)