Headless CMS and Content Managment Hub
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

35 lines
962 B

/*
* Squidex Headless CMS
*
* @license
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
*/
import { test as setup } from '../given-app/_fixture';
import { getRandomId, writeJsonAsync } from '../utils';
const fields = [{
name: 'my-string',
}];
setup('prepare schema', async ({ appName, schemasPage, schemaPage }) => {
const schemaName = `schema-${getRandomId()}`;
await schemasPage.goto(appName);
const createDialog = await schemasPage.openSchemaDialog();
await createDialog.enterName(schemaName);
await createDialog.save();
await schemaPage.publish();
for (const field of fields) {
const fieldDialog = await schemaPage.openFieldWizard();
await fieldDialog.enterName(field.name);
await fieldDialog.enterType('String');
await fieldDialog.createAndClose();
}
await writeJsonAsync('schema', { schemaName });
await writeJsonAsync('fields', { fields });
});