Skip to content
This repository has been archived by the owner on Mar 31, 2021. It is now read-only.

Commit

Permalink
#46 update language
Browse files Browse the repository at this point in the history
  • Loading branch information
metas-dh committed Jul 10, 2019
1 parent bb18491 commit 9ae84f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
5 changes: 1 addition & 4 deletions cypress/integration/masterdata/warehouse_spec.js
@@ -1,5 +1,4 @@
import { Warehouse, locator, routes } from '../../support/utils/warehouse';
import { getLanguageSpecific } from '../../support/utils/utils';
import { Warehouse } from '../../support/utils/warehouse';

describe('Create test: warehouse, https://github.com/metasfresh/metasfresh-e2e/issues/46', function() {
const date = new Date(Date.now() - new Date().getTimezoneOffset() * 60000).toISOString();
Expand All @@ -11,8 +10,6 @@ describe('Create test: warehouse, https://github.com/metasfresh/metasfresh-e2e/i
Object.assign(new Warehouse(), warehouseJson)
.setName(warehouseName)
.setValue(warehouseValue)
// .setLocator(locator)
// .setRoutes(getLanguageSpecific(routes, 'DocBaseType'))
.apply();
});
});
Expand Down
14 changes: 7 additions & 7 deletions cypress/support/utils/warehouse.js
@@ -1,4 +1,5 @@
import {RewriteURL} from "./constants";
import { RewriteURL } from './constants';
import { getLanguageSpecific } from './utils';

export class Warehouse {
constructor(name) {
Expand Down Expand Up @@ -34,7 +35,7 @@ export class Warehouse {
}
}

export class WarehouseLocator {
export class WarehouseLocator {
setX(x) {
cy.log(`WarehouseLocator - set x= ${x}`);
this.x = x;
Expand Down Expand Up @@ -79,7 +80,6 @@ export class WarehouseRoute {
}
}


function applyWarehouse(Warehouse) {
cy.visitWindow('139', 'NEW')
.writeIntoStringField('Name', Warehouse.name)
Expand All @@ -88,8 +88,8 @@ function applyWarehouse(Warehouse) {
cy.selectNthInListField('C_BPartner_Location_ID', 1, false);
Warehouse.locators.forEach(locator => {
applyLocator(locator);
Warehouse.routes.forEach(routes => {
applyRoutes(routes);
Warehouse.routes.forEach(route => {
applyRoute(route);
});
});
}
Expand All @@ -107,9 +107,9 @@ function applyLocator(locator) {
.pressDoneButton();
}

function applyRoutes(routes) {
function applyRoute(route) {
cy.get(`#tab_M_Warehouse_Routing`).click();
cy.pressAddNewButton()
.selectInListField('DocBaseType', routes.docBaseType, true) // note: the way it's implemented now, there's no de_DE support!
.selectInListField('DocBaseType', getLanguageSpecific(route, 'docBaseType'), true) // note: the way it's implemented now, there's no de_DE support!
.pressDoneButton();
}

0 comments on commit 9ae84f8

Please sign in to comment.