-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Chore: Create teams management tests #26578
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8c2f4e6
test: create teams management tests
a588772
fix: apply eslint:fix
148d37f
Merge branch 'develop' into test/teams-management
cfe258e
fix: more specific selector
6fc864d
Merge branch 'develop' into test/teams-management
kodiakhq[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
apps/meteor/tests/e2e/page-objects/fragments/home-flextab-channels.ts
This file contains hidden or 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,21 @@ | ||
| import type { Locator, Page } from '@playwright/test'; | ||
|
|
||
| export class HomeFlextabChannels { | ||
| private readonly page: Page; | ||
|
|
||
| constructor(page: Page) { | ||
| this.page = page; | ||
| } | ||
|
|
||
| get btnAddExisting(): Locator { | ||
| return this.page.locator('button >> text="Add Existing"'); | ||
| } | ||
|
|
||
| get inputChannels(): Locator { | ||
| return this.page.locator('#modal-root input').first(); | ||
souzaramon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| get btnAdd(): Locator { | ||
| return this.page.locator('#modal-root button:has-text("Add")'); | ||
souzaramon marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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,33 @@ | ||
| import type { Locator, Page } from '@playwright/test'; | ||
|
|
||
| import { HomeContent, HomeSidenav, HomeFlextab } from './fragments'; | ||
|
|
||
| export class HomeTeam { | ||
| private readonly page: Page; | ||
|
|
||
| readonly content: HomeContent; | ||
|
|
||
| readonly sidenav: HomeSidenav; | ||
|
|
||
| readonly tabs: HomeFlextab; | ||
|
|
||
| constructor(page: Page) { | ||
| this.page = page; | ||
| this.content = new HomeContent(page); | ||
| this.sidenav = new HomeSidenav(page); | ||
| this.tabs = new HomeFlextab(page); | ||
| } | ||
|
|
||
| get inputTeamName(): Locator { | ||
| return this.page.locator('.rcx-field-group__item:nth-child(1) input'); | ||
| } | ||
|
|
||
| async addMember(memberName: string): Promise<void> { | ||
| await this.page.locator('.rcx-field-group__item:nth-child(7) input').type(memberName, { delay: 100 }); | ||
| await this.page.locator(`.rcx-option__content:has-text("${memberName}")`).click(); | ||
| } | ||
|
|
||
| get btnTeamCreate(): Locator { | ||
| return this.page.locator('#modal-root button:has-text("Create")'); | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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,68 @@ | ||
| import { faker } from '@faker-js/faker'; | ||
|
|
||
| import { test, expect } from './utils/test'; | ||
| import { createTargetChannel } from './utils'; | ||
| import { HomeTeam } from './page-objects'; | ||
|
|
||
| test.use({ storageState: 'admin-session.json' }); | ||
|
|
||
| test.describe.serial('teams-management', () => { | ||
| let poHomeTeam: HomeTeam; | ||
| let targetChannel: string; | ||
| const targetTeam = faker.datatype.uuid(); | ||
|
|
||
| test.beforeAll(async ({ api }) => { | ||
| targetChannel = await createTargetChannel(api); | ||
| }); | ||
|
|
||
| test.beforeEach(async ({ page }) => { | ||
| poHomeTeam = new HomeTeam(page); | ||
|
|
||
| await page.goto('/home'); | ||
| }); | ||
|
|
||
| test('expect create "targetTeam"', async ({ page }) => { | ||
| await poHomeTeam.sidenav.openNewByLabel('Team'); | ||
| await poHomeTeam.inputTeamName.type(targetTeam); | ||
| await poHomeTeam.addMember('user1'); | ||
| await poHomeTeam.btnTeamCreate.click(); | ||
|
|
||
| await expect(page).toHaveURL(`/group/${targetTeam}`); | ||
| }); | ||
|
|
||
| test('expect throw validation error if team name already exists', async () => { | ||
| await poHomeTeam.sidenav.openNewByLabel('Team'); | ||
| await poHomeTeam.inputTeamName.type(targetTeam); | ||
|
|
||
| await expect(poHomeTeam.btnTeamCreate).toBeDisabled(); | ||
| }); | ||
|
|
||
| test('expect send hello in the "targetTeam" and reply in a thread', async ({ page }) => { | ||
| await poHomeTeam.sidenav.openChat(targetTeam); | ||
| await poHomeTeam.content.sendMessage('hello'); | ||
| await poHomeTeam.content.openLastMessageMenu(); | ||
|
|
||
| await page.locator('[data-qa-id="reply-in-thread"]').click(); | ||
| await page.locator('.rcx-vertical-bar .js-input-message').type('any-reply-message'); | ||
| await page.keyboard.press('Enter'); | ||
|
|
||
| await expect(poHomeTeam.tabs.flexTabViewThreadMessage).toHaveText('any-reply-message'); | ||
| }); | ||
|
|
||
| test('expect set "targetTeam" as readonly', async () => { | ||
| await poHomeTeam.sidenav.openChat(targetTeam); | ||
| await poHomeTeam.tabs.btnRoomInfo.click(); | ||
| await poHomeTeam.tabs.room.btnEdit.click(); | ||
| await poHomeTeam.tabs.room.checkboxReadOnly.click(); | ||
| await poHomeTeam.tabs.room.btnSave.click(); | ||
| }); | ||
|
|
||
| test('expect insert a channel inside "targetTeam"', async ({ page }) => { | ||
| await poHomeTeam.sidenav.openChat(targetTeam); | ||
| await poHomeTeam.tabs.btnChannels.click(); | ||
| await poHomeTeam.tabs.channels.btnAddExisting.click(); | ||
| await poHomeTeam.tabs.channels.inputChannels.type(targetChannel, { delay: 100 }); | ||
| await page.locator(`.rcx-option__content:has-text("${targetChannel}")`).click(); | ||
| await poHomeTeam.tabs.channels.btnAdd.click(); | ||
| }); | ||
| }); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.