Skip to content
Snippets Groups Projects
Commit 271dfe9b authored by Mathieu Duckerts-Antoine's avatar Mathieu Duckerts-Antoine
Browse files

[IMP] web: adapt test_utils_control_panel


The control panel test helpers related to the "time range" menu have
been removed and a new helper for the "comparison" menu has been added.

Task ID: 2245719

Co-authored-by: default avatarMathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: default avatarJulien Mougenot <jum@odoo.com>
parent fed0b52d
No related branches found
No related tags found
No related merge requests found
......@@ -154,13 +154,8 @@ odoo.define('web.test_utils', async function (require) {
editFavoriteName: testUtilsControlPanel.editFavoriteName,
saveFavorite: testUtilsControlPanel.saveFavorite,
deleteFavorite: testUtilsControlPanel.deleteFavorite,
// TimeRangeMenu interactions
toggleTimeRangeMenu: testUtilsControlPanel.toggleTimeRangeMenu,
selectField: testUtilsControlPanel.selectField,
selectRange: testUtilsControlPanel.selectRange,
selectComparisonRange: testUtilsControlPanel.selectComparisonRange,
toggleTimeRangeMenuBox: testUtilsControlPanel.toggleTimeRangeMenuBox,
applyTimeRange: testUtilsControlPanel.applyTimeRange,
// ComparisonMenu interactions
toggleComparisonMenu: testUtilsControlPanel.toggleComparisonMenu,
// SearchBar interactions
getFacetTexts: testUtilsControlPanel.getFacetTexts,
removeFacet: testUtilsControlPanel.removeFacet,
......
......@@ -225,60 +225,8 @@ odoo.define('web.test_utils_control_panel', function (require) {
* @param {EventTarget} el
* @returns {Promise}
*/
async function toggleTimeRangeMenu(el) {
await click(getNode(el).querySelector(`div.o_time_range_menu > button`));
}
/**
* @param {EventTarget} el
* @param {string} fieldName
* @returns {Promise}
*/
async function selectField(el, fieldName) {
await editSelect(
findItem(getNode(el), `div.o_time_range_section select`, 0),
fieldName
);
}
/**
* @param {EventTarget} el
* @param {string} range
* @returns {Promise}
*/
async function selectRange(el, range) {
await editSelect(
findItem(getNode(el), `div.o_time_range_section select`, 1),
range
);
}
/**
* @param {EventTarget} el
* @param {string} comparisonRange
* @returns {Promise}
*/
async function selectComparisonRange(el, comparisonRange) {
await editSelect(
findItem(getNode(el), `div.o_time_range_section select`, 2),
comparisonRange
);
}
/**
* @param {EventTarget} el
* @returns {Promise}
*/
async function toggleTimeRangeMenuBox(el) {
await click(getNode(el).querySelector(`div.o_time_range_section input`));
}
/**
* @param {EventTarget} el
* @returns {Promise}
*/
async function applyTimeRange(el) {
await click(getNode(el).querySelector(`div.o_time_range_menu ul button`));
async function toggleComparisonMenu(el) {
await click(getNode(el).querySelector(`div.o_comparison_menu > button`));
}
/**
......@@ -420,13 +368,8 @@ odoo.define('web.test_utils_control_panel', function (require) {
editFavoriteName,
saveFavorite,
deleteFavorite,
// TimeRangeMenu interactions
toggleTimeRangeMenu,
selectField,
selectRange,
selectComparisonRange,
toggleTimeRangeMenuBox,
applyTimeRange,
// ComparisonMenu interactions
toggleComparisonMenu,
// SearchBar interactions
getFacetTexts,
removeFacet,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment