Commit 71e1b7aa authored by Alexander Philipp Nowosad's avatar Alexander Philipp Nowosad
Browse files

Fix e2e tests

parent f7fd2cbc
Pipeline #139193 passed with stages
in 8 minutes and 20 seconds
...@@ -74,12 +74,7 @@ ...@@ -74,12 +74,7 @@
} }
] ]
], ],
"relationshipTypes": [ "relationshipTypes": ["requires", "excludes", "supports", "hurts"],
"requires",
"excludes",
"supports",
"hurts"
],
"_id": "1625144329606" "_id": "1625144329606"
}, },
{ {
...@@ -123,9 +118,7 @@ ...@@ -123,9 +118,7 @@
{ {
"module": "Canvas Module", "module": "Canvas Module",
"method": "editCanvas", "method": "editCanvas",
"outputMappings": [ "outputMappings": [[]]
[]
]
} }
], ],
"_id": "1635786343509" "_id": "1635786343509"
...@@ -239,9 +232,7 @@ ...@@ -239,9 +232,7 @@
"module": "Canvas Module", "module": "Canvas Module",
"method": "editCanvas", "method": "editCanvas",
"predefinedInput": null, "predefinedInput": null,
"outputMappings": [ "outputMappings": [[]]
[]
]
} }
], ],
"_id": "1635787346356" "_id": "1635787346356"
......
...@@ -77,7 +77,7 @@ describe('Enaction', () => { ...@@ -77,7 +77,7 @@ describe('Enaction', () => {
cy.contains('.btn', 'Execute next step').click(); cy.contains('.btn', 'Execute next step').click();
cy.get('#name').clear(); cy.get('#name').clear();
cy.get('#name').type('TestInstance'); cy.get('#name').type('TestInstance');
cy.contains('.btn', 'Create Feature Model Instance').click(); cy.contains('.btn', 'Create Canvas Artifact').click();
cy.contains('.btn', 'Execute next step').click(); cy.contains('.btn', 'Execute next step').click();
cy.contains('app-canvas-building-block', 'Products & Services') cy.contains('app-canvas-building-block', 'Products & Services')
.find('.fa-plus-square') .find('.fa-plus-square')
...@@ -117,7 +117,12 @@ describe('Enaction', () => { ...@@ -117,7 +117,12 @@ describe('Enaction', () => {
'have.text', 'have.text',
'Select Method Building Block to add to TODO' 'Select Method Building Block to add to TODO'
); );
cy.get(':nth-child(2) > app-development-method-selection-form > .d-flex > .btn').click(); cy.get(
cy.get('.modal-title').should('have.text', ' Configure Building Block Complete '); ':nth-child(2) > app-development-method-selection-form > .d-flex > .btn'
).click();
cy.get('.modal-title').should(
'have.text',
' Configure Building Block Complete '
);
}); });
}); });
import Chainable = Cypress.Chainable; import Chainable = Cypress.Chainable;
const expertModels = (): Chainable => { const expertModels = (): Chainable => {
return cy.getPane('List of Expert Business Knowledge Models'); return cy.getPane('Canvas Building Blocks');
}; };
const modelInfo = (): Chainable => { const modelInfo = (): Chainable => {
return cy.getPane('Model Info'); return cy.getPane('Info');
}; };
const authorInfo = (): Chainable => { const authorInfo = (): Chainable => {
...@@ -16,7 +16,7 @@ describe('Expert Models', () => { ...@@ -16,7 +16,7 @@ describe('Expert Models', () => {
it('import expert model', () => { it('import expert model', () => {
cy.fixture('expertModel').then((model) => { cy.fixture('expertModel').then((model) => {
cy.visit('http://localhost:4200/expertModels/'); cy.visit('http://localhost:4200/expertModels/');
cy.contains('div.bg-white', 'Import Expert Model').within(() => { cy.contains('div.bg-white', 'Import Canvas Building Block').within(() => {
cy.get('input[type=file]').then((input: JQuery<HTMLInputElement>) => { cy.get('input[type=file]').then((input: JQuery<HTMLInputElement>) => {
const file = new File([JSON.stringify(model)], 'Test.json', { const file = new File([JSON.stringify(model)], 'Test.json', {
type: 'application/json', type: 'application/json',
...@@ -26,13 +26,10 @@ describe('Expert Models', () => { ...@@ -26,13 +26,10 @@ describe('Expert Models', () => {
input.get()[0].files = dataTransfer.files; input.get()[0].files = dataTransfer.files;
input.get()[0].dispatchEvent(new Event('change')); input.get()[0].dispatchEvent(new Event('change'));
}); });
cy.contains('.btn', 'Import Expert Model').click(); cy.contains('.btn', 'Import Canvas Building Block').click();
}); });
}); });
cy.contains( expertModels().within(() => {
'div.bg-white',
'List of Expert Business Knowledge Models'
).within(() => {
cy.get('li').should('contain.text', 'Mobile Todo-Apps'); cy.get('li').should('contain.text', 'Mobile Todo-Apps');
cy.contains('.btn', 'View').click(); cy.contains('.btn', 'View').click();
}); });
...@@ -61,7 +58,7 @@ describe('Expert Models', () => { ...@@ -61,7 +58,7 @@ describe('Expert Models', () => {
cy.get('#name').type('Test Model'); cy.get('#name').type('Test Model');
cy.get('#description').clear(); cy.get('#description').clear();
cy.get('#description').type('Test Description'); cy.get('#description').type('Test Description');
cy.contains('.btn', 'Add Expert Business Knowledge Model').click(); cy.contains('.btn', 'Add Canvas Building Block').click();
expertModels().within(() => { expertModels().within(() => {
cy.get('.text-gray-dark').should('have.text', 'Test Model'); cy.get('.text-gray-dark').should('have.text', 'Test Model');
cy.contains('.btn', 'View').click(); cy.contains('.btn', 'View').click();
...@@ -73,13 +70,13 @@ describe('Expert Models', () => { ...@@ -73,13 +70,13 @@ describe('Expert Models', () => {
cy.contains('tr', 'Name').find('td').should('have.text', 'Test Author'); cy.contains('tr', 'Name').find('td').should('have.text', 'Test Author');
}); });
cy.contains('.nav-link', '2. Edit').click(); cy.contains('.nav-link', '2. Edit').click();
cy.contains('.btn', 'Edit Expert Model').click(); cy.contains('.btn', 'Edit Canvas Building Block').click();
cy.get('#name').clear(); cy.get('#name').clear();
cy.get('#name').type('Test Feature A'); cy.get('#name').type('Test Feature A');
cy.get('#description').clear(); cy.get('#description').clear();
cy.get('#description').type('My Feature Description'); cy.get('#description').type('My Feature Description');
cy.contains('.btn', 'Add Feature').click(); cy.contains('.btn', 'Add Feature').click();
cy.getPane('Model List').within(() => { cy.getPane('Feature tree').within(() => {
cy.contains('li', 'Key Partners').within(() => { cy.contains('li', 'Key Partners').within(() => {
cy.contains('div', 'Test Feature A') cy.contains('div', 'Test Feature A')
.find('small') .find('small')
...@@ -92,7 +89,7 @@ describe('Expert Models', () => { ...@@ -92,7 +89,7 @@ describe('Expert Models', () => {
cy.get('#type').select('Yes'); cy.get('#type').select('Yes');
cy.contains('.btn', 'Update Feature').click(); cy.contains('.btn', 'Update Feature').click();
}); });
cy.getPane('Model List').within(() => { cy.getPane('Feature tree').within(() => {
cy.contains('li', 'Key Activities').within(() => { cy.contains('li', 'Key Activities').within(() => {
cy.contains('li', 'Test Feature A').within(() => { cy.contains('li', 'Test Feature A').within(() => {
cy.get('div > :first-child > i').should( cy.get('div > :first-child > i').should(
......
...@@ -30,7 +30,7 @@ Cypress.Commands.add( ...@@ -30,7 +30,7 @@ Cypress.Commands.add(
); );
Cypress.Commands.add('getPane', (heading) => { Cypress.Commands.add('getPane', (heading) => {
return cy.contains('div.bg-white', heading); return cy.contains('div.bg-white.rounded', heading);
}); });
Cypress.Commands.add('getModal', () => { Cypress.Commands.add('getModal', () => {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment