Skip to content

Commit

Permalink
Add a cypress test for process monitoring (#6351)
Browse files Browse the repository at this point in the history
Signed-off-by: vlo-rte <valerie.longa@rte-france.com>
  • Loading branch information
vlo-rte authored and freddidierRTE committed May 14, 2024
1 parent 40c7a8c commit f4a2e50
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config/docker/ui-config/web-ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
{ "field": "startDate", "type": "date", "colName": "Start Date", "size": "200"},
{ "field": "titleTranslated", "colName": "Title", "size": "250"},
{ "field": "entityRecipients", "type": "array", "colName": "Entity Recipients", "size": "400"},
{ "field": "data.message", "colName": "My field", "size": "300"},
{ "field": "data.richMessage", "colName": "My field", "size": "300"},
{ "field": "summaryTranslated", "colName": "Summary", "size": "250"},
{ "field": "data.error", "colName": "My second field", "size": "100"}
],
Expand Down
38 changes: 38 additions & 0 deletions src/test/cypress/cypress/integration/MonitoringProcessus.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@

import {OpfabGeneralCommands} from "../support/opfabGeneralCommands"
import {ScriptCommands} from "../support/scriptCommands";
import {AgGridCommands} from "../support/agGridCommands";

describe('Monitoring processus screen tests', function () {

const opfab = new OpfabGeneralCommands();
const script = new ScriptCommands();
const agGrid = new AgGridCommands();

before('Set up configuration', function () {
script.deleteAllCards();
Expand All @@ -22,6 +24,42 @@ describe('Monitoring processus screen tests', function () {
});


it('Check cards reception for monitoring processus screen', function () {

opfab.loginWithUser('operator2_fr');

opfab.navigateToMonitoringProcessus();

// operator2_fr should see the grid of cards
cy.get("#opfab-processmonitoring-table-grid").should("exist");

// Should have 3 cards
agGrid.countTableRows('#opfab-processmonitoring-table-grid', 3);

agGrid.cellShould('#opfab-processmonitoring-table-grid', 0, 2, 'have.text', 'Message');
agGrid.cellShould('#opfab-processmonitoring-table-grid', 0, 3, 'have.text', '');
agGrid.cellShould('#opfab-processmonitoring-table-grid', 0, 4, 'have.text',
'{\"ops\":[{\"insert\":\"France-England\'s interconnection is 100% operational / Result of the maintenance is <OK>\\n\"}]}');
agGrid.cellShould('#opfab-processmonitoring-table-grid', 0, 5, 'have.text',
'Message received : France-England\'s interconnection is 100% operational / Result of the maintenance is <OK>');
agGrid.cellShould('#opfab-processmonitoring-table-grid', 0, 6, 'have.text', '');

agGrid.cellShould('#opfab-processmonitoring-table-grid', 2, 3, 'have.text',
'ENTITY1_FR, ENTITY2_FR, ENTITY3_FR');

// No card detail is displayed
cy.get('of-card').should('not.exist');

// Opens the first card, checks that its content is visible
agGrid.clickCell('#opfab-processmonitoring-table-grid', 0, 1);
cy.get('of-card').first().should('exist');

// Closes the card content and check card body is no longer visible
cy.get("#opfab-close-card").click();
cy.get('of-card').should('not.exist');
});


it('Check navigation between dates', function () {
const currentDate = new Date(2024, 3, 16, 11, 35);
opfab.loginWithUser('operator2_fr');
Expand Down

0 comments on commit f4a2e50

Please sign in to comment.