mirror of https://github.com/nocodb/nocodb
Pranav C
3 months ago
10 changed files with 114 additions and 70 deletions
@ -1,65 +1,69 @@ |
|||||||
import { test } from '@playwright/test'; |
import { test } from '@playwright/test'; |
||||||
import { AccountPage } from '../../../pages/Account'; |
import { AccountPage } from '../../../pages/Account'; |
||||||
import { AccountSettingsPage } from '../../../pages/Account/Settings'; |
|
||||||
import { SignupPage } from '../../../pages/SignupPage'; |
|
||||||
import setup, { unsetup } from '../../../setup'; |
import setup, { unsetup } from '../../../setup'; |
||||||
import { getDefaultPwd } from '../../../tests/utils/general'; |
import { isEE } from '../../../setup/db'; |
||||||
|
import { AccountSetupPage } from '../../../pages/Account/Setup'; |
||||||
|
|
||||||
|
test.describe('App setup', () => { |
||||||
|
// Org level roles are not available in EE
|
||||||
|
if (isEE()) { |
||||||
|
test.skip(); |
||||||
|
} |
||||||
|
|
||||||
test.describe.only('App setup', () => { |
|
||||||
// hub will not have this feature
|
// hub will not have this feature
|
||||||
|
|
||||||
let accountSettingsPage: AccountSettingsPage; |
let accountSetupPage: AccountSetupPage; |
||||||
let accountPage: AccountPage; |
let accountPage: AccountPage; |
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
let context: any; |
let context: any; |
||||||
|
|
||||||
test.beforeEach(async ({ page }) => { |
test.beforeEach(async ({ page }) => { |
||||||
context = await setup({ page, isEmptyProject: true }); |
context = await setup({ page, isEmptyProject: true, isSuperUser: true, resetPlugins: true }); |
||||||
accountPage = new AccountPage(page); |
accountPage = new AccountPage(page); |
||||||
accountSettingsPage = accountPage.settings; |
accountSetupPage = accountPage.setup; |
||||||
}); |
}); |
||||||
|
|
||||||
test.afterEach(async () => { |
test.afterEach(async () => { |
||||||
await unsetup(context); |
await unsetup(context); |
||||||
}); |
}); |
||||||
|
|
||||||
test('Toggle invite only signup', async () => { |
test('Configure email settings', async () => { |
||||||
test.slow(); |
await accountSetupPage.goto(); |
||||||
|
await accountSetupPage.isConfigured('email', false); |
||||||
await accountSettingsPage.goto({ networkValidation: false }); |
await accountSetupPage.configure({ |
||||||
|
key: 'email', |
||||||
// enable invite only signup
|
plugin: 'SMTP', |
||||||
if (!(await accountSettingsPage.getInviteOnlyCheckboxValue())) { |
config: { |
||||||
await accountSettingsPage.toggleInviteOnlyCheckbox(); |
host: 'smtp.gmail.com', |
||||||
await accountSettingsPage.checkInviteOnlySignupCheckbox(true); |
port: 587, |
||||||
} |
username: 'test', |
||||||
|
password: 'test', |
||||||
await accountPage.signOut(); |
name: 'gmail.com', |
||||||
|
from: 'test@gmail.com', |
||||||
const signupPage = new SignupPage(accountPage.rootPage); |
}, |
||||||
await signupPage.goto(); |
|
||||||
|
|
||||||
await signupPage.signUp({ |
|
||||||
email: 'test-user-1@nocodb.com', |
|
||||||
password: getDefaultPwd(), |
|
||||||
expectedError: 'Not allowed to signup, contact super admin.', |
|
||||||
}); |
}); |
||||||
|
await accountSetupPage.goto(); |
||||||
|
await accountSetupPage.isConfigured('email', true); |
||||||
|
await accountSetupPage.resetConfig({ |
||||||
|
key: 'email', |
||||||
|
plugin: 'SMTP', |
||||||
|
}); |
||||||
|
}); |
||||||
|
|
||||||
await signupPage.rootPage.reload({ waitUntil: 'load' }); |
test('Configure storage settings', async () => { |
||||||
|
await accountSetupPage.goto(); |
||||||
await accountSettingsPage.goto({ networkValidation: false }); |
await accountSetupPage.isConfigured('storage', false); |
||||||
|
await accountSetupPage.configure({ |
||||||
await accountSettingsPage.checkInviteOnlySignupCheckbox(true); |
key: 'storage', |
||||||
await accountSettingsPage.toggleInviteOnlyCheckbox(); |
plugin: 'S3', |
||||||
await accountSettingsPage.checkInviteOnlySignupCheckbox(false); |
config: { |
||||||
|
bucket: 'test', |
||||||
await accountPage.signOut(); |
region: 'us-east-1', |
||||||
|
access_key: 'test', |
||||||
await signupPage.goto(); |
access_secret: 'test', |
||||||
|
}, |
||||||
await signupPage.signUp({ |
|
||||||
email: 'test-user-1@nocodb.com', |
|
||||||
password: getDefaultPwd(), |
|
||||||
}); |
}); |
||||||
|
await accountSetupPage.goto(); |
||||||
|
await accountSetupPage.isConfigured('storage', true); |
||||||
}); |
}); |
||||||
}); |
}); |
||||||
|
Loading…
Reference in new issue