Skip to content

Commit

Permalink
Merge pull request #7499 from jmcameron/fix-payroll-tests
Browse files Browse the repository at this point in the history
Fix payroll tests
  • Loading branch information
jmcameron authored Feb 21, 2024
2 parents 8418a7a + e185992 commit cb29db9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
3 changes: 3 additions & 0 deletions client/src/modules/multiple_payroll/modals/search.modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ function MultiPayrollSearchModalController(
// assign already defined custom filters to searchQueries object
vm.searchQueries = util.maskObjectFromKeys(filters, searchQueryOptions);

// Default to enterprise currency
vm.searchQueries.currency_id = vm.enterpriseCurrencyId;

// load all Paiement Status
Payroll.paymentStatus()
.then((paymentStatus) => {
Expand Down
26 changes: 11 additions & 15 deletions test/end-to-end/payrollProcess/payroll_process.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,8 @@ test.describe('Payroll Process Management', () => {

const gridId = 'multipayroll-grid';

// @TODO : Fix; works alone and locally, fails in CI
test.skip(`should find Default Employee In Default Payroll Period`, async () => {
// Wait for modal dialog to appear (or open it)
const modalUp = await TU.isPresent('.modal-dialog');
if (!modalUp) {
await TU.buttons.search();
await TU.waitForSelector('.modal-dialog');
}
test(`should find Default Employee In Default Payroll Period`, async () => {
await TU.waitForSelector('.modal-dialog bh-payroll-status-select');
await searchModalPage.payrollPeriod(defaultValue.period);
await searchModalPage.selectCurrency(defaultValue.currency);
await searchModalPage.submit();
Expand All @@ -52,10 +46,11 @@ test.describe('Payroll Process Management', () => {
await page.checkEmployeeCount(employeeCount, `The number of Defined employee should be ${employeeCount}`);
});

// @TODO : Fix; works alone and locally, fails in CI
test.skip(`should configure multiple employees for payment`, async () => {
test(`should configure multiple employees for payment`, async () => {
// Make sure the grid is loaded
await TU.waitForSelector('.ui-grid-canvas .ui-grid-row');

// Select the first employee (unconfigured at this point)
await GU.selectRow(gridId, 0);

await TU.locator('[data-action="open-menu"]').click();
Expand All @@ -64,18 +59,19 @@ test.describe('Payroll Process Management', () => {
await components.notification.hasSuccess();
});

// @TODO : Fix; works alone and locally, fails in CI
test.skip(`Configure and edit Rubrics Payroll values`, async () => {
test(`Configure and edit Rubrics Payroll values`, async () => {
// Make sure the grid is loaded
await TU.waitForSelector('.ui-grid-canvas .ui-grid-row');
await page.editPayrollRubric(employeeRef);
});

// @TODO: Fix. Works alone but fails with other tests
test.skip(`should set multiple employees on waiting list of payroll`, async () => {
test(`should set multiple employees on waiting list of payroll`, async () => {
await TU.buttons.search();

await TU.waitForSelector('.modal-dialog');
await components.payrollStatusSelect.set(['Configured']);

// Click on another element to force closing of the search status select drop-down
await TU.locator('.modal-dialog input[name="display_name"]').click();
await searchModalPage.submit();

// Make sure the grid is loaded
Expand Down
3 changes: 3 additions & 0 deletions test/end-to-end/shared/components/bhPayrollStatusSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,8 @@ module.exports = {

await TU.series(payrollStatus,
state => TU.uiSelect('$ctrl.selectedPayrollStatus', state, null, IS_MULTIPLE_SELECTION));

// Let the GUI know we are finished selecting from the drop-down
// ??? return TU.locator(locator).blur();
},
};

0 comments on commit cb29db9

Please sign in to comment.