create steps
This commit is contained in:
@@ -1,44 +1,44 @@
|
||||
'use strict';
|
||||
"use strict";
|
||||
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
// Add projects table records
|
||||
await queryInterface.bulkInsert('Projects', [
|
||||
await queryInterface.bulkInsert("Projects", [
|
||||
{
|
||||
name: 'Project 1',
|
||||
detail: 'Details of Project 1',
|
||||
name: "Project 1",
|
||||
detail: "Details of Project 1",
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
{
|
||||
name: 'Project 2',
|
||||
name: "Project 2",
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
{
|
||||
name: 'Project 3',
|
||||
name: "Project 3",
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
]);
|
||||
|
||||
// Add folders table records
|
||||
await queryInterface.bulkInsert('folders', [
|
||||
await queryInterface.bulkInsert("folders", [
|
||||
{
|
||||
name: 'Folder 1',
|
||||
detail: 'Details of Folder 1',
|
||||
name: "Folder 1",
|
||||
detail: "Details of Folder 1",
|
||||
projectId: 1,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
{
|
||||
name: 'Folder 2',
|
||||
name: "Folder 2",
|
||||
projectId: 1,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
{
|
||||
name: 'Folder 3',
|
||||
name: "Folder 3",
|
||||
projectId: 1,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
@@ -46,9 +46,9 @@ module.exports = {
|
||||
]);
|
||||
|
||||
// Add runs table records
|
||||
await queryInterface.bulkInsert('runs', [
|
||||
await queryInterface.bulkInsert("runs", [
|
||||
{
|
||||
name: 'Run 1',
|
||||
name: "Run 1",
|
||||
projectId: 1,
|
||||
configurations: null,
|
||||
description: null,
|
||||
@@ -57,7 +57,7 @@ module.exports = {
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
{
|
||||
name: 'Run 2',
|
||||
name: "Run 2",
|
||||
projectId: 1,
|
||||
configurations: null,
|
||||
description: null,
|
||||
@@ -66,7 +66,7 @@ module.exports = {
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
{
|
||||
name: 'Run 3',
|
||||
name: "Run 3",
|
||||
projectId: 1,
|
||||
configurations: null,
|
||||
description: null,
|
||||
@@ -77,36 +77,74 @@ module.exports = {
|
||||
]);
|
||||
|
||||
// Add cases table records
|
||||
await queryInterface.bulkInsert('cases', [
|
||||
await queryInterface.bulkInsert("cases", [
|
||||
{
|
||||
title: 'Sample Case 1',
|
||||
title: "Sample Case 1",
|
||||
state: 1,
|
||||
priority: 1,
|
||||
type: 1,
|
||||
automationStatus: 1,
|
||||
description: 'Sample description for case 1',
|
||||
description: "Sample description for case 1",
|
||||
template: 1,
|
||||
preConditions: 'Sample pre-conditions for case 1',
|
||||
expectedResults: 'Sample expected results for case 1',
|
||||
preConditions: "Sample pre-conditions for case 1",
|
||||
expectedResults: "Sample expected results for case 1",
|
||||
folderId: 1,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
{
|
||||
title: 'Sample Case 2',
|
||||
title: "Sample Case 2",
|
||||
state: 1,
|
||||
priority: 1,
|
||||
type: 1,
|
||||
automationStatus: 1,
|
||||
description: 'Sample description for case 2',
|
||||
description: "Sample description for case 2",
|
||||
template: 1,
|
||||
preConditions: 'Sample pre-conditions for case 2',
|
||||
expectedResults: 'Sample expected results for case 2',
|
||||
preConditions: "Sample pre-conditions for case 2",
|
||||
expectedResults: "Sample expected results for case 2",
|
||||
folderId: 1,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
]);
|
||||
|
||||
// Add steps table records
|
||||
await queryInterface.bulkInsert("steps", [
|
||||
{
|
||||
step: "Sample Step 1",
|
||||
result: "Sample Result 1",
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
{
|
||||
step: "Sample Step 2",
|
||||
result: "Sample Result 2",
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
]);
|
||||
|
||||
// Add case-step join table
|
||||
await queryInterface.bulkInsert("cases_steps", [
|
||||
{
|
||||
caseId: 1,
|
||||
stepId: 1,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
{
|
||||
caseId: 1,
|
||||
stepId: 2,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
{
|
||||
caseId: 2,
|
||||
stepId: 2,
|
||||
createdAt: new Date(),
|
||||
updatedAt: new Date(),
|
||||
},
|
||||
]);
|
||||
},
|
||||
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
|
||||
Reference in New Issue
Block a user