|
|
|
@ -3,11 +3,13 @@ import { DashboardPage } from '../pages/Dashboard';
|
|
|
|
|
import setup from '../setup'; |
|
|
|
|
import { ToolbarPage } from '../pages/Dashboard/common/Toolbar'; |
|
|
|
|
import { ProjectsPage } from '../pages/ProjectsPage'; |
|
|
|
|
import { Api } from 'nocodb-sdk'; |
|
|
|
|
|
|
|
|
|
test.describe('Project operations', () => { |
|
|
|
|
let dashboard: DashboardPage; |
|
|
|
|
let toolbar: ToolbarPage; |
|
|
|
|
let context: any; |
|
|
|
|
let api: Api<any>; |
|
|
|
|
let projectPage: ProjectsPage; |
|
|
|
|
|
|
|
|
|
test.beforeEach(async ({ page }) => { |
|
|
|
@ -15,9 +17,28 @@ test.describe('Project operations', () => {
|
|
|
|
|
dashboard = new DashboardPage(page, context.project); |
|
|
|
|
projectPage = new ProjectsPage(page); |
|
|
|
|
toolbar = dashboard.grid.toolbar; |
|
|
|
|
|
|
|
|
|
api = new Api({ |
|
|
|
|
baseURL: `http://localhost:8080/`, |
|
|
|
|
headers: { |
|
|
|
|
'xc-auth': context.token, |
|
|
|
|
}, |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test('rename, delete', async () => { |
|
|
|
|
// if project already exists, delete it
|
|
|
|
|
try { |
|
|
|
|
const projectList = await api.project.list(); |
|
|
|
|
const project = projectList.list.find((p: any) => p.title === 'project-firstName'); |
|
|
|
|
if (project) { |
|
|
|
|
await api.project.delete(project.id); |
|
|
|
|
console.log('deleted project: ', project.id); |
|
|
|
|
} |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log('Error: ', e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
await dashboard.clickHome(); |
|
|
|
|
await projectPage.createProject({ name: 'project-firstName', withoutPrefix: true }); |
|
|
|
|
await dashboard.clickHome(); |
|
|
|
|