mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Added Playwright test for invite only sites
refs https://github.com/TryGhost/Team/issues/2371 Tests if an invite only site disables sign up.
This commit is contained in:
parent
f5aae1e2c5
commit
6af149120a
1 changed files with 31 additions and 0 deletions
31
ghost/core/test/e2e-browser/admin/site-settings.spec.js
Normal file
31
ghost/core/test/e2e-browser/admin/site-settings.spec.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
const {expect, test} = require('@playwright/test');
|
||||
|
||||
const changeSubscriptionAccess = async (page, access) => {
|
||||
await page.locator('[data-test-nav="settings"]').click();
|
||||
await page.locator('[data-test-nav="members-membership"]').click();
|
||||
|
||||
// click data-test-members-subscription-option="all"
|
||||
await page.locator('[data-test-members-subscription-option="all"]').click();
|
||||
await page.locator(`[data-test-members-subscription-option="${access}"]`).click();
|
||||
|
||||
// save
|
||||
await page.locator('[data-test-button="save-settings"]').click();
|
||||
};
|
||||
|
||||
test.describe('Site Settings', () => {
|
||||
test.describe('Subscription Access', () => {
|
||||
test('Invite only', async ({page}) => {
|
||||
await page.goto('/ghost');
|
||||
|
||||
await changeSubscriptionAccess(page, 'invite');
|
||||
|
||||
// Go to the sigup page
|
||||
await page.goto('/#/portal/signup');
|
||||
|
||||
const portalFrame = page.frameLocator('#ghost-portal-root div iframe');
|
||||
|
||||
// Check sign up is disabled and a message is shown
|
||||
await expect(portalFrame.locator('.gh-portal-invite-only-notification')).toHaveText('This site is invite-only, contact the owner for access.');
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Add table
Reference in a new issue