-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore!: Update private apps cap on Community Edition (#33399)
* chore!: update private apps cap on CE --------- Co-authored-by: Tasso <tasso.evangelista@rocket.chat>
- Loading branch information
Showing
24 changed files
with
172 additions
and
18 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
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
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
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,70 @@ | ||
import { IS_EE } from '../config/constants'; | ||
import { Users } from '../fixtures/userStates'; | ||
import { Marketplace } from '../page-objects'; | ||
import { expect, test } from '../utils/test'; | ||
|
||
test.use({ storageState: Users.admin.state }); | ||
|
||
test.describe.serial('Private apps upload', () => { | ||
let poMarketplace: Marketplace; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
poMarketplace = new Marketplace(page); | ||
|
||
await page.goto('/marketplace/private'); | ||
}); | ||
|
||
test.describe('Premium', () => { | ||
test.skip(!IS_EE, 'Premium Only'); | ||
|
||
test('expect to allow admin to upload a private app in EE, which should be enabled by default', async ({ page }) => { | ||
const fileChooserPromise = page.waitForEvent('filechooser'); | ||
|
||
await poMarketplace.btnUploadPrivateApp.click(); | ||
await expect(poMarketplace.btnInstallPrivateApp).toBeDisabled(); | ||
|
||
await poMarketplace.btnUploadPrivateAppFile.click(); | ||
const fileChooser = await fileChooserPromise; | ||
await fileChooser.setFiles('./tests/e2e/fixtures/files/test-app_0.0.1.zip'); | ||
|
||
await expect(poMarketplace.btnInstallPrivateApp).toBeEnabled(); | ||
await poMarketplace.btnInstallPrivateApp.click(); | ||
await page.getByRole('button', { name: 'Agree' }).click(); | ||
await expect(poMarketplace.appStatusTag).toHaveText('Enabled'); | ||
}); | ||
}); | ||
|
||
test.describe('Community Edition', () => { | ||
test.skip(IS_EE, 'CE Only'); | ||
|
||
test('expect to allow admin to upload a private app in CE, but it should be disabled by default', async ({ page }) => { | ||
const fileChooserPromise = page.waitForEvent('filechooser'); | ||
|
||
await poMarketplace.btnUploadPrivateApp.click(); | ||
await expect(poMarketplace.btnConfirmAppUploadModal).toBeEnabled(); | ||
await poMarketplace.btnConfirmAppUploadModal.click(); | ||
|
||
await expect(poMarketplace.btnInstallPrivateApp).toBeDisabled(); | ||
await poMarketplace.btnUploadPrivateAppFile.click(); | ||
const fileChooser = await fileChooserPromise; | ||
await fileChooser.setFiles('./tests/e2e/fixtures/files/test-app_0.0.1.zip'); | ||
|
||
await expect(poMarketplace.btnInstallPrivateApp).toBeEnabled(); | ||
await poMarketplace.btnInstallPrivateApp.click(); | ||
|
||
await expect(poMarketplace.confirmAppUploadModalTitle).toHaveText('Private apps limit reached'); | ||
await expect(poMarketplace.btnConfirmAppUploadModal).toBeEnabled(); | ||
await poMarketplace.btnConfirmAppUploadModal.click(); | ||
|
||
await page.getByRole('button', { name: 'Agree' }).click(); | ||
await expect(poMarketplace.appStatusTag).toHaveText('Disabled'); | ||
}); | ||
|
||
test('expect not to allow enabling a recently installed private app in CE', async () => { | ||
await poMarketplace.lastAppRow.click(); | ||
await expect(poMarketplace.appStatusTag).toHaveText('Disabled'); | ||
await poMarketplace.appMenu.click(); | ||
await expect(poMarketplace.btnEnableApp).toBeDisabled(); | ||
}); | ||
}); | ||
}); |
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
Binary file not shown.
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,45 @@ | ||
import type { Locator, Page } from '@playwright/test'; | ||
|
||
export class Marketplace { | ||
private readonly page: Page; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
} | ||
|
||
get btnUploadPrivateApp(): Locator { | ||
return this.page.locator('role=button[name="Upload private app"]'); | ||
} | ||
|
||
get btnInstallPrivateApp(): Locator { | ||
return this.page.locator('role=button[name="Install"]'); | ||
} | ||
|
||
get btnUploadPrivateAppFile(): Locator { | ||
return this.page.locator('role=button[name="Browse Files"]'); | ||
} | ||
|
||
get appStatusTag(): Locator { | ||
return this.page.locator('[data-qa-type="app-status-tag"]'); | ||
} | ||
|
||
get confirmAppUploadModalTitle(): Locator { | ||
return this.page.locator('[data-qa-id="confirm-app-upload-modal-title"]'); | ||
} | ||
|
||
get btnConfirmAppUploadModal(): Locator { | ||
return this.page.locator('role=button[name="Upload anyway"]'); | ||
} | ||
|
||
get lastAppRow(): Locator { | ||
return this.page.locator('[data-qa-type="app-row"]').last(); | ||
} | ||
|
||
get appMenu(): Locator { | ||
return this.page.getByTitle('More options'); | ||
} | ||
|
||
get btnEnableApp(): Locator { | ||
return this.page.getByRole('menuitem', { name: 'Enable' }); | ||
} | ||
} |
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
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
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
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
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
Oops, something went wrong.