Skip to content

Commit

Permalink
fix(stock): invalid tests locator
Browse files Browse the repository at this point in the history
This commit replaces custom bhDepotSelect code with FU.uiSelect() to
ensure that the test correctly references the underlying element.
  • Loading branch information
jniles committed Sep 14, 2017
1 parent 724fb9e commit 57be952
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion test/data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ INSERT INTO permission (unit_id, user_id) VALUES
-- [Folder] reports/aged_debtors: The Report Aged Debtors
(151,1),

-- [Folder] Cashflow report:
-- [Folder] Cashflow report:
(145,1),

-- [Folder] reports/account_reports: The Report accounts
Expand Down
8 changes: 2 additions & 6 deletions test/end-to-end/shared/components/bhDepotSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ const FU = require('../FormUtils');
module.exports = {
selector : '[bh-depot-select]',
set : function set(depot, id) {
const locator = (id) ? by.id(id) : by.css(this.selector);
const target = element(locator);

target.click();

FU.dropdown('$ctrl.depotUuid', depot, target);
const anchor = id ? element(by.id(id)) : $('body');
FU.uiSelect('$ctrl.depotUuid', depot, anchor);
},
};
10 changes: 5 additions & 5 deletions test/end-to-end/shared/search.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,11 @@ class SearchModal {
FU.input('$ctrl.searchQueries.description', description, this.element);
}

setEntryExit (value) {
setEntryExit(value) {
FU.radio('$ctrl.searchQueries.is_exit', value);
}

setMovementReason (reason) {
setMovementReason(reason) {
FU.uiSelect('$ctrl.searchQueries.flux_id', reason);
}

Expand Down Expand Up @@ -122,19 +122,19 @@ class SearchModal {
bhSupplierSelect.set(supplier);
}

setDepot (depot){
setDepot(depot) {
bhDepotSelect.set(depot);
}

setInventory (inventory){
setInventory(inventory) {
bhInventorySelect.set(inventory);
}

setLotLabel(label) {
FU.input('$ctrl.searchQueries.label', label, this.element);
}

setdateInterval (dateFrom, dateTo, id) {
setdateInterval(dateFrom, dateTo, id) {
bhDateInterval.range(dateFrom, dateTo, id);
}

Expand Down
2 changes: 1 addition & 1 deletion test/end-to-end/stock/stock.entry.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const EntryPage = require('./stock.entry.page');

function StockEntryTests() {
const DEPOT_PRINCIPAL = 'Depot Principal';
const DEPOT_SECONDAIRE = 'Depot Secondaire';
const DEPOT_SECONDAIRE = 'Second';
const DESCRIPTION = 'Entree de stock';

// the page object
Expand Down
3 changes: 2 additions & 1 deletion test/end-to-end/stock/stock.lots.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function StockLotsRegistryTests() {
const LOT_FOR_ALLTIME = 16;
const LOT_FOR_TODAY = 10;
const LOT_FOR_LAST_YEAR = 16;


it(`finds ${LOT_FOR_TODAY} lot for today`, () => {
modal.switchToDefaultFilterTab();
Expand All @@ -51,6 +51,7 @@ function StockLotsRegistryTests() {
});

it('find lots in depot principal', () => {
browser.debugger();
modal.setDepot('Depot Principal');
modal.submit();
GU.expectRowCount(gridId, 8 + depotGroupingRow);
Expand Down

0 comments on commit 57be952

Please sign in to comment.