Skip to content

Commit

Permalink
feat: add modal c onfirmation on frontend tests
Browse files Browse the repository at this point in the history
  • Loading branch information
edelclaux committed Jan 23, 2025
1 parent 235565e commit d8f8e1c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/cypress/e2e/import/constants/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ export const getSelectorsForStep = (stepName) => {

export const SELECTOR_IMPORT_MODAL_DELETE = '[data-qa=import-modal-delete]';
export const SELECTOR_IMPORT_MODAL_DELETE_VALIDATE = '[data-qa=modal-delete-validate]';

export const SELECTOR_IMPORT_MODAL_EDIT = '[data-qa=import-modal-edit]';
export const SELECTOR_IMPORT_MODAL_EDIT_VALIDATE = '[data-qa=modal-edit-validate]';

export const SELECTOR_IMPORT_MODAL_DESTINATION_START = '[data-qa=import-modal-destination-start]';
export const SELECTOR_IMPORT_FIELDMAPPING_DATE_MIN = '[data-qa=import-fieldmapping-theme-date_min]';
export const SELECTOR_IMPORT_FIELDMAPPING_OBSERVERS =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
getSelectorImportListTableRowEdit,
getSelectorImportListTableRowDelete,
SELECTOR_IMPORT_MODAL_DELETE_VALIDATE,
SELECTOR_IMPORT_MODAL_EDIT_VALIDATE,
} from './constants/selectors';
import { USERS } from './constants/users';
import { TIMEOUT_WAIT, VIEWPORTS } from './constants/common';
Expand Down Expand Up @@ -93,6 +94,8 @@ describe('Import Process Navigation', () => {
// Navigation from list to upload by using Edit action
cy.get('@rowIndex').then((rowIndex) => {
cy.get(getSelectorImportListTableRowEdit(rowIndex)).should('be.enabled').click();
cy.get(SELECTOR_IMPORT_MODAL_EDIT_VALIDATE).should('exist').click()

});
cy.wait(TIMEOUT_WAIT);
// Should go on last step edited --> decode file
Expand Down Expand Up @@ -171,6 +174,7 @@ describe('Import Process Navigation', () => {
// Navigation from list to upload by using Edit action
cy.get('@rowIndex').then((rowIndex) => {
cy.get(getSelectorImportListTableRowEdit(rowIndex)).should('be.enabled').click();
cy.get(SELECTOR_IMPORT_MODAL_EDIT_VALIDATE).should('exist').click()
});
cy.wait(TIMEOUT_WAIT);
// Should go on last step edited --> decode file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
SELECTOR_IMPORT_FIELDMAPPING_WKT,
SELECTOR_IMPORT_FOOTER_DELETE,
SELECTOR_IMPORT_FOOTER_SAVE,
SELECTOR_IMPORT_MODAL_EDIT_VALIDATE,
} from './constants/selectors';

// ////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -48,6 +49,7 @@ function checkImportIsNotFirstInList(importId) {

function clickOnFirstLineEdit() {
cy.get(getSelectorImportListTableRowEdit(0)).click();
cy.get(SELECTOR_IMPORT_MODAL_EDIT_VALIDATE).should('exist').click()
cy.wait(TIMEOUT_WAIT);
}

Expand Down

0 comments on commit d8f8e1c

Please sign in to comment.