-
Notifications
You must be signed in to change notification settings - Fork 2.4k
test(teams): stop the teams landing from eating the test budget #31932
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
14d4f7e
b4d8751
7f83de1
4d5c334
ec74776
26dc0b9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,8 +12,8 @@ | |
| */ | ||
| import { expect, test } from '@playwright/test'; | ||
| import { PLAYWRIGHT_BASIC_TEST_TAG_OBJ } from '../../constant/config'; | ||
| import { GlobalSettingOptions } from '../../constant/settings'; | ||
| import { | ||
| createNewPage, | ||
| redirectToHomePage, | ||
| toastNotification, | ||
| uuid, | ||
|
|
@@ -23,9 +23,11 @@ import { | |
| dragAndDropElement, | ||
| openDragDropDropdown, | ||
| } from '../../utils/dragDrop'; | ||
| import { waitForAllLoadersToDisappear } from '../../utils/entity'; | ||
| import { settingClick } from '../../utils/sidebar'; | ||
| import { addTeamHierarchy } from '../../utils/team'; | ||
| import { | ||
| addTeamHierarchy, | ||
| hardDeleteTeamByName, | ||
| visitTeamsPage, | ||
| } from '../../utils/team'; | ||
|
|
||
| // use the admin user to login | ||
| test.use({ storageState: 'playwright/.auth/admin.json' }); | ||
|
|
@@ -89,28 +91,32 @@ test.describe( | |
| 'Teams drag and drop should work properly', | ||
| PLAYWRIGHT_BASIC_TEST_TAG_OBJ, | ||
| () => { | ||
| // Every test re-enters Settings > Teams, and that landing waits on the | ||
| // hierarchy table's asset-count aggregation, which grows with the catalog. | ||
| // On a long-lived deployment the hook alone can outlast the 60s default. | ||
| test.slow(true); | ||
|
|
||
| test.beforeEach(async ({ page }) => { | ||
| await redirectToHomePage(page); | ||
| await visitTeamsPage(page); | ||
| }); | ||
|
Comment on lines
94
to
+97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| const getOrganizationResponse = page.waitForResponse( | ||
| (response) => | ||
| response.url().includes('/api/v1/teams/name/') && | ||
| response.status() === 200 | ||
| ); | ||
| const permissionResponse = page.waitForResponse( | ||
| (response) => | ||
| response.url().includes('/api/v1/permissions/team/name/') && | ||
| response.status() === 200 | ||
| ); | ||
| test.afterAll(async ({ browser }) => { | ||
| const { apiContext, afterAction } = await createNewPage(browser); | ||
|
|
||
| for (const teamName of [ | ||
| teamNameBusiness, | ||
| teamNameDivision, | ||
| teamNameDepartment, | ||
| teamNameGroup, | ||
| ]) { | ||
| await hardDeleteTeamByName(apiContext, teamName); | ||
|
greptile-apps[bot] marked this conversation as resolved.
Outdated
|
||
| } | ||
|
|
||
| await settingClick(page, GlobalSettingOptions.TEAMS); | ||
| await permissionResponse; | ||
| await getOrganizationResponse; | ||
| await waitForAllLoadersToDisappear(page); | ||
| await afterAction(); | ||
| }); | ||
|
|
||
| test('Add teams in hierarchy', async ({ page }) => { | ||
| test.slow(); | ||
| for (const teamDetails of DRAG_AND_DROP_TEAM_DETAILS) { | ||
| await addTeamHierarchy(page, teamDetails); | ||
|
|
||
|
|
@@ -158,7 +164,6 @@ test.describe( | |
| test(`Should drag and drop on ${TEAM_TYPE_BY_NAME[droppableTeamName]} team type`, async ({ | ||
| page, | ||
| }) => { | ||
| test.slow(); | ||
| // Nested team will be shown once anything is moved under it | ||
| if (index !== 0) { | ||
| await openDragDropDropdown(page, teams[index - 1]); | ||
|
|
@@ -182,7 +187,6 @@ test.describe( | |
| } | ||
|
|
||
| test(`Should drag and drop team on table level`, async ({ page }) => { | ||
| test.slow(); | ||
| // Open department team dropdown as it is moved under it from last test | ||
| await openDragDropDropdown(page, teamNameDepartment); | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.